Deploying OCS Inventory (for GLPI) on Various OSes

Agents are loaded on the individual systems that can be invoked with a simple command line.  When invoked they communicate systems settings and hardware information to the OCSNG server on .  GLPI can be programmed to automatically update any system that does not exist (based on IP address, and/or serial number, and/or system name etc), or GLPI can be set to not update this information at all.  GPLI also has the ability to import some or all of the information.  For instance, you may or may not want to import the printer queues.

All of the packages and installers make the assumption that you want to run things in daemon mode.  So using the installed and following the instructions with the installer will result in a system that updates every 4 hours or so.  This may be okay for a file server, but we should use this sparingly.

MAC (Tiger /Leopard / Snow Leopard)
There is a Mac .PKG file available from the downloads section of the OCS Next Generation (NG) site.  We are using version 1.3 as of this writing, but they go to pains to keep the agents compatible with the server so you may be able to use a new agent.


Installing and Configuring
For the most part you simply want to take a built package and place it in the Applications directory then invoke it with the simple line:

/Applications/ –debug –

Running the .pkg installer is going to place an entry in /Library/LaunchDaemons/org.ocsng.agent.plist that causes the agent to run in daemon mode at startup.  Not only that, it will be missing an entry defining the appropriate place to send the information in the agent config file


LINUX (Redhat / CentOS)

Version 5 —

rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
yum install -y ocsinventory-agent

ocsinventory-agent –server=


Version 6 —

rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum install -y ocsinventory-agent

ocsinventory-agent –server=


I’m not doing this in Solaris at the moment.  If someone has some nice install notes, then let me know.

There are a few ways to do this install with Windows and the primary difference is that the methosd that use installers assume that you want a service running that will keep poking the OCS inventory collection server.  I’d actually prefer we not do that and simply run the ocsinventory.exe from the command line with a / switch.  This lets you run the program when you want it updated and leave it off the rest of the time.

PSTools Method (not as a service)
This method uses pstools to copy data to the program files of the remote system and then executes the basic command.  It does not start a service. One key point. The location you copy files from should not have files specific to the system. So if you just copy from one system to another you will end up with hostname specific files in your library. Clean that up… or better yet pull these file from File01 in the pstools subfolder.

mkdir “\\target_system\c$\windows\system32\PsTools”
mkdir “\\target_system\c$\Program Files\OCS Inventory Agent”
copy “C:\PsTools” “\\target_system\c$\windows\system32\PsTools\”
copy “C:\ocsfiles\OCS Inventory Agent”  “\\target_system\c$\Program Files\OCS Inventory Agent\”
psexec \\target_system -s -u domain\Administrator -p password “c:\Program Files\OCS Inventory Agent\ocsinventory.exe” /

Experienced additional trouble with this method at forge and had to change to using cmd /k and a special ocs_contact.lnk

mkdir “\\target_system\c$\windows\system32\PsTools”
mkdir “\\target_system\c$\Program Files\OCS Inventory Agent”
copy “C:\deploy\PsTools” “\\target_system\c$\windows\system32\PsTools\”
copy “C:\deploy\OCS Inventory Agent”  “\\target_system\c$\Program Files\OCS Inventory Agent\”
psexec \\target_system -s -u msdomain\domain_admin_user -p password cmd /k “c:\Program Files\OCS Inventory Agent\Ocs_contact.lnk”

Installer Method

Installing GLPI and OCS in CentOS 5

This is a great program, that together with another program OCS will pull system information from all the system on the network to create an inventory, match this to users and then match the whole thing to a help desk system. It’s free.

Build a generic CentOS 5.x system and the prep the system


# Install required RPMS
yum install -y httpd  mysql-server php php-pdo php-mysql php-mbstring php-devel php-pear php-imap php-pear-DB  php-pear-Net-Socket php-pear-Auth-SASL php-pear-Net-SMTP imake  autoconf automake kernel-headers libgomp  glibc-headers glibc-devel gcc libc-client

# compile and install json
tar zxvf *.tgz
cd json-1.2.1
pecl install json

mkdir -pv /var/www/html/glpi
cd /var/wwwlhtml/
chown -R apache:apache glpi

# Edit the Set – memory_limit = 64M
vi /etc/php.ini

cd /etc
htpasswd -c .htpasswd admin

# Start the web server and database
chkconfig mysqld on
chkconfig httpd on
service mysqld start
service httpd restart

# Setup the Password and Database
mysqladmin -h localhost -u root -p ‘your_groovy_password’
mysql -u root -p
create database glpidb;
grant all privileges on glpidb.* to glpiuser@localhost identified by ‘glpi’;

The code is a tar.gz file so just tar zxvf the thing into the /var/www/html/glpi directory and using your browser visit the /glpi/ on your website. This will install the data to the database you selected and also check to make sure we covered all the requirements. From there you’ll have a user glpi with password glpi to begin the second part… the setup.

I’ve left this blank because, frankly, like any helpdesk it takes a lot of consideration and will be highly specific to your organizations needs.  I’d be happy to talk anyone about this because I have a pretty good idea about capabilities.  Just email me.

You probably won’t have ocsinvetory-agent installed in a yum repository, but if you have to deploy this agent with a number of systems you should install YUM and set this up.  There should be notes about this somewhere on this site.  Search for it.
yum install -y ocsinventory-agent
echo “OCSSERVER[0]=” >> /etc/sysconfig/ocsinventory-agent
echo “ support” >> /etc/hosts
ocsinventory-agent –server=

# Redhat manual install
yum install -y monitor-edid nmap perl-Crypt-SSLeay perl-XML-Simple perl-XML-SAX perl-XML-Parser perl-XML-NamespaceSupport perl-Proc-Daemon

mkdir agent; cd agent
wget ocsinventory-agent-1.1.2-1.el5.noarch.rpm
rpm -ihv *.rpm

echo “OCSSERVER[0]=” >> /etc/sysconfig/ocsinventory-agent
echo “ support” >> /etc/hosts