Deploying OCS Inventory (for GLPI) on Various OSes

THEORY
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 support.mydomain.com .  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.

WORD OF CAUTION
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.

wget http://launchpad.net/ocsinventory-unix-agent/stable/ocsinventory-unix-agent-1.1.2/+download/Agent_MacOSX_1.1.pkg.zip

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/OCSNG.app/Contents/Resources/ocsinventory-agent –debug –server=support.mydomain.com

NOTES
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

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

server=support.mydomain.com
logfile=/var/log/ocsng.log
delaytime=30

LINUX (Redhat / CentOS)

Version 5 —

wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
yum install -y ocsinventory-agent

ocsinventory-agent –server=http://support.mydomain.com/ocsinventory

 

Version 6 —

wget http://dl.fedoraproject.org/pub/epel/beta/6/i386/epel-release-6-5.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum install -y ocsinventory-agent

ocsinventory-agent –server=http://support.mydomain.com/ocsinventory

SOLARIS

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

WINDOWS
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 /server:support.mydomain.com 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” /server:support.zulugolf.com

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”
exit

Installer Method

Installing GLPI and OCS in CentOS 5

WHAT IS GLPI
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.

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

Code:

# 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
wget http://pecl.php.net/get/json-1.2.1.tgz
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’;

INSTALL THE GLPI CODE
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.

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.

AGENT SETUP
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.
Redhat
yum install -y ocsinventory-agent
echo “OCSSERVER[0]=http://support.mydomain.com/ocsinventory” >> /etc/sysconfig/ocsinventory-agent
echo “10.10.0.33 support.mydomain.com support” >> /etc/hosts
ocsinventory-agent –server=http://support.mydomain.com/ocsinventory
exit

# 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]=http://support.mydomain.com/ocsinventory” >> /etc/sysconfig/ocsinventory-agent
echo “10.110.200.33 support.mydomain.com support” >> /etc/hosts