Guide OCS Inventory NG et GLPI

1. Introduction

OCS Inventory NG permet de réaliser un inventaire du parc informatique (machines, réseau, logiciels). GLPI est un gestionnaire de parc informatique qui centralise les données d'OCS et permet leur exploitation via une interface web.

2. Configuration de l'environnement

a. Prérequis matériels

b. Installation LAMP sur Debian

  1. Installer Apache, MariaDB et PHP :
    apt install apache2 mariadb-server php -y
  2. Installer des modules complémentaires pour Apache et PHP :
    apt install -y libapache2-mod-perl2 libxml-simple-perl libnet-ip-perl libsoap-lite-perl
    libapache2-mod-perl2-dev make php-mysql php-gd php-mbstring php-soap php-xml php-curl
                
  3. Installer des modules PERL via CPAN :
    perl -MCPAN -e "install XML::Entities"
    cpan Apache2::SOAP SOAP::Lite Mojolicious::Lite Switch
                

3. Installation et configuration d’OCS Inventory NG

  1. Télécharger et installer OCS Inventory NG :
    apt install wget
    wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.10.0/OCSNG_UNIX_SERVER-2.10.0.tar.gz
    tar xvzf OCSNG_UNIX_SERVER-2.10.0.tar.gz
    cd OCSNG_UNIX_SERVER-2.10.0
    ./setup.sh
                
  2. Configurer MariaDB :
    mysql -u root
    create database ocsweb;
    GRANT ALL PRIVILEGES ON *.* TO ocs@'localhost' IDENTIFIED BY 'ocs';
    FLUSH PRIVILEGES;
    exit;
                
  3. Redémarrer les services :
    service mariadb restart
    service apache2 restart
                
  4. Finaliser l'installation via navigateur :

4. Ajout des machines à l’inventaire

a. Ajouter la machine Debian (OCS-GLPI)

  1. Installer l’agent OCS :
    apt install ocsinventory-agent
  2. Configurer l’URL serveur : http://172.20.0.15/ocsreports.
  3. Lancer l’agent :
    ocsinventory-agent

b. Ajouter une machine Windows

  1. Télécharger l'agent OCS pour Windows : Lien de téléchargement.
  2. Installer l'agent et renseigner l’URL serveur : http://172.20.0.15/ocsinventory.

5. Installation de GLPI

a. Créer la base de données pour GLPI

mysql -u root
create database dbglpi;
GRANT ALL PRIVILEGES ON dbglpi.* TO glpiuser@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;
    

b. Télécharger et configurer GLPI

wget https://github.com/glpi-project/glpi/releases/download/10.0.3/glpi-10.0.3.tgz
cd /var/www/html
tar xvzf glpi-10.0.3.tgz
chown -R www-data:www-data /var/www/html/glpi
    

Accéder à : http://<IP_debian>/glpi. Identifiants par défaut : glpi / glpi.

6. Synchronisation GLPI/OCS

  1. Installer le plugin OCS pour GLPI :
    cd /var/www/html/glpi/plugins
    wget https://github.com/pluginsGLPI/ocsinventoryng/releases/download/2.0.2/glpi-ocsinventoryng-2.0.2.tar.bz2
    tar xvjf glpi-ocsinventoryng-2.0.2.tar.bz2
                
  2. Activer le plugin via l’interface GLPI (menu Configuration > Plugins).
  3. Ajouter un serveur OCS dans GLPI (menu Outils > OCS Inventory NG).

Une fois terminé, tu pourras importer les données d'inventaire dans GLPI.