- 1 Use OCSPackager
Open Computer and Software Inventory NG Packager is an application designed to prepare automated single “Click” end-user installation packages for windows. It also allows use an alternative user account to perform any kind of scripted task. This Packager is based on the NSIS script and RemCom utilities open source projects.
OCS Inventory NG Packager is GPL software.
i.e. free to use & copy (see http://www.opensource.org).
OCS Inventory is also Open Source! This means that if you want to modify the sources you can! However, if you want to change the source code and distribute the changed software, you must provide the source code of your updates as well, as is required by the GPL license terms.
We would like to thank Talha Tariq for the Remcom program. Visit his project at http://sourceforge.net/projects/rce/ .
Using OCS Inventory Packager is the fastest way to deploy and setup the OCS Inventory NG Agent on stand alone or domain integrated computers. It is based on the NSIS script and RemCom tools. It generates a file called ocspackage.exe based on your parameters, which allows a one click and/or a silent user install. Combined with the OcsLogon /install parameter this makes it easy to achieve a very fast service deployment on the Windows operating systems.
In this document a number of assumptions are made:
- We assume that you know the domain or local administrative account of your computers.
- You should also know how to generate or obtain a certificate file.
- You are familiar with common Windows administrative tasks.
Download the Packager and the latest OcsAgentSetup.exe program from the OCS Inventory Web Site.
Prepare your certificate (needed for software remote deployment).
Launch OcsPackager.exe and accept the License agreement.
The following window will appear:
“Files and Options” group box:
- On the “Exe File” line, select your freshly downloaded OcsAgentSetup.exe program. This entry is required !
- On the “Certificate file” line, select your cacert.pem file.
- The “Other files” line allows additional files to be specified which will be copied to your install folder.
- On “Command line options” line you should enter all the needed options for the Ocs Agent setup program (e.g. /server:my_server /pnum:8081 /S). Do not forget to specify the /S option for a silent installation.
- The “Label” line will create a “label” file containing your user prompt. The first time OcsInventory.exe starts, a popup using this prompt will be shown. The user entered value is called the “TAG”.
“Install will run under account” group box:
- On “User” line, enter the local admin account or a domain administrative account. On Active Directory domains, use “@” to separate the user from the domain name (e.g. email@example.com). On a NT4 domain use the “domain\user” syntax.
- Be careful when entering the password. It will not be validated at this point !
You should have something like this:
Click the “Next” button.
Select the destination folder and Click Ok.
At this point windows will briefly appear to generate ocspackage.exe.
You can now test ocspackage.exe by launching it under a normal user account (no administrative privileges).
A brief Ocs Inventory banner may show indicating the service setup is running.
A log file named ocspackage.log is created at install time.
You must now upload ocspackage.exe to the communication server or publish it on an alternative web server if you use the Ocslogon.exe [/url:] option.
Publishing on the communication server.
Log on to the administration console (version 4021 or higher) and select the Agent icon:
Then upload your “ocspackage.exe” file.
Deploying agent on a domain
Ocspackage.exe is now ready to be automatically deployed through the latest Ocslogon.exe login script (version 184.108.40.206 or higher)
Launcher “OcsLogon.exe” will by default try to connect to the Communication server using a DNS name of “ocsinventory-ng”. This would be like opening your favourite web browser and entering the URL http://ocsinventory-ng/ocsinventory.
|Note: http://ocsinventory-ng/ocsinventory is a virtual address - it acts as an Apache module which handles HTTP OCS Inventory agents' requests to a virtual directory “/ocsinventory”. Be sure that there is no directory with this name in root directory of Apache.|
To use a different URL should you not be able to add this DNS name, just rename “OcsLogon.exe” with the DNS name or IP address of the Communication server. This would be of the form “ocsinventory.domain.tld.exe” if you’ve created a DNS record “ocsinventory.domain.tld” for your server or “192.168.1.2.exe” if your server has 192.168.1.2 as it's IP address).
|Note: Always use latest version of OcsLogon.exe. You can get it from the latest package OCSNG_WINDOWS_AGENT_XX.zip.|
Create a new user GPO on an OU where you want OcsAgent to be deployed. In this one, go to Windows parameters – Script – Login script. Copy the “OcsLogon.exe” file (or the renamed one) to the Logon folder of this GPO. Use the parameters field to specify the OcsLogon options.
You can also use a computer GPO in the same way.
To setup ocspackage.exe OcsLogon has two new command line switches:
This option will cause an ocspackage.exe download from communication server instead of the normal ocsagent.exe. Ocslogon wil check if the service is already installed and exit if it is. If it is not installed ocspackage.exe is launched and the service is installed.
This option permits the download of ocspackage.exe from another server. This option can be very useful on a multiple domains architecture with no Trust relationships or multiple separate administrative accounts. This way, severals different ocspackage.exe binaries using correct domain administrative accounts can be used, and the OCS communication server does not have to perform this task.
Please note that the /deploy: option is compatible with Ocs service Agent.
Other possible usages
As you might have realised, it is also quite possible to use ocspackager to do any other deployment or administrative task unrelated to OCS Inventory Deployment.
One example is where you've got some computers that you do not want to setup OcsAgent on. These computers are not attached to your network but you'd like to deploy software without giving administrative account information or rights to a remote user.
In these situations Ocspackager is very useful because you can package any setup program with its own options. You just have to know it's silent option.
Administrative tasks can also be performed using a .vbs script. To do this, in “Exe file” field you should select the full path to your Cscript.exe file, in “other file” select your vbs file, and in “Command line options” type “[yourBatch.vbs] /B ”
The ocspackage.exe file properties will always contains the packaged file name plus it's version number.
Using Wine under Linux
OcsPackager works on a Linux server, the same as it does under Windows, by using the Wine package.
After installing "wine" according to the your distribution, there are two different ways to run OcsPackager:
- In graphical mode, right click on "OcsPackager.exe" and execute it with "Wine ...",
- In console mode, enter: wine oscpackager_directory / OcsPackager.exe
Once launched, you use OcsPackager exactly as described in this documentation.
Getting help in forums
If you are unable to diagnose the problem yourself, you can get help using OCS Inventory NG web site forums (http://forums.ocsinventory-ng.org/).
If you do so, please provide us with the following:
- Server operating system
- OCS Inventory NG server version and patch level
- Agent’s operating system
- OCS Inventory NG agent version
- Agent execution logs
- Run “AGENT_INSTALL_FOLDER\ocsinventory.exe /NP /DEBUG /SERVER=your_server_address” under Windows. Log file is created on folder “AGENT_INSTALL_FOLDER” under name “your_computer_name.log”.
- Run “ocsinv –debug > ocsinv.log” under Linux. Log file is “ocsinv.log”.
- Apache server error.log file, located for Windows under “SERVER_INSTALL_FOLDER\xampp\apache\logs\error.log” and for Linux under “/var/log/httpd/*error.log”.
- OCS Inventory NG Server log file, located for Windows under “SERVER_INSTALL_FOLDER\xampp\apache\logs\ocsinventory-NG.log” and for Linux under “/var/log/ocsinventory-NG/ocsinventory-NG.log”.
Thanks in advance.