OCS Inventory NG on Ubuntu 14.04

OCS Inventory NG (Open Computer and Software Inventory Next Generation) è un free software che consente di creare un inventario dei proprio assets IT. OCS-NG colleziona informazioni riguardanti  hardware e software della macchine della rete sulla quale è attivo l’agent OCS. OCS-NG visualizza poi queste informazioni attraverso una comoda interfaccia web.

L’installazione su Ubuntu 14.04 può essere resa difficoltosa dal fatto che sono state applicate alcune modifiche al comportamento del web server Apache 2, che causa il non funzionamento dell’installazione, se si procede con i parametri di default proposti dal setup. E’ quindi necessario procedere con un’installazione manuale partendo dall’archivio .tar, installando con apt-get solo le dipendenze necessarie.

Di seguito i comandi per avere un’installazione funzionante di OCS-NG su Ubuntu 14.04:

installazione delle dipendenze:

$ sudo apt-get install apache2

$ sudo apt-get install php5

$ sudo apt-get install mysql-server phpmyadmin
l’installazione di questi 2 ultimi pacchetti richiede un intervento interattivo per inserire la password di amministratore di mysql e di phpmyadmin

Ora e possibile scaricare la versione più recente di OCS Inventory NG dalla pagina http://www.ocsinventory-ng.org/en/download/download-server.html
Decomprimere il pacchetto:

$ tar zxvf OCSNG_UNIX_SERVER-2.1.1.tar.gz

Quindi entrare nella directory di installazione ed eseguire il setup:

$ cd OCSNG_UNIX_SERVER-2.1.1
$ sudo ./setup.sh

Di seguito l’output dell’installazione sulla mia macchina Ubuntu 14.04, con i parametri che ho passato in input:

+———————————————————-+
| |
| Welcome to OCS Inventory NG Management server setup ! |
| |
+———————————————————-+

Trying to determine whitch OS or Linux distribution you use
+———————————————————-+
| Checking for Apache web server binaries ! |
+———————————————————-+

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)?y
Assuming Communication server 1.0 RC2 or previous is not installed
on this computer.

Starting OCS Inventory NG Management server setup from folder /home/system/OCSNG_UNIX_SERVER-2.1.1
Storing log in file /home/system/OCSNG_UNIX_SERVER-2.1.1/ocs_server_setup.log

+———————————————————-+
| Checking for database server properties… |
+———————————————————-+

Your MySQL client seems to be part of MySQL version 5.5.
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… |
+———————————————————-+

[Fri Jun 06 08:53:03.983579 2014] [core:warn] [pid 4406] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Jun 06 08:53:03.983998 2014] [core:warn] [pid 4406] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Jun 06 08:53:03.984148 2014] [core:warn] [pid 4406] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Jun 06 08:53:03.984312 2014] [core:warn] [pid 4406] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jun 06 08:53:04.004783 2014] [core:warn] [pid 4406] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jun 06 08:53:04.005698 2014] [core:warn] [pid 4406] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jun 06 08:53:04.005869 2014] [core:warn] [pid 4406] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00543: apache2: bad user name ${APACHE_RUN_USER}
[Fri Jun 06 08:53:04.068031 2014] [core:warn] [pid 4412] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Jun 06 08:53:04.068209 2014] [core:warn] [pid 4412] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Jun 06 08:53:04.068240 2014] [core:warn] [pid 4412] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Jun 06 08:53:04.068283 2014] [core:warn] [pid 4412] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jun 06 08:53:04.088969 2014] [core:warn] [pid 4412] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jun 06 08:53:04.089663 2014] [core:warn] [pid 4412] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jun 06 08:53:04.089710 2014] [core:warn] [pid 4412] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00543: apache2: bad user name ${APACHE_RUN_USER}
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
.
Setup will put OCS Inventory NG Apache configuration in this directory.
Where is Apache Include configuration directory [] ?/etc/apache2/sites-available
OK, Apache Include configuration directory /etc/apache2/sites-available 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 Communication server plugins configuration directory… |
+—————————————————————————-+

Communication server need a directory for plugins configuration files.
Where to put Communication server plugins configuration files [/etc/ocsinventory-server/plugins] ?
OK, Communication server will put plugins configuration files into directory /etc/ocsinventory-server/plugins 😉

+——————————————————————-+
| Checking for Communication server plugins perl directory… |
+——————————————————————-+

Communication server need a directory for plugins Perl modules files.
Where to put Communication server plugins Perl modules files [/etc/ocsinventory-server/perl] ?
OK, Communication server will put plugins Perl modules files into directory /etc/ocsinventory-server/perl 😉
+———————————————————-+
| 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 Apache2::SOAP PERL module…
*** Warning: PERL module Apache2::SOAP is not installed !
This module is only required by OCS Inventory NG SOAP Web Service.
Do you wish to continue ([y]/n] ?y
Checking for XML::Entities PERL module…
Found that PERL module XML::Entities is available.
+———————————————————-+
| OK, looks good 😉 |
| |
| Configuring Communication server Perl modules… |
+———————————————————-+

Writing Makefile for Apache::Ocsinventory
Writing MYMETA.yml and MYMETA.json

+———————————————————-+
| 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.
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 😉 |
| |
| Creating Communication server plugins configuration directory… |
+—————————————————————————–+

Creating Communication server plugins configuration directory /etc/ocsinventory-server/plugins.
+—————————————————————————–+
| OK, Communication server plugins configuration directory created 😉 |
| |
| Creating Communication server plugins Perl directory… |
+—————————————————————————–+

Creating Communication server plugins Perl directory /etc/ocsinventory-server/perl.
+——————————————————————-+
| OK, Communication server plugins Perl 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/sites-available/ocsinventory.conf
Writing communication server configuration to file /etc/apache2/sites-available/z-ocsinventory-server.conf

+———————————————————-+
| OK, Communication server setup sucessfully finished 😉 |
| |
| Please, review /etc/apache2/sites-available/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,
administration console logs, IPDiscover and SNMP [/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.
Creating snmp mibs directory /var/lib/ocsinventory-reports/snmp.
Fixing permissions on directory /var/lib/ocsinventory-reports/snmp.
Creating Administration server log files directory /var/lib/ocsinventory-reports/logs.
Fixing permissions on directory /var/lib/ocsinventory-reports/logs.
Creating Administration server scripts log files directory /var/lib/ocsinventory-reports/scripts.
Fixing permissions on directory /var/lib/ocsinventory-reports/scripts.
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/sites-available/ocsinventory-reports.conf

+———————————————————-+
| OK, Administration server installation finished 😉 |
| |
| Please, review /etc/apache2/sites-available/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 /home/system/OCSNG_UNIX_SERVER-2.1.1/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 😉
Eseguita l’installazione, è necessario modificare il file z-ocsinventory-server.conf:

$ sudo vi /etc/apache2/sites-available/z-ocsinventory-server.conf

cercare il la riga <location /ocsinterfaace> e cambiare la riga:

require “SOAP_USER”

in

require user “SOAP_USER”

Modificare anche il file ocsinventory-reports.conf:

$ sudo vi /etc/apache2/sites-available/ocsinventory-reports.conf

cambiando la prima riga da:

Alias / /usr/share/ocsinventory-reports/ocsreports

a Alias /ocsreports /usr/share/ocsinventory-reports/ocsreports

Creare poi i collegamenti per gestire correttamente gli alias di Apache 2:

$ sudo cd /etc/apache2/sites-available/
$ sudo ln -s ../sites-available/z-ocsinventory-server.conf  ocsinventory.conf
$ sudo ln -s ../sites-available/ocsinventory-reports.conf ocsreports.conf

Riavviare quindi il web server Apache 2:

$ sudo service apache2 restart

A questo punto è possibile collegarsi all’interfacca web di OCS-NG puntanto il browser all’indirizzo http://ipserver/ocsreports

E’ poi possibile procedere con l’installazione del’agent sui diversi client. Alla pagina http://www.ocsinventory-ng.org/en/download/download-agent.html è possibile scaricare l’agent per più sistemi operativi. Sui client Ubuntu è sufficiente installare il pacchetto con apt-get:

$ sudo apt-get install ocsinventory-agent

Quindi modificare il file /etc/ocsinventory/ocsinventory-agent.cfg, che deve avere questo aspetto:

server=ipserver/ocsinventory

Buon inventario!:)

Be Sociable, Share!

Potrebbero interessarti anche...

6 Risposte

  1. vincenzo ha detto:

    Ciao, complimenti per la guida, ti volevo chiedere, ho eseguito tutto senza problemi ma purtroppo quando punto la pagina di http://ipserver/ocsreports mi viene fuori la pagina di default di Apache2 Ubuntu Default Page
    riesci a darmi qualche dritta ?
    ti ringrazio

  2. Ruben Calderon Valladares ha detto:

    Great article, I could finally install OCS-Inventory NG (I don’t speak italian but I do speak spanish and french, I think that did the trick 😉

    By the way, just one minor typo:

    Instead of these lines:

    $ sudo cd /etc/apache2/sites-available/
    $ sudo ln -s ../sites-available/z-ocsinventory-server.conf ocsinventory.conf
    $ sudo ln -s ../sites-available/ocsinventory-reports.conf ocsreports.conf

    I used this:

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

    Thanks!

  3. Dionysoos ha detto:

    Hi,

    Rubben Calderon Valladares :

    By the way, just one minor typo:

    Instead of these lines:

    $ sudo cd /etc/apache2/sites-available/
    $ sudo ln -s ../sites-available/z-ocsinventory-server.conf ocsinventory.conf
    $ sudo ln -s ../sites-available/ocsinventory-reports.conf ocsreports.conf

    I used this:

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

    It is the same.

  4. Dionysoos ha detto:

    Thank FastFire the solution has solved my problem (For this moment OCS Inventory not support Apache 2.4 directly)

  5. Blacknutso ha detto:

    Hello thx for the tutorial but,

    i dont understand when you said : $ sudo vi /etc/apache2/sites-available/ocsinventory-reports.conf

    cambiando la prima riga da:

    Alias / /usr/share/ocsinventory-reports/ocsreports

    a Alias /ocsreports /usr/share/ocsinventory-reports/ocsreports

    i must add this line ??

    when i go on : /etc/apache2/sites-available/ocsinventory-reports.conf

    i have this one the first line : Alias /ocsreports y/ocsreports

    so i ust delete this and remplace for :

    Alias / /usr/share/ocsinventory-reports/ocsreports

    a Alias /ocsreports /usr/share/ocsinventory-reports/ocsreports

    please help me !
    thx for your patience

  6. fastfire ha detto:

    You must replace this line:

    Alias / /usr/share/ocsinventory-reports/ocsreports

    with this:

    Alias /ocsreports /usr/share/ocsinventory-reports/ocsreports

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *