Prepare OCS Agent Package and deploy it
Before we start make sure that you have valid Certification Authority certificate. This MUST be the CA that issued the server certificate or should be from one of it’s trust chain.
If you have .crt file just rename it to .pem
- Open up the OCS Packager, press No if you don’t need to use PSExec. If using Active Directory, no need to use it. Fill in the data as below:
Command line switches:
/S /NOW /SERVER=https://ocsng.domain.local/ocsinventory /SSL=1 /NOSPLASH /NO_SYSTRAY
- /S – Silent
- /NOW – Run Inventory immediately after installation
- /SERVER=https://ocsng.domain.local/ocsinventory – address for reporting, mind the suffix – it’s not ocsreports like for web console!
- /SSL=1 – force using SSL
- /NOSPLASH – no splash screen at startup
- /NO_SYSTRAY – no systray – no need to bother users with new icons. Besides, user notification and interaction work perfectly without it
- Select output directory and press Next few times to finish
When everything is done you can just double-click the exported OcsPackage.exe and after few minutes you should have first computer reported in OCS Web Console!
- If the computer is not reporting, check few things:
- Check if OCS Inventory Service is running
- Check OCSInventory.log file located in c:\ProgramData\OCS Inventory NG\Agent\
If everything is Ok, we can try to build a package and deploy it to the computer:
- Navigate to your OCS Web interface and go into Deployment/Build
- Navigate to Deployment/Activate to active the package, most likely you will see some warning but it just indicates that apache cannot access the download directory but it CAN. I will try to cover this a bit later, maybe:
Click on the far right icon(the green one with arrow)
- Select manual, press OK:
- Press YES to confirm the warning:
- Now you can go to computer/deployment and select activated package. According to our config package will be downloaded after maximum of 1 hour. You can force it on the client, just restart the OCS Inventory Service
Logs from the Download component on client can be found in Download.log located in c:\ProgramData\OCS Inventory NG\Agent\
That is pretty much it!
If everything is working good, you can force usage of SSL by making redirect at Apache level:
nano /etc/apache2/sites-enabled/000-default.conf Redirect / https://ocsng.elemont.local/ <--mind the slash at the end! service apache2 restart
Now, you should be having fully working OCS Inventory NG server with SSL and deployment functionalities. I have checked this around 10 times and when this guide is followed to the line it works so please, double or triple check when having problems or errors. Nevertheless DO NOT HESITATE to leave a comment, post a problem or solution maybe.
- I always look forward for your feedback and will be more than happy to respond. Hope this guide will help and you enjoyed it like I did while creating it.
- As always I encourage you to leave a small donation (to the right->>) using secure PayPal as this will help me develop and keep my blog running!
Hi! Love your tutorials. Really in-depth and with the describing text really makes alot more sence than alot of other How-To’s out there! Keep up the good work :). I see you have Nagios setup aswell, any good reason for going for Nagios vs Zabbix?
Hello Trond, Thanks for your comment! I just write them in a way I could make use of them after a while:) Regarding Nagios vs Zabbix – to be honest I never used Zabbix so I cannot tell which is better. I used Nagios in one of my early jobs and thought that it’s quite good. These days there are many more like Grafana with all the plugins and others as well.
Really Nice Tutorial thank you!
Can you maybe add a Tutorial for Deploying via GPO.
I tried using the PSExec but somehow it does not work. If I run the “OcsPackage.exe” as Admin it works but without this its does not work.
And somehow there should be a easy solution completely via GPO + Deployment Tool.
It’s actually pretty easy! You build a ocspackage.exe using ocs packager tool, place it somewhere on the net like sysvol/scripts and then create a new gpo with scheduled task set to run only once at specific time and run asap when schedule is missed. then task will be removed after run.
trigger can be any, command line will be ocspackage.exe and that’s it! :)
And whats with the Rights Management?
Normal users cant install a Service…?
Maybe im wrong but isnt the Goal to install the Service everywhere?
yes, when you create a task to deploy agent, create it to run with highest privileges as well as set “NT Authority\SYSTEM” as executing user. Also, set the task to run immediately. Then OCS will install as service no matter what user is currently logged on.
Hi Milosz :)
Got my OCS Inventory 2.5 server up and running thanks to you!
Thank you very much.
Do you have any clue as to how I can launch something “verbose”?
Looks like OCS Inventory forces the install to be silent no matter what I do.
I have a installer (exe) that are not designed to be ran silently. So it seems like it doesn’t install.
I tried a dozen of installers, and all work except the one I really need to work.
Hey, good it worked for you! Thanks for your feedback. Regarding that installer I would start with option “Installation completion need user action” enabled. Also, you could wrap that installer in some msi wrapper, provide answers and install that way. When you deploy software it uses SYSTEM account that is why you do not have any screens. I think easiest way is to use msi wrapper software. There are many to choose from:)
Hello, first, thank you for your tutorial, i have a permission denied when i try http://localhost/ocsreports
How to solve that?
Hello Milosz, can you help me please to fix my problem? I followed your tutorial but I get an error when I try to access http://localhost/ocsreports.
You don’t have permission to access /ocsreports/ on this server.
at which stage/point this error occurs? If it’s after all steps or right after installation? Also, have you tried to access it from other computer using ip? Seems like permission issue in apache default.conf file to me
hy, thanks for your great installation manual, but i am not able to create adminsitrative radio buttons or checkboxes.
the checkboxes are just not visible
perhaps it has something todo with install of php-gd (i think it is missing)
Please try all types of checkboxes and textboxes. I think you can create a bug report this issue to the ocs-team or change your installation manual.
hey Fred, yeah, got your point. I will test it tomorrow. If you have pointed the php-gd maybe just give it a try and report back:) I will do some tests from my end, though
tutorial very good, your blog has helped me a lot in the past and still today. If you can help me with something extra … I can not configure the snmp issue, if you have any valuable tips or a specific tutorial … thank you!
Hey, thank you for this tutorial, everything is fine but unfortunately I have a problem installing the officepack plugin, I’m getting error when I try to install (MySQL error: Installation aborted!)
I must double check it but i think office pack is no longer supported. Keep in mind that since office 2013 and up(including offline, CTR and O365) you will not get the keys read as they are encrypted in OS. Only last part of it is available using OSPP.vbs script that comes with office setup
Thank you Milosz for providing these guides to OCS Inventory. Unfortunately I had built my project on CentOS, but regardless, I was able to fix many steps thanks to the information here. (If you’re reading this and stuck using CentOS, check out the guide on the Celerium blog here; https://celerium.org/2018/11/03/setup-install-ocsng-on-centos-7/)
Hi, thanks for the feedback. Unfortunately I’m more into Debian(as this was “my first” distro years ago). CentOS is a bit different but I’m glad you made it!. Thanks for your comment and links!
Great work. Could take a look,I have the same problem
Ocs works great but plugins not .
Yeah, I will look into it in some spare time. Maybe even upgrade the guide:) Thanks for the tip. I will post back!
I have the OCS NG installed in a domain with SSL. But when activating a package in Deployment, the system shows in error:
WARNING: Can’t find information file at https://ocsng.domain/download/1557338069/
WARNING: Can’t find fragments files at http://ocsng.domain/download/1557338069/
But if from the browser access to the following URL https://ocsng.domain/download/1557338069/info, it you show me the information:
hey, it looks like http/https problems. as i remember correctly i had to allow remote connections in the apache server. Do you test it from remote computers browser or localhost? Please provide apache logs, they should provide more information.
Good morning. Thanks for reply.
I’m using a dedicated Ubuntu server, I can access from any PC in my red, and external devices, like my phone.
x.x.16.103 is my PC.
x.x.16.4 is my external phone.
This is the log file: https://drive.google.com/open?id=11Vz3BFcFAG-PbHYX0XZQGLDFkwzEPeFZ
don’t see anything worrying apart from one 404 in the log. Check if download works from client side. Keep in mind, that in order to use SSL you need to set SSL=1 in the client and provide valid CA cert
ok but does the download actually work? I have the same message but download works correctly. I do not use “advanced features of teledeploy”, however
Hi, i have my OCS test machine on vmware and i’m at the moment where agent on windows is installed but i get
AGENT => Failed to retrieve Label . I don’t use SSL. Not sure in which config file i made mistake.
hey, please check the agent ini config file in C:\programdata\OCS Inventory NG\Agent. Review the URLs in server configuration and check apache2 logs for any access denied, 5xx errors or 404?
Hi, thanks for all, I get a problem with the installation of ssl :
this line : openssl pkcs12 -in ocsng.pfx -out ocsng.pem -nodes
give me : pkcs12: Cannot open input file ocsng.pfx, No such file or directory
pkcs12: Use -help for summary.
I don’t know what i’m supposed to do.
sorry for my english (i’m french)
thanks again if you take time for me.
hi, thanks for your comment. The error tell that openssl cannot find the .pfx file. If you specify name only(every OS) assumes the file is in the current dir(in linux like systems /tmp/some/directory# for example). Double check where .pfx file is and what is the current dir:)
thanks for the answer, but i don’t find ocsng.pfx
root@raspberrypi301:/tmp# find / -name “*.pfx” -print
and the only result is /usr/share/cmake-3.7/Templates/Windows/Windows_TemporaryKey.pfx
it’s like i don’t have any ocsng.pfx
Aaaah, ok. I see. In the guide I wrote that I have ssl certificate already generated but if you do not have any CA to get the cert from(like MS PKI) you can generate self signed cert using this guide:
Sorry mate but your tutorial was almost good, not that easy after all because i get an error 403 trying to reach http://your_OCS_Server_IP_or_Name/ocsreports
hey pls keep in mind that it was tested with specific ocs and debian versions. Please post some logs, maybe I will be able to help!
//install root certificate!
wget -O /usr/local/share/ca-certificates/root-ca.crt http://somedomain.com/crl/root-ca.cer
//update the certificate store
the certificates created key and pem are not enough?
hey, didn’t get that to be honest. What is not working?
is there way to extort ocsserver to accept data from host with agent which has cacert itself and denied from whose those that cacert doesn’t?
Hey if you require ssl on server side I believe this should enforce it. I didn’t check it, however. I will build more maintained version of this guide soon as there are many queries regarding it. Thanks!