OCS Inventory NG installation on NethServer 7.x

UPDATE 2017-03-22
Thanks to @stephdl, the nethserver-ocsinventory package for NS 7 is now available! :slight_smile:
First install the ocsinventory repository

yum install http://rpm.ocsinventory-ng.org/enterprise/7/x86_64/ocsinventory-release-7-4.el7.ocs.noarch.rpm

then

yum install http://mirror.de-labrusse.fr/NethDev/nethserver-ocsinventory/nethserver-ocsinventory-1.1.4-1.ns7.sdl.noarch.rpm

You have some db

~]# config show ocsinventory 
 ocsinventory=configuration
    Name=ocsreports #to change the web alias eg https://IP/othername
    access=private     #or public
    status=enabled    #or disabled to stop ocsinventory web access

Go here for insights: Nethserver-ocsinventory needs testers

Here we go! :slight_smile:
Now you can run OCS Inventory NG even on NS 7! :wink:

OCS Inventory NG is a powerful technical management solution of IT assets.

Here you can find all the documentation about the product: http://wiki.ocsinventory-ng.org/index.php/Documentation:Main

Thanks to @stephdl, here’s a step-by-step how-to to install OCS on NS:

  1. Install prerequisites for NethServer:

    yum install @nethserver-mysql @nethserver-web -y

  2. Install OCS packages from original repo:

    yum --enablerepo=epel -y install http://rpm.ocsinventory-ng.org/enterprise/7/x86_64/ocsinventory-2.3.0-1.el7.ocs.noarch.rpm http://rpm.ocsinventory-ng.org/enterprise/7/x86_64/ocsinventory-reports-2.3.0-1.el7.ocs.noarch.rpm http://rpm.ocsinventory-ng.org/enterprise/7/x86_64/ocsinventory-server-2.3.0-1.el7.ocs.noarch.rpm http://rpm.ocsinventory-ng.org/enterprise/7/x86_64/perl-Apache-DBI-1.12-2.el7.ocs.noarch.rpm http://rpm.ocsinventory-ng.org/enterprise/7/x86_64/perl-Apache2-SOAP-0.73-14.el7.ocs.noarch.rpm

  3. Create and configure needed MySQL db:

    mysql -e “CREATE DATABASE ocsweb CHARACTER SET utf8 COLLATE utf8_bin;
    GRANT ALL PRIVILEGES ON ocsweb.* TO ‘ocs’ identified by ‘ocspass’;
    GRANT ALL PRIVILEGES ON ocsweb.* TO ‘ocs’@‘localhost’ identified by ‘ocspass’;
    FLUSH PRIVILEGES;”

  4. Populate db using OCS dump:

    mysql ocsweb < /usr/share/ocsinventory-reports/ocsreports/files/ocsbase_new.sql

  5. Edit “ocsinventory-server.conf” file to update db password:

    sed -i “s/PerlSetVar OCS_DB_PWD ocs/PerlSetVar OCS_DB_PWD ocspass/” /etc/httpd/conf.d/ocsinventory-server.conf

  6. Populate dbconfig.inc.php file:

    echo -e “<?php\ndefine(\"DB_NAME\",\"ocsweb\");\n\ define(\"SERVER_READ\",\"localhost\");\n\ define(\"SERVER_WRITE\",\"localhost\");\n\ define(\"COMPTE_BASE\",\"ocs\");\n\ define(\"PSWD_BASE\",\"ocspass\");\n?>” > /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php

  7. Reload Apache:

    systemctl reload httpd

  8. As a good practice, rename installation script file:

    mv /usr/share/ocsinventory-reports/ocsreports/install.php
    /usr/share/ocsinventory-reports/ocsreports/install.php.ori


done!

You can reach OCS Inventory NG using default url:

http://server.domain/ocsreports

and default credentials (admin/admin)

8 Likes

no chance to get a rpm @nrauso, if needed i can lend a hand

1 Like

started

2 Likes

Oh man, great job!
Had some little personal trouble and read just now!

Thx for the rpm!

1 Like

perhaps you should write in your howto that a rpm exists now

1 Like

Of course: done just now! :slight_smile:
Thx a lot!

2 Likes

Cannot open: yum install http://mirror.de-labrusse.fr/NethDev/nethserver-ocsinventory/nethserver-ocsinventory-1.1.4-1.ns7.sdl.noarch.rpm
Error: Nothing to do

Hi @alexcsilva,

I think you have an old link, here is a howto to install OCS:

https://wiki.nethserver.org/doku.php?id=ocsinventory

2 Likes

@mrmarkuz Thanks !

1 Like