In today’s world, organizations are moving at the level of increasingly demanding users. To ensure that companies have the right view of things every day, they need to control the assets they have, part of which is computer equipment. We are talking about the inventory of computer equipment.
Inventories are tangible goods held for sale in the ordinary course of business or to be consumed in the production of goods or services for subsequent marketing.
It’s usually a tedious process carried out manually, but thanks to the efforts of some developers, it’s possible to do it automatically and efficiently with OCSInventory.
OCSInventory allows you to collect hardware and software inventory from all active devices on the network, such as computers, switches, routers, network printers and unattended devices. It Supports for multiple operating systems, including Microsoft Windows, Linux, * BSD, Sun Solaris, IBM AIX, HP-UX, MacOS X. It has the ability to support Plugins and integrates seamlessly with GLPI.
Let’s install it!!
First of all we must be root users. We open a terminal and write:
After entering the password we will be root users. Then we installed LAMP Stack.
apt install apache2 php7.2 libapache2-mod-php7.2 php7.2-cli php7.2-common php7.2-cgi mariadb-server mariadb-client php7.2-mysql mariadb-common
Once the installation of the packages is finished we will have a basic web server. Now we proceed to install basic compilation packages.
apt install linux-headers-$(uname -r) build-essential
Next we must install some perl modules needed.
apt install libxml-simple-perl libcompress-raw-zlib-perl libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl
Now we write:
cpan -i XML::Entities
We install other necessary php modules.
apt install php7.2-gd php-pclzip
We now proceed to download the OSCInventory.
Now we unzip the archive.
tar -xvzf OCSNG_UNIX_SERVER_2.4.1.tar.gz
Now we rename the folder, and move it to our apache root directory:
mv OCSNG_UNIX_SERVER_2.4.1 /var/www/html/OCS
Before starting the installation, we installed other necessary php modules.
apt install php7.2-soap php7.2-curl php7.2-xml php7.2-xmlrpc
Now we enter the directory and run the setup.sh script
Running it will ask us many questions about configuration file locations, executable files and check the installed PERL modules. In the end, if everything went well, we should get the message that the installation was successful.
Before running its web interface, we must copy the apache configuration that the installer creates as a new apache site.
Finally, we make sure we have permissions on the /var/lib/ocsinventory-reports/ folder and we restart apache.
<strong>chown -R www-data:www-data /var/lib/ocsinventory-reports/ chmod 755 -R /var/www/html/OCS/* systemctl restart apache2 </strong>
Accessing the web interface
Now we can access the web interface from our browser:
Note: Remember that the path might be different, so it is important to be careful about assigning folder names.
As we can notice, we skip the warning that we can’t build larger 2mb packages, so we must modify that value in the PHP configuration file.
We will modify the parameters: upload_max_filesize and post_max_size
And we restart Apache:
systemctl restart apache2
When accessing again, we notice that the warning continues but 250mb is a suitable value that should not cause problems.
When you click on send, it will take a while to complete the installation and then inform us that we can access with user admin and password admin
By clicking on the link below, we can then log in.
Then when you log in, and check that everything is OK, we must remove the installer. As a recommendation you should change the password for mariadb.
Now we would have to install the agent in each of the computers that we want to inventory.
As a conclusion we can say that OCSInventory is an interesting application in the world of organizations that allows us to have an updated and reliable inventory of all our computer equipment.
Please share this article on your social networks.