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.9.1 available

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

Problems Ubuntu agent 2.8.1 to OCS server

Hi

I have the following problem. I have installed the agent on some Ubuntu machines that I need to register on the OCS Server. I have followed the instructions on how to install the agent in version 2.8.1 on an Ubuntu machine. I have followed the steps indicated to configure the agent when you execute "make install", but in the log file I see the following output:
[Tue Apr 27 10:58:34 2021][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.8.1
[Tue Apr 27 10:58:34 2021][debug] Log system initialised (File)
[Tue Apr 27 10:58:34 2021][debug] --scan-homedirs missing. Don't scan user directories
[Tue Apr 27 10:58:34 2021][debug] accountconfig file: `/var/lib/ocsinventory-agent/http:__ocsinventariocauce.medusa.gobiernodecanarias.net/ocsinv.conf doesn't exist. I create an empty one
[Tue Apr 27 10:58:34 2021][debug] ocsinv.conf updated successfully
[Tue Apr 27 10:58:34 2021][debug] ocsinv.conf updated successfully
[Tue Apr 27 10:58:34 2021][debug] Accountinfo file: /var/lib/ocsinventory-agent/http:__ocsinventariocauce.medusa.gobiernodecanarias.net/ocsinv.adm
[Tue Apr 27 10:58:34 2021][info] Accountinfo file doesn't exist. I create an empty one.
[Tue Apr 27 10:58:34 2021][debug] Invalid parameter while writing accountinfo file
[Tue Apr 27 10:58:34 2021][debug] Account info updated successfully
[Tue Apr 27 10:58:34 2021][debug] OCS Agent initialised
[Tue Apr 27 10:58:34 2021][debug] Turns hooks on for /etc/ocsinventory/modules.conf
[Tue Apr 27 10:58:34 2021][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.8.1
[Tue Apr 27 10:58:34 2021][debug] Log system initialised (File)
[Tue Apr 27 10:58:34 2021][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.8.1
[Tue Apr 27 10:58:34 2021][debug] Log system initialised (File)
[Tue Apr 27 10:58:34 2021][debug] Calling handlers : `start_handler'
[Tue Apr 27 10:58:34 2021][debug] [download] Calling download_start_handler
[Tue Apr 27 10:58:34 2021][debug]  - LWP loaded
[Tue Apr 27 10:58:34 2021][debug]  - LWP::Protocol::https loaded
[Tue Apr 27 10:58:34 2021][debug] [snmpscan] Calling snmp_start_handler
[Tue Apr 27 10:58:34 2021][debug]  - Net::SNMP loaded
[Tue Apr 27 10:58:34 2021][debug] Compress::Zlib is available.
[Tue Apr 27 10:58:34 2021][debug] Calling handlers : `prolog_writer'
[Tue Apr 27 10:58:34 2021][debug] sending XML
[Tue Apr 27 10:58:34 2021][debug] sending: <?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
  <DEVICEID>tfvs0727-2021-04-27-10-58-34</DEVICEID>
  <QUERY>PROLOG</QUERY>
</REQUEST>
[Tue Apr 27 11:01:34 2021][error] Cannot establish communication : 500 read timeout

 

The configuration file has the following values:

logfile = / var / log / ocs-inventory-agent.log

snmpretry = 2

tag = _Ubuntu_servers

server = http: //ocsinventario.mydomain.com

snmptimeout = 3

basevardir = / var / lib / ocsinventory-agent

debug = 1

snmp = 1

I have tried to change the value of the "server", even putting the path where I have the OCS Server installation which would be in the path http://ocsinventario.mydomain.com/ocsreports, but any change gives me the error that you see above :

[Tue Apr 27 11:01:34 2021] [error] Cannot establish communication: 500 read timeout

From Ubuntu machines I can reach the OCS server, by pinging and by telnet to port 80.

What could be failing to not contact Ubuntu machines in OCS Server version 2.8? Best regards.

in OCS Inventory NG agent for Unix by (180 points)

5 Answers

0 votes
Hi,

What errors have you in /var/log/apache2/error.log file ?

Best Regards
by (86.3k points)
0 votes

Thanks for the quick answer.

When I manually run the OCS agent to contact the server using the following command: root @ tfvs0727: /etc/cron.d# / usr / local / bin / ocsinventory-agent --lazy

On the server side of OCS in Apache's error_log it shows nothing. I check the output of /var/log/httpd/access.log from the OCS server and I see the following request from the IP of the Ubuntu machine:

172.16.255.47 - - [Apr / 27/2021: 12: 15: 21 +0100] "POST / ocsinventory HTTP / 1.1" 200 234 "-" "OCS-NG_unified_unix_agent_v2.8.1"

So a correct request is arriving and it connects correctly, but after a few minutes it gives the message in the OCS agent log [Tue Apr 27 12:18:21 2021] [error] Cannot establish communication: 500 read timeout [Tue Apr 27 12:18:21 2021] [info] No previous PROLOG_FREQ found - using fallback delay (3600 seconds)

Regards again

by (180 points)
0 votes

As you wrote:

"What could be failing to not contact Ubuntu machines in OCS Server version 2.8? Best regards."

and Agent is:

"Tue Apr 27 10:58:34 2021][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.8.1"

If it's true this is the problem. Try upgrade server od use Agent that is =<Server Version. I had this issue on my first install so now it's the first that I check ;) .

by (2.9k points)
+1 vote
when agent version is bigger as server version an 400 error is generated. This is not the case here.

The url is not correct => server=http://ocsinventario.mydomain.com

You must have server = http://ocsinventario.mydomain.com/ocsinventory
by (86.3k points)
0 votes

frankb is wright, this config will not work, server in the agent side must be:

http://ocsinventario.mydomain.com/ocsinventory

or 

http://your_server_ip/ocsinventory

of course if you doesn't configure apache in non standard way  :)

by (2.9k points)
 
Powered by Question2Answer
...