Cette page est en cours de rédaction.
Apportez votre aide…

Ceci est une ancienne révision du document !



OCS Inventory

Open Computer and Software Inventory Next Generation est une application conçue pour aider les administrateurs systèmes ou réseau à suivre les configurations matériels et les logiciels sur le réseau. Il peut aussi déployer des paquets sur des postes Windows ou Linux.

Le dialogue entre les postes clients et le serveur de gestion est basé sur des standards actuels, les protocoles HTTP/HTTPS et le format de donnée XML

Le client d'inventaire fonctionne sous Microsoft Windows 95/98/Me/NT4/2000/XP/2003/Vista ou Linux. Des contributions existent aussi pour Sun Solaris, *BSD, IBM AIX 5.X, HP-UX et Mac OS X.

OCS Inventory est un logiciel sous licence GPLhttp://www.opensource.org/licenses/gpl-license.php, Libre à l'utilisation et à la copie . OCS Inventory est aussi Open Source! Si vous désirez modifiez les sources, vous pouvez! Cependant, si vous voulez mettre à jour le code source pour le distribuer, vous devez fournir vos mises à jour en vertu des conditions de licence de GPL.

OCS Inventory supporte les langages suivants :

  • Portuguais
  • Anglais
  • Français
  • Allemand
  • Hongrois
  • Italien
  • Polonais
  • Portuguais
  • Espagnol
  • Russe
  • Turque

Utilisé avec le logiciel de gestion de parc tel que GLPIhttp://www.glpi-project.org , vous aurez un logiciel puissant de gestion d'inventaire et d'information de ressource avec les mises à jour automatiques de la configuration d'ordinateur, de la gestion de licences, du HELPDESK, de la base de connaissance et plus.

Installation

Depuis Intrepid Ibex (8.10), il suffit d'installer le paquet ocsinventory-server et le tour est joué!.

  • Apache version 1.3.33 ou plus / Apache version 2.0.46 ou plus.
    • Mod_perl version 1.29 ou plus.
    • Mod_php version 4.3.2 ou plus.
  • PHP 4.3.2 ou plus, avec ZIP et support GD activé.
  • PERL 5.6 ou plus.
    • Perl module XML::Simple version 2.12 ou plus.
    • Perl module Compress::Zlib version 1.33 ou plus.
    • Perl module DBI version 1.40 ou plus.
    • Perl module DBD::Mysql version 2.9004 ou plus.
    • Perl module Apache::DBI version 0.93 ou plus.
    • Perl module Net::IP version 1.21 ou plus.
    • Perl module SOAP::Lite version 0.66 ou plus (pas de proxy)
  • MySQL version 4.1.0 ou plus avec InnoDB engine active.
  • Make
sudo apt-get install make
sudo apt-get install apache2 apache2-doc
sudo su -c ' echo ServerName www.monsite.tld >> /etc/apache2/apache2.conf'
sudo /etc/init.d/apache2 reload
sudo apt-get install mysql-server
sudo mysqladmin -u root password votre_pass
sudo /etc/init.d/mysql reload
sudo apt-get install php5 libapache2-mod-php5 php5-mysql php5-gd
sudo su -c ' echo "<?" > /var/www/info.php'
sudo su -c ' echo "  phpinfo()" >> /var/www/info.php'
sudo su -c ' echo "?>" >> /var/www/info.php'
sudo /etc/init.d/apache2 reload

Si en cliquant sur ce lien une page de configuration PHP s'affiche cette partie de l'installation est bonne.

sudo apt-get install perl libapache2-mod-perl2 libxml-simple-perl libcompress-zlib-perl libdbi-perl libapache-dbi-perl 
sudo apt-get install libdbd-mysql-perl libnet-ip-perl libsoap-lite-perl

Pour l'outil IPDISCOVER contenu dans l'agent, installer ce qui suit

sudo apt-get install libc6-dev

Telecharger le package serveur à cette adresse : http://www.ocsinventory-ng.org/fr/telechargement/telecharger-serveur.html Extraire le package et lancer

sudo sh setup.sh

Dans la majorité des cas, les valeurs par défaut proposées sont bonnes, et vous n'avez qu'à taper "Entrée" à chaque proposition. Pour certaines installations "custom", vous aurez peut être à modifier certaines valeurs.

Enfin, redémarrez Apache :

sudo apache2ctl restart

Rendez vous ensuite à http://{{SERVEUR}}/ocsreports/index.php pour configurer le serveur OCS comme ci-dessous :

par les dépots (méthode recommandée )

Au moins pour Lucid , Maverick et Natty il suffit d'Installer le paquet ocsinventory-agent
de choisir HTTP comme mode et de mettre l'IP ou le FQDN de votre serveur.

pour reconfigurer votre client

modifier /etc/ocsinventory/ocsinventory-agent.cfg
ou utiliser

 dpkg-reconfigure ocsinventory-agent 

pour forcer la remontée des informations de votre client/agent vers le serveur

sudo ocsinventory-agent

à la main

Telecharger le package agent à cette adresse : http://www.ocsinventory-ng.org/index.php?page=downloads

Dezziper le fichier, lancer la console et se mettre dans le repertoire.

sudo ./setup.sh
+----------------------------------------------------------+
|                                                          |
| Welcome to OCS Inventory NG Agent setup !                |
|                                                          |
+----------------------------------------------------------+
Writing log to file /home/jacxof/Desktop/OCSNG_LINUX_AGENT_1.01/ocs_agent_setup.log


+----------------------------------------------------------+
| Checking for previous installation...                    |
+----------------------------------------------------------+

Previous installation of OCS Inventory NG agent not found

+----------------------------------------------------------+
| Checking for supplied parameters...                      |
+----------------------------------------------------------+

No parameter found
OCS Inventory NG Agent setup running in user interactive mode


+----------------------------------------------------------+
| Checking for OCS Inventory NG Agent running method...    |
+----------------------------------------------------------+

OCS Inventory NG Agent can be run through 2 methods:
- local: inventory will be generated locally to a file, without
       interacting with Communication Server. Inventory results
       must then be imported manually into the server through
       Administration Console.
- http: Agent can connect to Communication Server and will interact
      with it to know what is has to do (inventory, ipdiscover,
      deployment...)
Which method will you use to generate the inventory ([http]/local) ?

<Enter>

OK, OCS Inventory NG agent will be running in <http> mode ;-)


+----------------------------------------------------------+
| Checking for OCS Inventory NG Communication Server...    |
+----------------------------------------------------------+

Which host is running OCS Inventory NG Communication Server [] ?

Mettre le nom du serveur de communication ou son adresse IP

On which port is running OCS Inventory NG Communication Server [80] ?

<Enter>

  OK, OCS Inventory NG Communication Server is running on host
<localhost> and port <80> ;-)


+----------------------------------------------------------+
| Checking for TAG administrative information value...     |
+----------------------------------------------------------+

What is the value of TAG ([]) ?

Mettre un nom permettant de repérer ce poste.

test: 439: XOF: unexpected operator
OK, OCS Inventory NG agent will use <Portable XOF> as <TAG> ;-)
+----------------------------------------------------------+
| Checking for PERL Interpreter...                         |
+----------------------------------------------------------+
OK, PERL Intrepreter found at </usr/bin/perl> ;-)
+----------------------------------------------------------+
| Checking for C/C++ Compiler...                           |
+----------------------------------------------------------+
OK, C/C++ Compiler found at </usr/bin/cc> ;-)
+----------------------------------------------------------+
| Checking for Make utility...                             |
+----------------------------------------------------------+
OK, Make utility found at </usr/bin/make> ;-)
+----------------------------------------------------------+
| Checking for dmidecode binaries...                       |
+----------------------------------------------------------+
Found dmidecode binaries version <2.8> at </usr/sbin/dmidecode> ;-)
+----------------------------------------------------------+
| Checking for Compress::Zlib PERL module...               |
+----------------------------------------------------------+
OK, PERL module Compress::Zlib is available ;-)
+----------------------------------------------------------+
| Checking for XML::Simple PERL module...                  |
+----------------------------------------------------------+
OK, PERL module XML::Simple is available ;-)
+----------------------------------------------------------+
| Checking for Net::IP PERL module...                      |
+----------------------------------------------------------+
OK, PERL module Net::IP is available ;-)
+----------------------------------------------------------+
| Checking for LWP::UserAgent PERL module...               |
+----------------------------------------------------------+
OK, PERL module LWP::UserAgent is available ;-)
+----------------------------------------------------------+
| Checking for Digest::MD5 PERL module...                  |
+----------------------------------------------------------+
OK, PERL module Digest::MD5 is available ;-)
+----------------------------------------------------------+
| Checking for Net::SSLeay PERL module...                  |
+----------------------------------------------------------+
OK, PERL module Net::SSLeay is available ;-)
+----------------------------------------------------------+
| Installing IPDISCOVER binary...                          |
+----------------------------------------------------------+
Building IPDISCOVER version 3
Installing IPDISCOVER version 3 into /usr/sbin
OK, IPDISCOVER version 3 setup successfully ;-)
+----------------------------------------------------------+
| Installing OCS Inventory NG Agent...                     |
+----------------------------------------------------------+
Configuring OCS Inventory NG Agent
Building OCS Inventory NG Agent
Installing OCS Inventory NG Agent
Creating </bin/ocsinv> OCS Inventory NG Agent symbolic link
OK, OCS Inventory NG Agent setup successfully ;-)
+----------------------------------------------------------+
| Creating OCS Inventory NG Agent log directory...         |
+----------------------------------------------------------+
Creating OCS Inventory NG Agent log directory </var/log/ocsinventory-client>.
Configuring logrotate for OCS Inventory NG Agent.
Writing OCS Inventory NG Agent logrotate to file </etc/logrotate.d/ocsinventory-client>
+----------------------------------------------------------+
| Installing OCS Inventory NG Agent configuration files... |
+----------------------------------------------------------+
Creating OCS Inventory NG Agent <ocsinv.conf> configuration file
Creating OCS Inventory NG Agent </etc/ocsinventory-client> configuration directory
Writing OCS Inventory NG Agent </etc/ocsinventory-client/ocsinv.conf> configuration file
Creating OCS Inventory NG Agent <ocsinv.adm> configuration file
Writing OCS Inventory NG Agent </etc/ocsinventory-client/ocsinv.adm> configuration file
OK, OCS Inventory NG Agent configuration files setup successfully ;-)
+----------------------------------------------------------+
| Installing OCS Inventory NG Agent cron configuration...  |
+----------------------------------------------------------+
Creating OCS Inventory NG Agent cron configuration file
Writing OCS Inventory NG Agent </etc/cron.d/ocsinventory-client> cron configuration file
OK, OCS Inventory NG Agent cron configuration file setup successfully ;-)
+----------------------------------------------------------+
| Lauching OCS Inventory NG Agent...                       |
+----------------------------------------------------------+
OK, OCS Inventory NG Agent runs successfully ;-)
Setup has created a log file /home/jacxof/Desktop/OCSNG_LINUX_AGENT_1.01/ocs_agent_setup.log. Please, save this file.
If you encounter error while running OCS Inventory NG Agent,
we can ask you to show us his content !
Enjoy OCS Inventory NG ;-)

Le client est installé. Retournez dans la console d'administration, le poste doit apparaitre.

Les administrateurs qui utilisent logrotate peuvent recevoir ce message:

/etc/cron.daily/logrotate:
error: ocsinventory-NG:18 lines must begin with a keyword or a filename (possibly in double quotes)
error: ocsinventory-NG:19 unexpected text
error: ocsinventory-NG:20 unexpected text
error: ocsinventory-NG:21 unexpected text
error: ocsinventory-NG:22 unexpected text
error: ocsinventory-NG:23 unexpected text
error: ocsinventory-NG:24, unexpected text after {
error: ocsinventory-NG:24 lines must begin with a keyword or a filename (possibly in double quotes)

Cette erreur est due au format du fichier ocsinventory-NG qui se trouve dans /etc/logrotate.d .
Le fichier est au format MS-DOS et il faut donc reconvertir le fichier au format unix.
Pour ce faire vous pouvez utiliser dos2unix ou alors éditer le fichier pour le réécrire au format unix.

Afin d'installer correctement cet agent il est nécessaire de disposer de PERL Il faut aussi installer :

sudo apt-get install libnet-ssleay-perl
sudo apt-get install libcrypt-ssleay-perl
sudo apt-get install libmodule-install-perl
sudo apt-get install nmap
cpan -i Digest::MD5 XML::Simple Net::IP Proc::Daemon Proc::PID::File Net::CUPS Module::Install Crypt::SSLeay

Telecharger le package agent à cette adresse : http://www.ocsinventory-ng.org/index.php?page=downloads

gunzip agent.tar.gz
tar -xvf agent.tar
cd agent
perl Makefile.PL

Cette commande permet de construire le fichier Makefile grâce a celle ci vous pouvez voir si il vous manque des dépendances PERL vous pouvez donc les installer :

Exemple :

Net::IP is strongly recommended since it's required to retrieve network information
Please install Proc::Daemon and Proc::PID::File if you want to use the daemon monde.

Installer les modules perl manquant (si nécessaire)

cpan -i Proc::Daemon Proc::PID::File Net::IP

Relancer :

perl Makefile.PL

Si toutes vos dépendances satisfaites continuez

make
make install
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]

<enter>

Where do you want to write the configuration file?
0 -> /etc/ocsinventory
1 -> /usr/local/etc/ocsinventory
2 -> /etc/ocsinventory-agent
> 2

<enter>

Do you want to create the directory /etc/ocsinventory-agent?
Please enter 'y' or 'n'?> [y] 

<enter>

[info] The config file will be written in /etc/ocsinventory/ocsinventory-agent.cfg,
What is the address of your ocs server?> [ocsinventory-ng] http://mondomaine.domaine
[info] The config file will be written in /etc/ocsinventory/ocsinventory-agent.cfg, cette ligne ne semble pas renvoyer la bonne information elle renvois toujours le même répertoire cependant le script cree bien le bon répertoire sélectionner a l'écran precedant

<enter>

Do you need credential for the server? (You probably don't)
Please enter 'y' or 'n'?> [n]

A remplir si il y a besoin d'une authentification pour se connecter au serveur <enter>

Do you want to apply an administrative tag on this machine
Please enter 'y' or 'n'?> [y] 
tag?>TAG 

Renseigner le TAG de la machine (si nécessaire) <enter>

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]

<enter>

Where do you want the agent to store its files? (You probably don't need to change it)?> [/var/lib/ocsinventory-agent] 

Je recommande d'installer pour Ubuntu les fichiers dans /usr/local/ocsinventory-agent

<enter>

Do you want to create the /usr/local/ocsinventory-agent directory?
Please enter 'y' or 'n'?> [y] 

<enter>

New settings written! Thank you for using OCS Inventory
Should I remove the old linux_agent
Please enter 'y' or 'n'?> [n] 

A vous de voir je conseil de les enlever

<enter>

/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] 

Selon vos besoins <enter>

Do you want to send an inventory of this machine?
Please enter 'y' or 'n'?> [y] 

<enter>

[info] Accountinfo file doesn't exist. I create an empty one.
Connecting to uri: qemu:///system
-> Success!

L'installation est terminée.

  • ocs_inventory.1369211811.txt.gz
  • Dernière modification: Le 22/05/2013, 10:36
  • par quack1