OCS Inventory NG installation on NethServer 6.x

intermediate
application

(Nicola) #1

UPDATE 2015-08-25
The package nethserver-ocsinventory is now available from nethserver-updates repository. To install it type:

  yum install nethserver-ocsinventory

Now you have to use NethServer admin credentials to access OCS web interface!

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

Here is how to install OCS on NethServer, using the great work done by Remi (source: http://blog.famillecollet.com/post/2014/02/14/OCS-Inventory-NG-2.1-en)

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

  1. Install prerequisites for NethServer:

    yum install nethserver-httpd nethserver-mysql nethserver-samba -y

  2. Install and disable additional repos (to prevent unwanted updates):

    rpm -ihv http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    rpm -ihv http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    sed -i ‘s/enabled=1/enabled=0/’ /etc/yum.repos.d/epel.repo

  3. Install requested additional packages:

    yum --enablerepo=epel install php-gd php-imap php-ldap php-mbstring php-mysql php-pear-CAS -y

  4. Install OCS packages:

    yum --enablerepo=epel,remi install ocsinventory -y

  5. Create and configure needed MySQL db:

    mysql -e “create database ocsweb;
    grant all privileges on ocsweb.* to ‘ocs’@‘localhost’
    identified by ‘ocspass’;
    flush privileges;”

  6. Populate db using OCS dump:

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

  7. Editocsinventory-server.conf” file:

    vi /etc/httpd/conf.d/ocsinventory-server.conf

and modify db password you find at line 30:

...
PerlSetVar OCS_DB_PWD ocspass
...
  1. Create dbconfig.inc.php file:

    vi /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php

with the content below:

<?php
define("DB_NAME", "ocsweb");
define("SERVER_READ","localhost");
define("SERVER_WRITE","localhost");
define("COMPTE_BASE","ocs");
define("PSWD_BASE","ocspass");
?>
  1. Reload Apache with new parameters:

    service httpd reload

  2. 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)


Nethserver-adagios and nethserver-ocsinventory have been released
The NethServer End User Dashboard
Welcome to NethServer Community
Trying OCS inventory + adagios module
(Michele Bortolotto) #2

well done…i’ll try it in my development vm :smiley:


(Alessio Fattorini) #3


(Davide Principi) #4

I moved 2 posts to an existing topic: Nethserver-adagios and nethserver-ocsinventory have been released


(Jose "Martin" Abeleira. AKA Marto) #5

The agents are there

http://www.ocsinventory-ng.org/en/download/download-agent.html


#6

Great job, a noob like me would never have done it so easily without your help, it would have taken hours to find the right informations. I’ve just started using NethServer recently but I already like this user-friendly project.

Thanks to the whole NS team!


(Alessio Fattorini) #7

Ehi @FenyX
you’re welcome from whole NethServer Team! Can You tell us more about you?
Please introduce yourself here: Welcome to NethServer Community
How are you using these packages into your installation?


#9

Hi Nicola.

At first, I’ld like to suggest you to add a precision about the fact that the nethserver-ocsinventory package covers steps #1 to #8 of your installation guide, because this page became not so clear since its latest update in August. Maybe possible to divide tutorial in two parts? I mean one for Remi’s method and one through your nethserver-ocs bundle… Even if after successful tests I think that only your bundle should remain at the end, as long as it’s delivered with the right explanations. What do you think?

Secondly, I’ve installed the new nethserver-ocsinventory package, then reloaded Apache service and renamed install.php as instructed. At the end of your guide it’s said that we can reach OCS using url http://server.domain/ocsreports. So I’ve tried with NethServer’s local IP > http://192.168.0.x/ocsreports but it returns an Error 403 Forbidden page telling me that I don’t have permission to access /ocsreports.
When I try with https/SSL I see a pop-up titled “NethServer LDAP” and it asks for authentication, of course admin/admin doesn’t work here. Note that OCS is installed on a fresh and clean NethServer VM, before adding OCS with yum I had only installed the nano text editor, the NS french language package and the latest updates from NS interface Software Manager.

During my investigations, I’ve seen the following lines in /etc/httpd/conf.d/ocsinventory-reports.conf:

AuthName "NethServer LDAP"
AuthLDAPBindPassword same-strong-password-as-db
Require user admin

I’ve tried again to access https://server_ip/ocsreports with user “admin” and “same-strong-password-as-db” for password but it didn’t work. And the user manual at OCS website also confirms that I should go to http://server/ocsreports as you instructed, not https. Wrong track.

I’ve added an “AllowOverride Options” line to ocsinventory-reports.conf as recommended here but it didn’t change the result, still 403 Forbidden page.

I’ve also tried the “setenforce 0” command to temporarily make SELinux protection permissive and check if SELinux could be the cause but it hasn’t fixed the Forbidden page.

Of course I’ve restarted the httpd service after each try before testing again in my browser.

If I check the /var/log/httpd/error_log file I can see the following error:

[error] [client 192.168.0.x] access to /usr/share/ocsinventory-reports/ocsreports failed, reason: SSL connection required

But SSL access to /ocsreports still drives me to NethServer LDAP authentication popup. Now I’m definitely lost. I’ve imagined that it would be easier by doing it with this package, and indeed the automated installation was so simple. But I’ve passed so much hours on this issue… it could mean it’s hard to fix or it could mean I’m inefficient, lol.

Your full package installation on top of the guide followed by the full install instructions has been confusing me, but above all I had the impression that you did some changes in your new nethserver-ocsinventory package install process that you didn’t explain here (ie. ocspass replaced by a randomly generated strong password, or the absence of the usual OCS installation script “setup.sh”). I see also the Nethesis name on top of some OCS config files so I guess that the setup is customized in depth.

I’m stuck at this issue, impossible to access /ocsreports, more because of my lack of web admin knowledge rather than a problem with your instructions, but the only thing I’m sure about is that I need your help.

I’m convinced that the fix will look so easy compared to all my efforts, as usual in this kind of situations :smile:


(Nick Kremer) #10

Hi FenyX,

I think you are making this too difficult for yourself! :slight_smile: Simply log in with your NethServer credentials.

I believe the admin/admin reference is for those that run through the process top to bottom without the aid of the package!

enjoy,
Nick


#11

It’s one of the first things that I’ve tried, of course. But thanks for the suggestion.

Because it’s a virtual machine I just reverted back to last snapshot before OCS installation then I’ve tried again wihtout the new package today, only following “old” step-by-step instructions above. And I’ve been successful at first try.

Some (maybe important) things are modified in the new bundle package compared to the instructions above, and I thought it could be interesting to understand how to make it work correctly, at least to get a final setup as reliable as the step-by-step method. I shouldn’t care about as I’ve done it successfully now but future users will think the new package is simpler while it’s not: install process is more simple but user couldn’t access the ocsreports page at the end.

If you publish this package thinking it’s ready for end-users, some of them could be disappointed. Reporting logs and tests is not just to complain but to help fixing, it’s the meaning and goal of feedback :wink:

Edit: By the way, if you’ve read the Apache log I’ve posted it says “SSL connection required” while OCS guides everywhere precise http:// before the first connection URL. And when I follow step-by-step instructions above I also connect without SSL so it should work without.
Now if I go to https://ip/ocsreports it works too! Also routing me to OCS page. So why did the same https URL go yesterday to “NethServer LDAP” login popup after having installed the new ‘nethserver-ocsinventory’ package? No tracks of this LDAP things today when doing the step-by-step instructions. I have no answer, I just ask questions trying to be logical.


#12

Hi FenyX,
i think i’ve not fully understood some of your installation steps…
i’ve re-tried installation on a clean 6.6 vm fully updated no packages installed

  1. yum install nethserver-ocsinventory

  2. then from webui, refresh the page, you should see a yellow alert “Change admin’s password”, do it.

  3. then always from web ui: Dashboard > Applications > OCS Inventory NG
    it should redirect you to
    https://IP_nethserver/ocsreports/

  4. login with admin/password (just created on point 2)

no other steps required, seems to work fine to me… if i have some time tomorrow i’ll retest with other packages installed… please could you retry on a vm these steps and post here any problem? tnx


#13

Hi,
that’s the problem. I didn’t arrive to webui.

It means, on a fresh NethServer :

  1. yum install nethserver-ocsinventory

  2. step #9 above : # service httpd reload
  3. step #10 “As a good practice, rename installation script file to install.php.ori”

That’s all, nothing exotic. I will try again this week-end but I’m near sure it’s a matter of file rights or something like this. Maybe a file with roots-only access while it shouldn’t. But if you can’t reproduce the same error, it’s weird. Have to research further.

Thanks for your help


#14

just to be clear, when i say from webui, i refer to nethserver https://ip_nethserver:980 not ocs.
it would be quite strange if after the installation of ocs you could not enter in nethserver anymore, so please let us know your tests results. tnx


#15

Ah ok. No, no problem with NethServer UI. Now that I understand your instructions correctly it makes sense (Dashboard, etc…). And I see that you’ve added “Now you have to use NethServer admin credentials to access OCS web interface!” to make things more clear. If at least I’ve been useful for that, it’s cool :smile:

To be honest I didn’t have the time to try again. Will do for sure, then will tell you here how it gone. Thanks again


(Jose "Martin" Abeleira. AKA Marto) #16

Tried this on 6.7 and had the problem reported access denied looking around
logs to see if i can find the cause.


#17

true,i did not control logs yet, but the error doesn’t seem on auth but on httpd…
btw the packages ar not the same, probably not updated on 6.7
on 6.6 updates: nethserver-ocsinventory-1.0.2-1.ns6.noarch.rpm
on 6.7 base: nethserver-ocsinventory-1.0.0-1.ns6.noarch.rpm

@davidep will the latest updates to 6.6 be released with 6.7rc1?


(Davide Principi) #18

Yes, I don’t see any problem here!