Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

installing OCSinventory on debian 11

Hello world, I'm new on OCS inventory and I'm trying to install/configure OCS Inventory server (the db, communication, deploy and administration console all on the same server)  on a debian bullseye (debian 11.4). This is what I have done.

First of all I have installed the certificate for the OCS inventory repository:

# curl http://deb.ocsinventory-ng.org/pubkey.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/ocsinventory-debian-bullseye.gpg

and then I have added to the apt sources the OCS repository:

deb [signed-by=/etc/apt/trusted.gpg.d/ocsinventory-debian-bullseye.gpg] http://deb.ocsinventory-ng.org/debian/ bullseye main

then I have launched the following commands to install OCS Inventory 2.10.0:

# apt update && apt install ocsinventory-server ocsinventory-reports

Then I followed the steps in http://myserver/ocsreports/install.php

All seems to work.

Then I login on http://inventory.csaricerche.com/ocsreports, changed the admin password and I get this security alert:

Your install.php exists in your installation directory (by default : /usr/share/ocsinventory-reports/ocsreports).
I have to remove install.php from /usr/share/ocsinventory-reports/ocsreports?
Then I have successfully installed the windows agent 2.9.2.0 on a windows client and run the agent.
No errors are reported but in http://inventory.csaricerche.com/ocsreports I can't find any information about this client and on the client I can find these logs:
==============================================================================
Starting OCS Inventory Agent on Thursday, July 14, 2022 11:29:49.
AGENT => Running OCS Inventory Agent Version 2.9.2.0
AGENT => Using OCS Inventory FrameWork Version 2.9.2.0
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory cURL Communication Provider> Version <2.9.2.0>
    AGENT => Sending getLabel request
    COM SERVER => Initializing cURL library for getFile
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Enabling cURL SSL server validation support using CA Bundle <C:\ProgramData\OCS Inventory NG\Agent\cacert.pem>
    COM SERVER => Sending fileGet request to URL <http://inventory/ocsinventory/deploy/label>
    COM SERVER => fileGet response received <HTTP Status Code #500>
    COM SERVER => Cleaning cURL library
    AGENT => Failed to retrieve Label <HTTP Status Code #500>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <WIN10PRO-V01-2022-07-14-11-27-10> and MACs <3A:09:D5:F3:31:9ABE:A6:28:9E:D4:6826:E1:DD:40:F2:40BE:98:7D:DD:88:52E2:17:9D:59:69:DD> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Enabling cURL SSL server validation support using CA Bundle <C:\ProgramData\OCS Inventory NG\Agent\cacert.pem>
    COM SERVER => Sending HTTP Post request to URL <http://inventory/ocsinventory>
    COM SERVER => HTTP Post response received <HTTP Status Code #500>
    COM SERVER => Cleaning cURL library
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #500>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:00.

...and I fear that I have forgot some configuration detail on the server. Someone can help me to correctly configure ocs inventory server?
Thank you very much
Piviul
in OCS Inventory NG server for Unix by (420 points)

11 Answers

0 votes
I was quite surprised that OCS supply the .deb package (for server) ... IMHO I prefer installing server using sources (from github) and use setup.sh for set pathnames. (There is LOT of tutorials using source install.)

OCS provide some apache2 conf file : ocsinventory-ocsreports.conf and z-ocsinventory-server.conf. So you need to adjust Apache2 configuration using or integrate this conf files.

Error500 is typical of bad mysql database identifiant in z-ocsinventory-server.conf as you can read MANY times on this forum (search lack !).
by (19.1k points)
edited by
0 votes
So you suggest me to uninstall deb packages and install from source?

Piviul
by (420 points)
0 votes
No, you have the choice : all tutorial, I read, use the source install, but you need install 'make' and others tools needed only for installation.

The main problem is the requirement and, due, some Perl libraries are not available as .deb package, you need install them with 'cpan'.

The second main problem is, as I write before, the apache2 conf file : a small knowledge of Apache is required ...

(I wrote a tutorial for Debian Bullseye, fully fonctionnal with OCS 2.10.0, with some instructions for enabling apache2 config.)

NB : I prefer renaming 'install.php' to .old
by (19.1k points)
edited by
0 votes
You need to check which URL you indicate when installing agent : you should use an url like Administrative Console : (it's not similar in the log you give !)

-  ip of server : inventory.csaricerche.com (fqdn)

- Server for Agent : http://inventory.csaricerche.com/ocsinventory

- Administrative Console : http://inventory.csaricerche.com/ocsreports

You could also install the agent on the server for the first test ...

NB : when you install OCS Server as .deb package, if you upgrade the server, may be you could upgrade OCS Server. This is a reason for installing using source : you can keep the version of OCS server you want. Also on 'deb.ocsinventory-ng.org' you have only the last version (for Server and Agent, and also only for last Debian) !
by (19.1k points)
edited by
0 votes
Many thanks for the prompt reply.

I've done a little step, the main problem was the password to access the mysql ocsweb database; looking into install.php client side, I get the correct one that is ocspassword and not ocs as it was written in my z-ocsinventory-server.conf default variables. Any way now all seems to work, the agent can connect to mysql db but the agent get this error collecting information to send to the server:

/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory

I forgot to install/configuring something else on the client?

Piviul
by (420 points)
0 votes
Many thanks to explain me the reasons for installing using source.

Have a greate day

Piviul
by (420 points)
0 votes
For Windows agent, you have the line 'Server=http://fqdn/ocsinventory'. If you need to change, you have to stop the service, and, as Administrator, edit the file %programdata%\OCS Inventory NG\Agent\ocsinventory.ini.

For Unix/Linux agent, some error message have no importance : with Debian 11, if you type 'cat /sys/firmware/dmi/tables/smbios_entry_point' you receive error even as root.

Error 500 is, mostly, bad mysql indentifiant in z-ocsinventory-server.conf, as you can read MANY times in this forum. (Why novice don't search before asking ?)
by (19.1k points)
0 votes
Thanks Jacquesh, Windows agent works flawlessy now but I have a doubt about the smbios_entry_point; root doesn't have access to read it, I have to change ownership/permissions on the file? Is it normal?

# ls -l /sys/firmware/dmi/tables/smbios_entry_point
-r-------- 1 nobody nogroup 31 Jul 18 06:01 /sys/firmware/dmi/tables/smbios_entry_point

As a novice people's member I tried to familiarize with the documentation on the wiki site then I searched on the forum but I didn't find anything concerning different password used in z-ocsinventory-server.conf and in the sql used to generate the ocsweb db. I'm not sure but the same credentials seems to be used even in /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php, is it correct? There are others configuration files where I have to change the password?

My best regards

Piviul
by (420 points)
0 votes
You are novice and want to change rights of file in kernel ? Are you sure ?

OCS Server is Inventory Server and Administrative Console.

- Inventory Server is Perl script based and sql identifier is in 'z-ocsinventory-server.conf'
- Administrative Console is Php Script based and sql identifier is in 'dbconfig.inc.php'

Remember there is only one sql identifier and the 2 services could be install on differents servers.

There is lot of informations in wiki and the solution is quite complex : there is lot of questions : is a certificate mandatory, how to create a certificate, how deploy packages, how upgrade agent how upgrade server, ...
by (19.1k points)
edited by
0 votes
Hi Jacquesh, similar to any other software I suppose even ocs inventory NG has his own complexity and IMHO it is normal for a new user write to the forum asking help, didn't you? You suggested me to run the command 'cat /sys/firmware/dmi/tables/smbios_entry_point' but I don't have permission, doesn't matter? What should be the content?
Furthermore I found that in the /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php seems are stored mysql access credentials so I ask if someone knows if I have to update the credentials even in this file; there are other files where are stored mysql access credentials?

Best regards

Piviul
by (420 points)
 
Powered by Question2Answer
...