Feature #3230

OCS Inventory NG package

Added by Giovanni Bezicheri about 6 years ago. Updated almost 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-ocsinventory
Target version:v6.6
Resolution: NEEDINFO:No

Description

Implement nethserver-ocsinventory RPM package, following Nicola's howto

http://community.nethserver.org/t/ocs-inventory-ng-installation-on-nethserver/631


Related issues

Related to NethServer 6 - Feature #3229: Adagios package CLOSED

Associated revisions

Revision 8029c3b6
Added by Giovanni Bezicheri about 6 years ago

Initial commit. Refs #3230

Revision 185bbf4b
Added by Davide Principi about 6 years ago

Dashboard link to OCS Inventory NG web app. Refs #3230

Revision cbba1631
Added by Giovanni Bezicheri about 6 years ago

Remove warning message from ocsinventory about install.php. Refs #3230

Revision 4f772518
Added by Giovanni Bezicheri about 6 years ago

Fix service name when generating password. Refs #3230

Revision 4a07f20b
Added by Davide Principi about 6 years ago

Added templates for configuration files. Refs #3230

  • /etc/httpd/conf.d/ocsinventory-reports.conf
  • /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php

Revision 1237b2e6
Added by Davide Principi about 6 years ago

Template for ocsinventory-server.conf. Refs #3230

Expand OCS_DB_PWD parameter.

Revision a76dd2dc
Added by Davide Principi about 6 years ago

Fix ownership and permissions on dbconfig.inc.php template expansion. Refs #3230

Revision 929b642c
Added by Davide Principi almost 6 years ago

Removed unused file. Refs #3230

History

#1 Updated by Giovanni Bezicheri about 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#2 Updated by Giovanni Bezicheri about 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

Test Case

#3 Updated by Giovanni Bezicheri about 6 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giovanni Bezicheri)
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-ocsinventory-0.0.1-1.ns6.noarch.rpm

#4 Updated by dz0 0te about 6 years ago

  • Assignee set to dz0 0te

#5 Updated by dz0 0te about 6 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (dz0 0te)
  • % Done changed from 70 to 90

System and Package Version installed
VM KVM - Clean install of Nethserver 6.6 fully updated
Package Installed: ...
Other Package installed: File server,MySQL server,Web server

Test Original Problem
Feature

Install Updated Package

yum --enablerepo=nethserver-testing install nethserver-ocsinventory-0.0.1-1.ns6

Test Results after update
Installation OK
Login with default u/p OK
Test connection/inventory with a windows agent OK

Verified Or Reopen
Verified

Note
1. it would be nice to add a link in status>dashboard>applications
2. SECURITY ALERT! - Your install.php exists in your installation directory.
/usr/share/ocsinventory-reports/ocsreports/install.php should be deleted after installation
3. evaluate ldap integration

#6 Updated by Davide Principi about 6 years ago

#7 Updated by Davide Principi about 6 years ago

  • Status changed from VERIFIED to ON_QA
  • % Done changed from 90 to 70

Thanks dz0 0te, Giovanni has fixed the code according to your suggestions.

Test case 2

In a clean installation

  • The install.php warning must not appear.
    Unfortunately the original OCS Inventory RPM installs it as a normal file, so reinstalling or updating that package re-creates it. The modified code changes its permissions to 0600.
  • Added Dashboard link

In nethserver-testing:
nethserver-ocsinventory-0.0.1-1.3.g4f77251.ns6.noarch.rpm

#8 Updated by Davide Principi about 6 years ago

  • Status changed from ON_QA to TRIAGED
  • % Done changed from 70 to 20

TODO:

  • implement as templates, or backup configurations
    /etc/httpd/conf.d/ocsinventory-reports.conf
    /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
    

#9 Updated by Davide Principi about 6 years ago

  • Status changed from TRIAGED to MODIFIED
  • % Done changed from 20 to 60

Test case

Install on a fresh machine

  • check template expansion:
    expanding /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
    expanding /etc/httpd/conf.d/ocsinventory-reports.conf
    
  • check web application is working at the same URL as before

#10 Updated by Davide Principi about 6 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-ocsinventory-0.0.1-1.4.g4a07f20.ns6.noarch.rpm

#11 Updated by dz0 0te about 6 years ago

  • Assignee set to dz0 0te

#12 Updated by dz0 0te about 6 years ago

  • Status changed from ON_QA to TRIAGED
  • Assignee deleted (dz0 0te)
  • % Done changed from 70 to 20

it's almost all ok.
template expansion:

Jul 27 08:51:36 ns6fresh3 esmith::event[16683]: expanding /etc/httpd/conf.d/ocsinventory-reports.conf
Jul 27 08:51:37 ns6fresh3 esmith::event[16683]: expanding /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
Jul 27 08:51:37 ns6fresh3 esmith::event[16683]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.765158]

but testing the connection with an agent give me error 500 on client
http://forums.ocsinventory-ng.org/viewtopic.php?pid=41708#p41708
it seems that the new rpm doesn't write correctly the
PerlSetvar OCS_DB_PWD password in /etc/httpd/conf.d/ocsinventory-server.conf
leaving it to the default ocs instead of the password that can be found in /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
after changing the password, the agent can send the inventory correctly

#13 Updated by Davide Principi about 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

Thanks for your very appreciated help, dz00te!

#14 Updated by Davide Principi about 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Fixed OCS_DB_PWD in /etc/httpd/conf.d/ocsinventory-server.conf. Now it is a template, expanded during upgrade/installation.

Test case

check the agent can send the inventory correctly

#15 Updated by Davide Principi about 6 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-ocsinventory-0.0.1-1.5.g1237b2e.ns6.noarch.rpm

#16 Updated by dz0 0te about 6 years ago

  • Assignee set to dz0 0te

#17 Updated by dz0 0te about 6 years ago

  • NEEDINFO changed from No to Yes

it's all working now, but hust to be sure before set it as verified... i see this in the log:

[...]
Jul 28 08:18:29 ns6fresh2 esmith::event[13382]: [INFO] service httpd restart
Jul 28 08:18:30 ns6fresh2 esmith::event[13382]: Stopping httpd: [  OK  ]#015
Jul 28 08:18:30 ns6fresh2 esmith::event[13382]: Starting httpd: [  OK  ]#015
Jul 28 08:18:30 ns6fresh2 esmith::event[13382]: [INFO] httpd restart
Jul 28 08:18:30 ns6fresh2 esmith::event[13382]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [2.206385]
Jul 28 08:18:30 ns6fresh2 esmith::event[13382]: Event: nethserver-ocsinventory-update SUCCESS
Jul 28 08:18:30 ns6fresh2 esmith::event[13423]: Event: runlevel-adjust 
Jul 28 08:18:31 ns6fresh2 esmith::event[13423]: Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
Jul 28 08:18:31 ns6fresh2 esmith::event[13423]: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
Jul 28 08:18:31 ns6fresh2 esmith::event[13423]: no listening sockets available, shutting down
Jul 28 08:18:31 ns6fresh2 esmith::event[13423]: Unable to open logs
Jul 28 08:18:31 ns6fresh2 esmith::event[13423]: [FAILED]#015
Jul 28 08:18:32 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S20runlevel-adjust FAILED: 1 [1.428354]
Jul 28 08:18:32 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S91nethserver-directory-init-admin SUCCESS [0.443199]
Jul 28 08:18:32 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S95create-default-accounts SUCCESS [0.084328]
Jul 28 08:18:32 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S96create-default-ibays SUCCESS [0.081245]
Jul 28 08:18:33 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S96nethserver-samba-user-create SUCCESS [0.582287]
Jul 28 08:18:34 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S97nethserver-samba-sam-conf SUCCESS [0.42199]
Jul 28 08:18:34 ns6fresh2 esmith::event[13423]: Updated comment of group NS6FRESH2\domadmins to Domain Admins
Jul 28 08:18:34 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S98nethserver-samba-group-sync SUCCESS [0.207746]
Jul 28 08:18:34 ns6fresh2 esmith::event[13423]: Action: /etc/e-smith/events/runlevel-adjust/S99nethserver-samba-netcacheflush SUCCESS [0.035637]
Jul 28 08:18:34 ns6fresh2 esmith::event[13423]: Event: runlevel-adjust FAILED
Jul 28 08:18:34 ns6fresh2 esmith::event[13626]: Event: firewall-adjust 
Jul 28 08:18:34 ns6fresh2 esmith::event[13627]: Event: lokkit-save firewall-adjust

manual relaunch of "signal-event runlevel-adjust" return no error
if i remove nethserver-ocsinventory and reinstall it, also no error

since everything seems to be working fine, i don't know whether to consider it as verified, or if that "failed" can cause problems in the future

#18 Updated by dz0 0te about 6 years ago

  • Assignee deleted (dz0 0te)

#19 Updated by Davide Principi about 6 years ago

  • NEEDINFO changed from Yes to No

I tried to install on a clean environment and the error message didn't come out. Anyway I noticed an ownership/permission issue in dbconfig.inc.php:

# rpm -V ocsinventory-reports
S.5....T.  c /etc/httpd/conf.d/ocsinventory-reports.conf
SM5..U.T.  c /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
.M.......    /usr/share/ocsinventory-reports/ocsreports/install.php

fixed

In nethserver-testing:
nethserver-ocsinventory-0.0.1-1.6.ga76dd2d.ns6.noarch

# rpm -V ocsinventory-reports
S.5....T.  c /etc/httpd/conf.d/ocsinventory-reports.conf
S.5....T.  c /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
.M.......    /usr/share/ocsinventory-reports/ocsreports/install.php

#20 Updated by dz0 0te about 6 years ago

  • Assignee set to dz0 0te

#21 Updated by dz0 0te about 6 years ago

Davide Principi wrote:

I tried to install on a clean environment and the error message didn't come out. Anyway I noticed an ownership/permission issue in dbconfig.inc.php:[...]

fixed

In nethserver-testing:
nethserver-ocsinventory-0.0.1-1.6.ga76dd2d.ns6.noarch

[...]

yes my test environment was with "File Server" installed. I can confirm that on clean installation there is no error message, while with File Server installed the error is still there. Since i don't see any other problem if you agree i would mark it as verified...or maybe the failure will generate an error message when ocs will be installed from gui?

#22 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from ON_QA to TRIAGED
  • Assignee deleted (dz0 0te)
  • % Done changed from 70 to 20

yes my test environment was with "File Server" installed. I can confirm that on clean installation there is no error message, while with File Server installed the error is still there. Since i don't see any other problem if you agree i would mark it as verified...or maybe the failure will generate an error message when ocs will be installed from gui?

I also reproduced the problem, the conflicting package is nethserver-ibays. I think we need to workaround the problem, otherwise package installation from web interface will always report an error.

Steps to reproduce:
  • install nethserver-ocsinventory, no problem arises
  • install nethserver-ibays
  • re-install nethserver-ocsinventory:
    yum  --enablerepo=nethserver-testing reinstall nethserver-ocsinventory
    
  • runlevel-adjust event fails, but httpd is running: maybe there is a race conditions due to httpd slow restart?

Also, remove this wrong fragment: /etc/e-smith/templates-default/templates-begin-php

#23 Updated by Davide Principi about 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

#24 Updated by Davide Principi almost 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

MODIFIED

Removed the unused file.

I cannot reproduce the error message. I propose to ignore the error message and open a bug when more informations will be available.

#25 Updated by Davide Principi almost 6 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-ocsinventory-0.0.1-1.7.g929b642.ns6.noarch.rpm

#26 Updated by dz0 0te almost 6 years ago

  • Assignee set to dz0 0te

#27 Updated by dz0 0te almost 6 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (dz0 0te)
  • % Done changed from 70 to 90

System and Package Version installed
VM KVM - Clean install of Nethserver 6.6 fully updated
Package Installed: ...
Other Package installed: none

Test Original Problem
Feature

Install Updated Package

yum --enablerepo=nethserver-testing install nethserver-ocsinventory-0.0.1-1.7.g929b642.ns6

Test Results after update
Test Case 1:
Installation OK
Login with default u/p OK
Test connection/inventory with a windows agent OK

Test Case2:
link in status>dashboard>applications OK
No More Security Alert for install.php
check template expansion:

JAug  3 09:42:02 ns6fresh3 esmith::event[2374]: expanding /etc/httpd/conf.d/ocsinventory-reports.conf
Aug  3 09:42:02 ns6fresh3 esmith::event[2374]: expanding /etc/httpd/conf.d/ocsinventory-server.conf
Aug  3 09:42:02 ns6fresh3 esmith::event[2374]: expanding /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
Aug  3 09:42:02 ns6fresh3 esmith::event[2374]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.11278]
Aug  3 09:42:04 ns6fresh3 esmith::event[2374]: Action: /etc/e-smith/events/nethserver-ocsinventory-update/S40nethserver-ocsinventory-conf SUCCESS [1.946927]

check permission issue:

# rpm -V ocsinventory-reports
S.5....T.  c /etc/httpd/conf.d/ocsinventory-reports.conf
S.5....T.  c /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php
.M.......    /usr/share/ocsinventory-reports/ocsreports/install.php

Verified Or Reopen
Verified

Note
1. in my test, the error if file manager is installed is still present. However, as requested set as verified
2. ldap integration - evaluate/test/make howto

#28 Updated by Davide Principi almost 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

In nethserver-updates/6.6
nethserver-ocsinventory-1.0.0-1.ns6.noarch.rpm

ocsinventory-2.1.2-3.el6.remi.noarch.rpm
ocsinventory-reports-2.1.2-3.el6.remi.noarch.rpm
ocsinventory-server-2.1.2-3.el6.remi.noarch.rpm
perl-Apache2-SOAP-0.73-3.el6.noarch.rpm
perl-Apache-DBI-1.11-1.el6.remi.noarch.rpm
perl-XML-Entities-1.0000-1.el6.noarch.rpm
php-pear-CAS-1.3.3-1.el6.noarch.rpm

Also available in: Atom PDF