Installing the OCS Inventory Agent 1.x on CentOS/RHEL

Open Computer and Software Inventory (OCS-Inventory) – is a free software that enables users to inventory their IT assets.

OCS collects information about the hardware and software of networked machines running the OCS client program (“OCS Inventory Agent”).

This guide describes how to install OCS-Inventory Client (ocsinventory-agent) Series 1.x on CentOS/RHEL.

Adding EPEL Repository

There is no OCS Inventory Agent package in the standard repositories, so we will take it from EPEL repository.

If you need, you can use the guide that describes the installation process of EPEL repository.

The example of EPEL installation on CentOS 6.4 – 64bit:

# wget
# rpm --import RPM-GPG-KEY-EPEL-6
# rm -f RPM-GPG-KEY-EPEL-6
# wget
# rpm -ivh epel-release-6-8.noarch.rpm
# rm -f epel-release-6-8.noarch.rpm

Installing OCS Inventory Agent

Install the OCS Inventory Agent 1.x with the following command:

# yum install ocsinventory-agent

Configuring OCS Inventory Agent

Open the configuration file.

# vi /etc/ocsinventory/ocsinventory-agent.cfg

Uncomment the following lines. Set a tag for the current server and the address of your OCS server.

server = http://your.ocs.server/ocsinventory
tag = your_tag

Change the line local = /var/lib/ocsinventory-agent to basevardir = /var/lib/ocsinventory-agent. Save and close the file.

Forcing the Inventory

By default, the ‘ocsinventory-agent’ script was added to ‘cron.hourly’ and it will send the inventory to your OCS server every hour.

I advice you to move the script to ‘cron.daily’, to send the inventory once a day. In most cases it will be enough.

# mv /etc/cron.hourly/ocsinventory-agent /etc/cron.daily/

To force the sending of inventory execute the following:

# /usr/sbin/ocsinventory-agent


The problems I have encountered.

Packages perl-XML-Simple and perl-Net-IP not available

I had the following errors on RHEL 6.4 x86_64 system.

Error: Package: ocsinventory-agent- (epel)
           Requires: perl(XML::Simple)
Error: Package: ocsinventory-agent- (epel)
           Requires: perl(Net::IP)
# yum install perl-XML-Simple perl-Net-IP
No package perl-XML-Simple available.
No package perl-Net-IP available.

It means that your system is not subscribed to the RHEL ‘optional’ channel.

You can manually subscribe your system or install the required packages from rpm.

Search for perl-XML-Simple and perl-Net-IP on and install them manually.


# rpm -ivh
# rpm -ivh

500 Can’t connect to your.ocs.server:80 (connect: Connection timed out)

The following error in ocsinventory-agent.log means that OCS server is not reachable.

Test the connection with ping and telnet.

# telnet your.ocs.server 80
Trying your.ocs.server ...
telnet: connect to address your.ocs.server: Connection timed out

Check your firewall.