Skip to content


Installation et configuration de OCSNG inventory (serveur et agent) et de GLPI sous Debian Lenny

Cet article est inspiré de celui de : http://wiki.linuxfellaz.net/doku.php?id=debian:ocs_glpi

Celui-ci traite de l'installation de OCS et GLPI sous Debian Etch, le présent article le remet au goût du jour (janvier 2011) et en Français (enfin le plus possible ! ;))

Une astuce importante pour toute pré-configuration est de rendre plus fine la granularité des questions de Debconf. Pour augmenter celle-ci il suffit de lancer la commande suivante en étant identifier en "root" :

# dpkg-reconfigure debconf

Laissez le choix sur "dialogue" puis mettez à "basse" le niveau de questions ignorées.

Après quoi plus de questions vous seront posées afin de pré-configurer les paquets le nécessitant.

Installation OCSNG inventory serveur et sa configuration

Avant d'installer OCS, vous avez besoin d'installer quelques paquets afin qu'il fonctionne. Identifiez-vous en "root" et lancez la commande suivante :

# apt-get install apache2 libapache2-mod-perl2 libapache2-mod-php5 php5 php5-gd perl libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libapache-dbi-perl mysql-server php-pear php5-dev libnet-ip-perl php5-mysql build-essential libsoap-lite-perl

Répondez "oui"

Ensuite récupérez la dernière version d'OCS (pas une release !) :

wget http://launchpad.net/ocsinventory-server/stable-1.3/1.3.3/+download/OCSNG_UNIX_SERVER-1.3.3.tar.gz

tar xvf OCSNG_UNIX_SERVER-1.3.3.tar.gz

Allez dans le répertoire créé ! cd OCSNG_UNIX_SERVER-1.3.3

# cd OCSNG_UNIX_SERVER-1.3.3

# ./setup.sh
+----------------------------------------------------------+
|                                                          |
| Welcome to OCS Inventory NG Management server setup !    |
|                                                          |
+----------------------------------------------------------+
CAUTION: If upgrading Communication server from OCS Inventory NG 1.0 RC2 and
previous, please remove any Apache configuration for Communication Server!
Do you wish to continue ([y]/n)?
Assuming Communication server 1.0 RC2 or previous is not installed
on this computer.
Starting OCS Inventory NG Management server setup from folder /root/OCSNG_UNIX_SERVER-1.3.3
Storing log in file /root/OCSNG_UNIX_SERVER-1.3.3/ocs_server_setup.log
+----------------------------------------------------------+
| Checking for database server properties...               |
+----------------------------------------------------------+
Your MySQL client seems to be part of MySQL version 5.0.
Your computer seems to be running MySQL 4.1 or higher, good ;-)
Which host is running database server [localhost] ?
OK, database server is running on host localhost ;-)
On which port is running database server [3306] ?
OK, database server is running on port 3306 ;-)
+----------------------------------------------------------+
| Checking for Apache web server daemon...                 |
+----------------------------------------------------------+
Where is Apache daemon binary [/usr/sbin/apache2] ?
OK, using Apache daemon /usr/sbin/apache2 ;-)
+----------------------------------------------------------+
| Checking for Apache main configuration file...           |
+----------------------------------------------------------+
Where is Apache main configuration file [/etc/apache2/apache2.conf] ?
OK, using Apache main configuration file /etc/apache2/apache2.conf ;-)
+----------------------------------------------------------+
| Checking for Apache user account...                      |
+----------------------------------------------------------+
Which user account is running Apache web server [www-data] ?
OK, Apache is running under user account www-data ;-)
+----------------------------------------------------------+
| Checking for Apache group...                             |
+----------------------------------------------------------+
Which user group is running Apache web server [www-data] ?
OK, Apache is running under users group www-data ;-)
+----------------------------------------------------------+
| Checking for Apache Include configuration directory...   |
+----------------------------------------------------------+
Setup found Apache Include configuration directory in
//etc/apache2/conf.d/.
Setup will put OCS Inventory NG Apache configuration in this directory.
Where is Apache Include configuration directory [//etc/apache2/conf.d/] ?
OK, Apache Include configuration directory //etc/apache2/conf.d/ found ;-)
+----------------------------------------------------------+
| Checking for PERL Interpreter...                         |
+----------------------------------------------------------+
Found PERL Intrepreter at </usr/bin/perl> ;-)
Where is PERL Intrepreter binary [/usr/bin/perl] ?
OK, using PERL Intrepreter /usr/bin/perl ;-)
Do you wish to setup Communication server on this computer ([y]/n)?
+----------------------------------------------------------+
| Checking for Make utility...                             |
+----------------------------------------------------------+
OK, Make utility found at </usr/bin/make> ;-)
+----------------------------------------------------------+
| Checking for Apache mod_perl version...                  |
+----------------------------------------------------------+
Checking for Apache mod_perl version 1.99_22 or higher
Found that mod_perl version 1.99_22 or higher is available.
OK, Apache is using mod_perl version 1.99_22 or higher ;-)
+----------------------------------------------------------+
| Checking for Communication server log directory...       |
+----------------------------------------------------------+
Communication server can create detailled logs. This logs can be enabled
by setting interger value of LOGLEVEL to 1 in Administration console
menu Configuration.
Where to put Communication server log directory [/var/log/ocsinventory-server] ?
OK, Communication server will put logs into directory /var/log/ocsinventory-server ;-)
+----------------------------------------------------------+
| Checking for required Perl Modules...                    |
+----------------------------------------------------------+
Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for Apache::DBI PERL module...
Found that PERL module Apache::DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for Compress::Zlib PERL module...
Found that PERL module Compress::Zlib is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.
+----------------------------------------------------------+
| Checking for optional Perl Modules...                    |
+----------------------------------------------------------+
Checking for SOAP::Lite PERL module...
Found that PERL module SOAP::Lite is available.
Checking for XML::Entities PERL module...
*** Warning: PERL module XML::Entities is not installed !
This module is only required by OCS Inventory NG SOAP Web Service.
Do you wish to continue ([y]/n] ?
+----------------------------------------------------------+
| OK, looks good ;-)                                       |
|                                                          |
| Configuring Communication server Perl modules...         |
+----------------------------------------------------------+
Checking if your kit is complete...
Looks good
Writing Makefile for Apache::Ocsinventory
+----------------------------------------------------------+
| OK, looks good ;-)                                       |
|                                                          |
| Preparing Communication server Perl modules...           |
+----------------------------------------------------------+
+----------------------------------------------------------+
| OK, prepare finshed ;-)                                  |
|                                                          |
| Installing Communication server Perl modules...          |
+----------------------------------------------------------+
+----------------------------------------------------------+
| OK, Communication server Perl modules install finished;-)|
|                                                          |
| Creating Communication server log directory...           |
+----------------------------------------------------------+
Creating Communication server log directory /var/log/ocsinventory-server.
Fixing Communication server log directory files permissions.
Configuring logrotate for Communication server.
/root/OCSNG_UNIX_SERVER-1.3.3
Removing old communication server logrotate file /etc/logrotate.d/ocsinventory-NG
Writing communication server logrotate to file /etc/logrotate.d/ocsinventory-server
+----------------------------------------------------------+
| OK, Communication server log directory created ;-)       |
|                                                          |
| Now configuring Apache web server...                     |
+----------------------------------------------------------+
To ensure Apache loads mod_perl before OCS Inventory NG Communication Server,
Setup can name Communication Server Apache configuration file
'z-ocsinventory-server.conf' instead of 'ocsinventory-server.conf'.
Do you allow Setup renaming Communication Server Apache configuration file
to 'z-ocsinventory-server.conf' ([y]/n) ?
OK, using 'z-ocsinventory-server.conf' as Communication Server Apache configuration file
Removing old communication server configuration to file //etc/apache2/conf.d//ocsinventory.conf
Writing communication server configuration to file //etc/apache2/conf.d//z-ocsinventory-server.conf
+----------------------------------------------------------+
| OK, Communication server setup sucessfully finished ;-)  |
|                                                          |
| Please, review //etc/apache2/conf.d//z-ocsinventory-server.conf
| to ensure all is good. Then restart Apache daemon.       |
+----------------------------------------------------------+
Do you wish to setup Administration Server (Web Administration Console)
on this computer ([y]/n)?
+----------------------------------------------------------+
| Checking for Administration Server directories...        |
+----------------------------------------------------------+
CAUTION: Setup now install files in accordance with Filesystem Hierarchy
Standard. So, no file is installed under Apache root document directory
(Refer to Apache configuration files to locate it).
If you're upgrading from OCS Inventory NG Server 1.01 and previous, YOU
MUST REMOVE (or move) directories 'ocsreports' and 'download' from Apache
root document directory.
If you choose to move directory, YOU MUST MOVE 'download' directory to
Administration Server writable/cache directory (by default
/var/lib/ocsinventory-reports), especialy if you use deployement feature.
Do you wish to continue ([y]/n)?
Assuming directories 'ocsreports' and 'download' removed from
Apache root document directory.
Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?
OK, using directory /usr/share/ocsinventory-reports to install static files 😉
Where to create writable/cache directories for deployement packages and
IPDiscover [/var/lib/ocsinventory-reports] ?
OK, writable/cache directory is /var/lib/ocsinventory-reports 😉
+----------------------------------------------------------+
| Checking for required Perl Modules...                    |
+----------------------------------------------------------+
Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.
+----------------------------------------------------------+
| Installing files for Administration server...            |
+----------------------------------------------------------+
Creating PHP directory /usr/share/ocsinventory-reports/ocsreports.
Copying PHP files to /usr/share/ocsinventory-reports/ocsreports.
Fixing permissions on directory /usr/share/ocsinventory-reports/ocsreports.
Creating database configuration file /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php.
Creating IPDiscover directory /var/lib/ocsinventory-reports/ipd.
Fixing permissions on directory /var/lib/ocsinventory-reports/ipd.
Creating packages directory /var/lib/ocsinventory-reports/download.
Fixing permissions on directory /var/lib/ocsinventory-reports/download.
Configuring IPDISCOVER-UTIL Perl script.
Installing IPDISCOVER-UTIL Perl script.
Fixing permissions on IPDISCOVER-UTIL Perl script.
Writing Administration server configuration to file //etc/apache2/conf.d//ocsinventory-reports.conf
+----------------------------------------------------------+
| OK, Administration server installation finished 😉      |
|                                                          |
| Please, review //etc/apache2/conf.d//ocsinventory-reports.conf
| to ensure all is good and restart Apache daemon.         |
|                                                          |
| Then, point your browser to http://server//ocsreports
| to configure database server and create/update schema.   |
+----------------------------------------------------------+
Setup has created a log file /root/OCSNG_UNIX_SERVER-1.3.3/ocs_server_setup.log. Please, save this file.
If you encounter error while running OCS Inventory NG Management server,
we can ask you to show us his content !
DON'T FORGET TO RESTART APACHE DAEMON !
Enjoy OCS Inventory NG ;-)

Relancez votre serveur web Apache

# /etc/init.d/apache2 reload
Reloading web server config: apache2.

Editez le fichier : /etc/apache2/conf.d/z-ocsinventory-server.conf

Mettez l'identifiant de l'administrateur MySQL et son mot de passe !

PerlSetEnv OCS_DB_USER AdministrateurMySQL

PerlSetVar OCS_DB_PWD MotDePasseAdministrateurMySQL

Editez aussi le fichier : /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php

<?php $_SESSION["SERVEUR_SQL"]="localhost"; $_SESSION["COMPTE_BASE"]="ocs"; $_SESSION["PSWD_BASE"]="ocs"; ?>

Redémarrez Apache!

# /etc/init.d/apache2 reload Reloading web server config: apache2.

Allez sur la page : http://IPserver/ocsreports/

Indiquez les paramètres puis loguez-vous avec admin/admin

Voilà OCS serveur est prêt !

Installation OCSNG inventory agent et sa configuration

Installation des pré-requis :

# apt-get install make nmap libnet-ssleay-perl libcrypt-ssleay-perl tree-perl libio-compress-base-perl libio-compress-zlib-perl libio-stringy-perl libmail-box-perl libmail-sendmail-perl libmailtools-perl libmime-types-perl libnet-ip-perl libnet-ssleay-perl libobject-realize-later-perl libproc-daemon-perl libsys-hostname-long-perl libtimedate-perl liburi-perl libuser-identity-perl libwww-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-expat-perl libxml-sax-perl libxml-simple-perl po-debconf

Téléchargez l'agent :

# wget http://launchpad.net/ocsinventory-unix-agent/stable-1.1.2/ocsinventory-unix-agent-1.1.2.1/+download/Ocsinventory-Agent-1.1.2.1.tar.gz

# tar xvf Ocsinventory-Agent-1.1.2.1.tar.gz

# cd Ocsinventory-Agent-1.1.2.1

# perl Makefile.PL Please install Proc::Daemon and Proc::PID::File if you want to use the daemon monde.

# make

# make install

Installing /usr/local/share/perl/5.10.0/Ocsinventory/postinst.pl

Installing /usr/local/share/perl/5.10.0/Ocsinventory/Logger.pm

Installing /usr/local/share/perl/5.10.0/Ocsinventory/Agent.pm

[...]

Installing /usr/local/man/man1/ocsinventory-agent.1p Installing /usr/local/man/man3/Ocsinventory::Agent::XML::Inventory.3pm Installing /usr/local/bin/ocsinventory-agent Writing /usr/local/lib/perl/5.10.0/auto/Ocsinventory/Agent/.packlist Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod [ ! -f run-postinst ] || /usr/bin/perl postinst.pl Do you want to configure the agent Please enter 'y' or 'n'?> [y] Where do you want to write the configuration file? 0 -> /etc/ocsinventory 1 -> /usr/local/etc/ocsinventory 2 -> /etc/ocsinventory-agent ?>  0 Do you want to create the directory /etc/ocsinventory? Please enter 'y' or 'n'?> [y] [info] The config file will be written in /etc/ocsinventory/ocsinventory-agent.cfg, What is the address of your ocs server?> [ocsinventory-ng] 10.1.1.246 Do you need credential for the server? (You probably don't) Please enter 'y' or 'n'?> [n] Do you want to apply an administrative tag on this machine Please enter 'y' or 'n'?> [y] tag?>  maison ocsinventory agent presents: /usr/local/bin/ocsinventory-agent Do yo want to install the cron task in /etc/cron.d Please enter 'y' or 'n'?> [y] Where do you want the agent to store its files? (You probably don't need to change it)?> [/var/lib/ocsinventory-agent] Do you want to create the /var/lib/ocsinventory-agent directory? Please enter 'y' or 'n'?> [y] New settings written! Thank you for using OCS Inventory Should I remove the old linux_agent Please enter 'y' or 'n'?> [n] y /etc/ocsinventory-client /etc/logtotate.d/ocsinventor-client /usr/sbin/ocsinventory-client.pl /etc/cron.d/ocsinventory-client /bin/ocsinv done Do you want to use OCS-Inventory software deployment feature? Please enter 'y' or 'n'?> [y] Do you want to send an inventory of this machine? Please enter 'y' or 'n'?> [y] [info] Accountinfo file doesn't exist. I create an empty one. -> Success!

Maintenant vous devriez retrouver dans http://IPserveur/ocsreports/

La machine hébergeant le serveur...

Installation GLPI et sa configuration

cd /var/www/ && wget --no-check-certificate https://forge.indepnet.net/attachments/download/720/glpi-0.78.1.tar.gz

tar xvf glpi-0.78.1.tar.gz

cd glpi

chmod -R -c 777 glpi/files/ chmod -c 777 glpi/config/

Une fois fait rendez-vous sur http://IPserveur/glpi afin de configurer GLPI : Voir http://www.system-linux.net/config/OCS-GLPI/

glpi/glpi for the administrator account tech/tech for the technician account normal for the normal account post-only/post-only for the postonly account

Afin de ne pas louper une partie de la configuration, cliquez chaque fois sur l'onglet "tous", cela permettra de faire apparaître des options supplémentaires non négligeables : Voir http://www.system-linux.net/config/OCS-GLPI/complements/

Veuillez vous reporter à la documentation sur le site web de GLPI en version 0.78 : https://forge.indepnet.net/attachments/download/727/glpidoc-0.78.pdf

Sur l'interface sélectionnez "Configuration - Générale - Onglet "Tous"", activez "le mode OCSNG"

Puis configurez le mode OCSNG afin qu'il accède à la base de données de OCS, pour importer les informations s'y trouvant !

Dans le menu "Outils - OCSNG", cliquez sur "Importation de nouveaux ordinateurs"...

-- Fin --

Print Friendly, PDF & Email

Posted in Debian, Important, Linux, Technique, Toutes. Tagged with , , , .

4 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Bonjour,

    Je viens de survoler votre howto qui est pas trop mal. Le choix d'installer la dernière version de OCS via le tar.gz est intéressant car le paquet fourni dans lenny (et même celui qui sera dans squeeze) n'est pas du tout à jour.

    Je note tout de même quelques remarque : il serait intéressant de noter les dépences de l'agent car il peut être installer sur des serveurs autre que le serveur OCS. Aussi le chmod 777 sur l'installe de GLPI c'est un peu sale tout de même ... Enfin je ne connais pas la politique de GLPI sur le sujet mais moi j'aime pas du tout ce genre de comportement.

  2. admin said

    Il est vrai que le chmod 777 est un peu l'arme atomique des droits...
    Je vais le reprendre et ainsi rendre plus fin l'analyse... 🙂
    chmod -R -c 777 glpi/files/
    chmod -c 777 glpi/config/

  3. admin said

    Quant aux dépendances de l'agent c'est en cours...

  4. admin said

    Voilà qui est fait ! 🙂

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.

Time limit is exhausted. Please reload CAPTCHA.


/* */
Creative Commons License
Cette création par Laurent Besson est mise à disposition selon les termes de la licence Creative Commons Paternité-Partage des Conditions Initiales à l'Identique 2.0 France.