Open Source inventory system

Lucas Buck

Executive Member
Joined
Jun 20, 2005
Messages
5,988
Reaction score
2,662
Location
Trinity
Note: This is not my work but the author in the above link. I've added in one or two bits where I ran into problems during the installation.

You don't need to be a linux guru. All that you need is a basic understanding of using google in order to search for linux commands.
The installation will take you a maximum of 20 minutes.

OCS and GLPI installation guide using Fedora 14

1. Prerequisites
• We consider the server is freshly installed : MySQL is not installed nor is it configured.
• (If you are behind a firewall) Edit your proxy settings in order to update your linux distro.
• # nano /etc/yum.conf
• #yum update
• In this tutorial, I use rootsecret, ocssecret, glpisecret, syncsecret as password, of course, you should use other values...

2. The database server
• MySQL installation, launch and activation :
# yum install mysql-server
# service mysqld start
# chkconfig mysqld on

• Some security on the server : we must change the database administrator password, drop the test database, disable anonymous access, etc:
# mysql_secure_installation
• If you've completed all of the above steps, your MySQL installation should now be secure. (We will consider the root password is set to rootsecret)


3. OCS Inventory NG
3.1 Installation
# yum install ocsinventory
# service httpd restart (If you receive an error msg after entering this command type the following, “nano /etc/httpd/conf/httpd.conf”, look for the line “ServerName” and change localhost to the IP address of your server.)
# chkconfig httpd on

3.2 Configuration and database schema creation :
• Connect to http://localhost/ocsreports/install.php (must be modified if you are connected to the server from another computer).
• Step 1 : enter the MySQL administrator login and password, then Send.
• Step 2 : schema creation. If all is ok (must be true using the RPM), click on Send
• Step 3 : installation final step. write somewhere the account created (admin/admin) and click on Click here to enter OCS-NG GUI.
• Step 4 : choose your language (using the flag on the right top)
• Step 5 : connect to the application (admin/admin)

3.3 Some required configuration options

• open the pipe wrench / Configuration / Config and then the Server tabs:
• LOGLEVEL = On (really usefull when you encounter an issue)
• PROLOG_FREQ = 24 (time between 2 inventory)
• AUTO_DUPLICATE_LVL = crtieria used to detect that 2 computers are the same (I use Model + Serial + Mac Address).
• TRACE_DELETED = On (required by GLPI).
• SESSION_VALIDITY_TIME = 600 (session duration, the empty value provided is not valid).
Note: Change the application admin password


3.4 Change Mysql passwords
• During the installation step a new database ocsweb is created and a MySQL account ocs with a default password = ocs, which is really not secure.
• We need to change the MySQL password :
• # mysql -uroot -prootsecret
mysql> UPDATE mysql.user SET Password = PASSWORD('ocssecret') WHERE User = 'ocs';
mysql> FLUSH PRIVILEGES;
mysql> exit
• And to update the configuration file with this new password :
• In the /etc/httpd/conf.d/ocsinventory-server.conf file (arround line 31) :
• PerlSetVar OCS_DB_PWD ocssecret
• In the /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php file :
• $_SESSION["PSWD_BASE"]="ocssecret"
• Tell apache to reload his configuration for perl module to read the new parameter value:
• # service httpd reload

4 Installing the Agent
• To test the inventory feature, we are going to install the inventory agent on our first computer which will be on our server.
• # yum install ocsinventory-agent
• Now, send the inventory:
• # ocsinventory-agent --server=localhost
• If all is ok, your server should be in the computer list in OCS.
• You can enable the automatic inventory of this computer, edit the /etc/sysconfig/ocsinventory-agent:
• OCSMODE[0]=cron
OCSSERVER[0]=http://localhost/ocsinventory
• Note: If your windows clients can’t connect to the server check to see if your servers firewall is on with “service iptables status” disable your firewall with the command “service iptables stop”. Your server should now be able to receive inventory updates from your clients.


5 GLPI
• To start, we are going to create the database schema and the MySQL accounts for GLPI.The glpi account will be used by the application, and the synchro account for the synchronizaton process (to read the ocsweb database from glpi with only minimum rights).
• N.B. in this example, the synchro user rights are reduced to the minimum. In the case where you want to use some special plugins (uninstall p.e.), full right are required.
• #mysql -uroot -prootsecret
mysql> CREATE USER 'glpi'@'%' IDENTIFIED BY 'glpisecret';
mysql> GRANT USAGE ON *.* TO 'glpi'@'%' IDENTIFIED BY 'glpisecret';
mysql> CREATE DATABASE IF NOT EXISTS `glpi` ;
mysql> GRANT ALL PRIVILEGES ON `glpi`.* TO 'glpi'@'%';
mysql> CREATE USER 'synchro'@'%' IDENTIFIED BY 'syncsecret';
mysql> GRANT USAGE ON *.* TO 'synchro'@'%' IDENTIFIED BY 'syncsecret';
mysql> GRANT SELECT ON `ocsweb`.* TO 'synchro'@'%';
mysql> GRANT DELETE ON `ocsweb`.`deleted_equiv` TO 'synchro'@'%';
mysql> GRANT UPDATE (`CHECKSUM`) ON `ocsweb`.`hardware` TO 'synchro'@'%';
mysql> FLUSH PRIVILEGES;
mysql> exit
5.1 Installation :
• # yum install glpi
# service httpd reload

Database schema creation and configuration
• Connect to the application : http://localhost/glpi/ it will launch the configuration wizard.
• select your language and : OK.
• read and accept the license (GPL) : Continue
• start the installation : Installation
• step 0 : prerequisites check (must be ok with the RPM) : Continue
• step 1 : enter the database connexion parameters (localhost / glpi / glpisecret) : Continue
• step 2 : select the glpi database and Continue
• step 3 : write somewhere the adminstrateur login and password (glpi/glpi) et Continue
• step 4 : also write the other account informations : Use GLPI
• Authentificate yourself with the new account : glpi/glpi
GLPI is installed

OCSNG mode configuration
• OCSNG mode activation :
• Menu Setup / General
• Restrictions tabs
• Activate OCSNG mode : Yes, and Post

Server Configuration :
• Menu Setup / OCSNG mode
• Select the server created during installation: localhost
• Name: My OCS Server
• OCSweb host: localhost
• Name of the OCS database: ocsweb
• OCSweb database user: synchro
• OCSweb user password: syncsecret
• Post
You must get the Connection to OCS database successful message.

Now, we must configure the information that will be imported from OCS to GLPI. Here is a few examples :
• Monitors : Unit import on Serial number
• Logiciels : Unit Import
• Use the software dictionary of OCS: No
• Number of computers to synchronize using the cron: 0 (we are going to use another solution)
• General informations Computers : Yes for all that you are interested by.
• Components : Yes for what you want.
• etc, etc (you should notice that a lot of behavior are configurable)
• Post

Check :
• Menu Tools / OCSNG
• Import new computers

In the displayed list, you should see your server (on which we have installed the agent). Don't ask for it to be imported as we are going to see how to use automatic synchronization.
 
Last edited:
6 Automatic OCSNG synchronization

This step is not required as the internal pseudo-cron integrated in GLPI also do an automatic synchronization. But this solution seems more comfortable and flexible.

We are going to use the Mass import from OCSNG plugin.
• Disconnect from GLPI (logout link) and install the plugin:
• # yum install glpi-mass-ocs-import
• Connect into GLPI to install / configure the plugin :
• Menu Setup / Plugins
• Link : OCS massive Import
• Link : Install OCS massive import plugin (plugin tables creation)
• Default OCS server: My OCS Server
• Post the configuration page
• Enable the synchronization
• The planified task configured by the RPM will be launched every 5 minutes. Be patient, your first computer should be imported into GLPI.
• Tu supervise the synchronization :
• Menu : Plugins / OCS Massive Import
• Tab : Information about scripts execution
 
I would just install Spiceworks, give it the machine passwords and be done with it.
 
Top
Sign up to the MyBroadband newsletter
X