Source : https://www.osradar.com/install-ocsinventory-debian-10/

OCSInventory vous permet de collecter un inventaire matériel et logiciel depuis toutes les machines connectées au réseau, tels qu’ordinateurs, switches, routeurs, imprimantes réseau et autres périphériques. Il supporte de multiples systèmes d’exploitation, incluant Microsoft Windows, Linux, * BSD, Sun Solaris, IBM AIX, HP-UX, MacOS X. Il a la faculté de supporter des plugins, and s’intègle parfaitement avec GLPI.

Installez OCS Inventory sur Debian 10

1.- Installez LAMP et les modules requis

OCS Inventory nécessite tous les composants LAMP pour fonctionner pleinement. Ainsi, C’est ce que nous devons faire en premier. Alors lisez cet article à ce sujet :

How to install LAMP on Debian 10?

Cependant, vous devez aussi installer d’autres modules liés à Apache qui ne sont pas mentionnés dans l’article « LAMP on Debian 10 » :

$ sudo apt install libapache2-mod-php libapache2-mod-perl2 libapache-dbi-perl libapache-db-perl

Et d’autres modules PHP doivent être installés comme dépendances de l’interface Web de OCS Inventory.

$ sudo apt install php-soap php-curl php-json php-xml php-mbstring php-gd php-pclzip php-xmlrpc

Une fois que ces modules sont installés en plus de la pile LAMP, nous pouvons continuer.

2.- Installer les outils de développement sur Debian 10

A un certain point durant l’installation, certains paquets sont requis pour compiler et construire d’autres paquets depuis le code source.

Fortunately, these packages are available from the official Debian repositories. This makes installation easy.

Just run the following commands:

$ sudo apt install cmake gcc make build-essential make
1.- Install some required packages

L’installation va prendre un certain temps, en fonction de l’ordinateur que vous utilisez.

3.- Créez une nouvelle base de données pour OCS Inventory

Comme mentionné plus tôt, OCS Inventory a besoin d’un gestionnaire de base de données. Cela doit être MySQL ou MariaDB.

As a member of the LAMP stack, we already have it installed and configured, but it is convenient to make a database dedicated to OCSInventory. Also, it is a good idea to create a new user for the application.

First access the MariaDB shell:

$ sudo mysql -uroot

And then, it creates the new database, the user and the permissions on it.

MariaDB [(none)]> CREATE DATABASE ocsdb;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]>
MariaDB [(none)]> GRANT ALL PRIVILEGES ON ocsdb.* TO 'ocsuser'@'localhost' IDENTIFIED BY 'mon_mot_de_passe';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]>
> FLUSH PRIVILEGES;
exit;
2.- Creating a new database and user for OCSInventory

4.- Installez quelques modules Perl

Le serveur OCS Inventory is made with PERL. That’s why you have to install many modules of this language.

First, we will install some of them using APT.

$ sudo apt install perl libnet-ip-perl libxml-simple-perl libarchive-zip-perl libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libnet-ip-perl libsoap-lite-perl libio-compress-perl libapache-dbi-perl libapache2-mod-perl2 libapache2-mod-perl2-dev libdbd-mysql-perl

Et ensuite, nous allons utiliser un outil pour le faire manuellement :

$ sudo cpan install XML::Entities Apache2::SOAP Net::IP Apache::DBI Mojolicious Switch Plack::Handler Archive::Zip

L’installation va prendre un moment, alors soyez patient. Lorsque ce sera finit nous serons en mesure de télécharger l’application.

5.- Téléchargez et installez OCS Inventory sur Debian 10

Après avoir installé toutes ces dépendances et bibliothèques, nous pouvons maintenant télécharger et installer OCS Inventory. Pour faire cela nous allons utiliser la commande wget . Au moment de l’écriture de cet article la dernière version stable de OCS Inventory est 2.6.

Alors c’est parti.

$ cd /tmp
$ wget -c https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.6/OCSNG_UNIX_SERVER_2.6.tar.gz -O ocs.tar.gz

Maintenant décompressez le.

$ tar -xvzf ocs.tar.gz

Puis allez dans le dossier qui a été créé, et éditer le script d’installation pour ajouter nos permissions de base de sonnées.

$ cd OCSNG_UNIX_SERVER_2.6/
$ sudo nano setup.sh

Et adaptez le comme ceci :

DB_SERVER_HOST="localhost"
DB_SERVER_PORT="3306"
DB_SERVER_USER="ocsuser"
DB_SERVER_PWD="mon_mot_de_passe"
4.- Configuring OCSInventory on Debian 10

Remember, you have to place the data from the database you have defined. Ceux ci-dessus ne sont utilisés que comme exemple.

Si vous avez un doute, avant d’aller plus loin testez votre connxion à la base de données comme ceci:

$ mysql -uocsuer -pmon_mot_de_passe
ERROR 1045 (28000): Access denied for user 'ocsuer'@'localhost' (using password: YES)
activpart@supervision:/tmp/OCSNG_UNIX_SERVER_2.6$ mysql -uocsuser -pLaCiotat13600
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 103
Server version: 10.3.23-MariaDB-0+deb10u1 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| ocsdb |
+--------------------+
2 rows in set (0.001 sec)

MariaDB [(none)]>exit

 

Alors sauvegardez et fermez le fichier. Maintenant nous devons lancer le script d’installation.

$ sudo ./setup.sh
5.- Installing OCSInventory on Debian 10
5.- Installing OCSInventory on Debian 10

The screen outputs of the script are quite long. But they are easily understandable if you read it carefully. Anyway, what the script asks you to do is to set up various configurations. Many of them you just have to press the enter key and set the default configuration.

Of course, the script will look for the Perl dependencies we have in the system.

6.- Check for the perl modules
6.- Check for the perl modules

And the optional modules:

7.- Installing OCSInventory on Debian 10
7.- Installing OCSInventory on Debian 10

Once the whole script is finished and if everything has gone well, you will see the following message:

8.- OCSInventory is installed
8.- OCSInventory is installed

6.- Configuring OCSInventory on Debian 10

Even though the installation has been successfully completed there are still some extra settings to be made.

D’abord activez the newly installed Apache paramètres pour OCS Inventory.

$ sudo ln -s /etc/apache2/conf-available/ocsinventory-reports.conf /etc/apache2/conf-enabled/ocsinventory-reports.conf
$ sudo ln -s /etc/apache2/conf-available/z-ocsinventory-server.conf /etc/apache2/conf-enabled/z-ocsinventory-server.conf

Ces paramètres sont pour que l’interface Web OCS Inventory soit correctement exécutée par Apache2.

Ensuite, changez les permissions d’exécution du dossier de OCS Inventory so that there are no problems with the graphical interface.

$ sudo chown -R www-data:www-data /var/lib/ocsinventory-reports/

Après cela, vous devez écrire les paramètres de base de données to another configuration file:

$ sudo nano /etc/apache2/conf-available/z-ocsinventory-server.conf
9.- Finals configurations

As in the previous configuration file, you have to write the name of the database, the MariaDB user and the password.

Save the changes and close the file.

Après cela, redémarrez Apache.

$ sudo systemctl restart apache2

Now all you have to do is complete the installation through the web interface.

To do this open your favorite web browser and go to http://192.168.0.181/ocsreports/ (si par exemple l’adresse IP de votre serveur est 192.168.0.181) et vous verrez un écran où vous pouvez saisir vos identifiants MariaDB.

10.- Installing OCSInventory on Debian 10
10.- Installing OCSInventory on Debian 10

Then, the installation will begin and if everything has gone well, you will see the following image:

11.- OCSInventory is installed
11.- OCSInventory is installed

There you will see the default credentials which are user:admin and password:admin.

Now you will see the Login screen:

12.- OCSInventory log in screen
12.- OCSInventory log in screen

Once you have logged in you will see the following:

13.- OCSInventory on Debian 10
13.- OCSInventory on Debian 10

Et voila. OCS Inventory est prêt à l’emploi. Maintenant nous devons installer les agents sur les ordinateurs. Mode d’emploi ici:

https://wiki.ocsinventory-ng.org/07.OCS-Tools/OCS-Inventory-NG-Agent-Deployement-Tool/

 

Conclusion

OCSInventory is a great application that we can take full advantage of in an organization, whether it is small or large. Well, today you have learned to install it on a computer with Debian 10.

 

 

 

Print Friendly, PDF & Email

Leave a Reply

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Blue Captcha Image
Refresh

*

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.