OCSNG Inventory Management

Contents

Open Computer and Software Inventory

Open source GPL V2 software with *Nix and Windows inventory agents. Full web based management interface with advanced reporting capabilities. MySQL driven allows possibility to share system meta information with other MySQL Apps (Uber, etc.) It also integrates with GLPI, an Open Source full Asset Tracking system with ticket tracking.

Official Site:

http://www.ocsinventory-ng.org/

Reviews:

http://www.linux.com/feature/54300

http://www.linux.com/feature/40396

http://glpi-project.org/?lang=en

OCS Web Management Server

https://ocs.sagonet.com/ocsreports

user: 
password: 

You can run all manner of reports here and search for systems by MAC address, manufacturer, BIOS version, etc. You can run a report to see how many servers has less than X free drive space, what DIMM modules are installed, installed applications, etc. Very detailed reporting capabilities.

Admininfo

You can add custom fields to the OCS database through the OCS Web interface. The 7th yellow icon from the left in the upper right section of the screen (looks like two pieces of paper) is the "Admininfo" icon.

Here you can add customer fields that will apply to all hosts. They can be of type: text, integer, real and date. These fields must be manually set up and the data entered here, you can not tell the agent when it runs to populate them. However, once they are filled out the data in them IS actually stored on the clients. So if the database is lost the client (when it checks in next) will again populate this information back into the database. Any changes to the text file holding this information will be over written when the Agent contacts the server.

The file holding this info on Ubuntu is called ocsinv.adm and is located at:

/var/lib/ocsinventory-agent/http\:__ocs.sagonet.com_ocsinventory/ocsinv.adm

We could make fields here to hold information of projects, server data, testing info, etc. But remember any info placed here will be replicated onto the server so things like passwords, etc. are not a good idea, even though the file is outside the web root, etc.

Agent (Client) Installation

Linux:

PXE installs: You can now simply add :ocs as the ending (10th) argument in the PXE configuration string. In Cobbler, hit tab to edit the boot line and modify the kickstart argument, appending :ocs This will automatically install the client (version 0.9.2) from RPM and configure it. To see the scripted actions go to and example ks file and look at the ocs section:

http://ks.sagonet.com/?x=c53:::sda::cpnl:66.118.151.60:02:s4g0n3t:ocs

If using the old PXE system, there is a menu option to install it which defaults to yes (install it).

Installer Script: Scripted install for CentOS 3/4/5 and Debian 4/5 can be found here Just wget and run and it will completely install it on supported OSes.

Stop: You should rarely have to install OCS manually - only on Fedora or Suse is this currently required. If you do a PXE install of CentOS or Debian read the above two methods.

Manual Install

To install the client manually you can wget it from below and configure manually, or (easier) snip out the code from the ks script and make it into a stand alone script which is the code below. You can just run this but note it leaves the EPEL repository installed, but disabled. Might want to uninstall it completely from customer boxes - just uninstall the epel-release rpm. (Please see the section on Linux Agent Configuration for more information.)

Full and complete install details are at: http://wiki.ocsinventory-ng.org/index.php/OCS_Inventory_NG:Documentation#Under_Linux_Operating_Systems. but basically:

PXE RPM install method, installs all perl dependencies from EPEL repository. Easy as pie:

echo -e "Installing OCS. . . " > /dev/tty1
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum -y install ocsinventory-agent
echo -e "OCSMODE[0]=cron" >> /etc/sysconfig/ocsinventory-agent
echo -e "OCSSERVER[0]=ocs.sagonet.com" >> /etc/sysconfig/ocsinventory-agent
echo -e "OCSTAG[0]=Testing-PXE-Install" >> /etc/sysconfig/ocsinventory-agent
sed /s/enabled=1/enabled=0 /etc/yum.repos.d/epel.repo
rm -y epel-release-5-3.noarch.rpm

Or - El' Manual - you have to install all the perl mods yourself from rpms or cpan and build the agent. Ug.

wget ks.sagonet.com/tools/ocs/OCSNG_UNIX_AGENT-1.02.tar.gz
tar zxvf OCSNG_UNIX_AGENT-1.02.tar.gz 
cd Ocsinventory-Agent-1.0.1/
perl Makefile.PL 
make
make install (sudo make install if Ubuntu)

NOTE: You need some perl modules installed, described at http://wiki.ocsinventory-ng.org/index.php/OCS_Inventory_NG:Documentation#Requirements._2

Debian: sudo apt-get install libxml-simple-perl libcompress-zlib-perl libnet-ip-perl libwww-perl  libnet-ssleay-perl
 
CentOS: yum install perl-XML-Simple perl-Compress-Zlib perl-Net-IP perl-LWP  perl-Digest-MD5 perl-Net-SSLeay

Suse: zypper install perl-XML-Simple perl-Compress-Zlib perl-Net-IP perl-LWP  perl-Digest-MD5 perl-Net-SSLeay

When you run make install it will prompt you for configuration information. Everything is pretty obvious.
For the OCS Server use: ocs.sagonet.com , no credentials.
For Administrative Tag use: Dedicated-PXE
Send an inventory at the end of the install.

If you get errors installing the client please send them to me - send the full output if possible and what OS it was on, etc.

Linux - Scripted Install:

The on-line documentation for the agent references a no longer used setup.sh script, and the man page for the current agent does not talk about scripted installs, but by merging the two sources I found that the following appears to run the agent set up non-interactively, and I believe installs any needed (perl) dependencies, and runs an update to the communication server:

Callandor:~# ocsinventory-agent 1 -s ocs.sagonet.com

Follow up: See the PXE ks script (mentioned above) for the sed actions you can take to modify the config file so as to have the proper values. Using this setup script is the way to go.

Linux Agent Configuration

Note there are two current versions (0.9.2 and 1.02) and two formats of these versions. Yes, confusing. The .RPM version are slightly different than the .tar.gz versions. The RPM ones contains a config file in /etc/sysconfig/ocsinventory-agent and also includes /usr/share/doc/ocsinventory-agent-1.0.1/README.RPM - both missing from the .tar.gz version. It is advisable therefore to use the RPM versions. Both these versions are on the ks server and you can wget them as:

wget http://ks.sagonet.com/tools/ocs/ocsinventory-agent-1.0.1-2.el4.remi.noarch.rpm
wget http://ks.sagonet.com/tools/ocs/ocsinventory-agent-0.0.9.2-1.el5.noarch.rpm

The developers personal repo for OCS packages is at:

http://blog.famillecollet.com/pages/Config-en

http://rpms.famillecollet.com/

Windows:

Super easy:

Download the Agent from http://ks.sagonet.com/tools/ocs/OCSNG_WINDOWS_AGENT_1.02.zip

Run the installer, OCS Server Address: ocs.sagonet.com Admin Tag: Choose appropriate tag such as Inventory, Dedicated-PXE, etc.

Note: This runs as a service and is executed when the server reboots. There is no splash screen or task bar icon. It only appears in the service list and is set to run automatically. Works on Vista.

There are more advanced options, such as auto installing through Active Directory and creating packages to push out through the Agent (like a poor mans SMS) which are explained on the OCS wiki.

http://wiki.ocsinventory-ng.org/index.php/OCS_Inventory_NG:Documentation#Under_Windows_Operating_Systems.

Server Installation Requirements

Detailed install information is at:

http://wiki.ocsinventory-ng.org/index.php/OCS_Inventory_NG:Documentation

And here is a great how to for CentOS: http://wiki.centos.org/HowTos/OCSNG

Installing the communication and management server is done by downloading the .tar.gz and running the install script.

The communication server runs as a perl module and itself depends on many other perl modules. Install the required mods (and any needed dependencies - there are many) using cpan or cpan2rpm. (Thank god for cpan.) The following are required:

NOTE: You can actually just install most all these through yum, see install link above.

+----------------------------------------------------------+
| Checking for required Perl Modules...                    |
+----------------------------------------------------------+

Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for Apache::DBI PERL module...
*** ERROR: PERL module Apache::DBI is not installed !
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for Compress::Zlib PERL module...
*** ERROR: PERL module Compress::Zlib is not installed !
Checking for XML::Simple PERL module...
*** ERROR: PERL module XML::Simple is not installed !
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.
*** ERROR: There is one or more required PERL modules missing on your computer !
Please, install missing PERL modules first.
Installation aborted !

Server Troubleshooting

If the Agent reports this:

Callandor:~ # ocsinventory-agent -t Testing -s ocs.sagonet.com 
[error] Cannot establish communication : 500 Internal Server Error

And you see this error in the Apache log . .

[Thu May 07 15:00:45 2009] [error] [client 66.118.170.66] Can't call method "rollback" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/Apache/Ocsinventory/Server /System.pm line 261.\n

It most likely mean a database user or password misconfiguration in one of these two files, verify both and restart Apache. (And verify you can connect as that user to mysql)

[root@alfresco ocsreports]# vim /etc/httpd/conf.d/z-ocsinventory-server.conf
[root@alfresco ocsreports]# vim /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php

Looking for something?

Use the form below to search the wiki:

 

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!