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

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

Configuring SNMP discovery

I followed the wiki to configure SNMP but it still does not work:

http://wiki.ocsinventory-ng.org/index.php/Documentation:SNMP


If I try to run the agent in debug mode I get this error:

Can't open `/etc/ocsinventory-agent'

in OCS Inventory NG server for Unix by (380 points)

3 Answers

0 votes
How do you have install your agent ? On wich OS (if linux wich distribution) ? Wich configuration have you give in the postinstall ?
by (21.7k points)

version agent OCS-NG_unified_unix_agent_v2.1.1

version ocs server 2.1.1

installed on the server Ubuntu 13.04 raring

ocsinventory-agent.cfg:

basevardir=/var/lib/ocsinventory-agent
ssl=0
debug=1
ca=/etc/ocsinventory-agent
tag=server
server=http://localhost/ocsinventory
logfile=/etc/ocsinventory-agent

I do not remember having done special configuration after installation of the agent, I never worried about this because the server side everything works fine.

Agent on unix server I only have this

+1 vote
Try with other log file, logfile=/var/log/ocsinventory-agent.log.

Is the agent run in the server? if isn't the server option should be diferent
by (1.7k points)
0 votes
look if the directory /etc/ocsinventory-agent is in 755 for security and look if you execute the agent whith root.
by (2.1k points)
root@ubuntu:~# ls -l /var/log/ocsinventory-agent
total 0

root@ubuntu:~# ocsinventory-agent
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
Can't open `/var/log/ocsinventory-agent'
etc etc etc

it's what i said, you have parameter the name of the directory so itt can't work

put a line like

Logfile =/var/log/ocsinventory-agent/ocsinventory-agent.log

thanks for your patience had until now.

There were two serious errors in the configuration file:

A) the variable logfile was not correct;
b) the server variable must have an address https and not http.

now I have no more errors the agent execution and the log file is written.

Here is the result of the log file:
[Thu Sep 18 15:37:33 2014][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.1.1
[Thu Sep 18 15:37:33 2014][debug] Log system initialised (File)
[Thu Sep 18 15:37:33 2014][debug] --scan-homedirs missing. Don't scan user directories
[Thu Sep 18 15:37:33 2014][debug] Accountinfo file: /var/lib/ocsinventory-agent/https:__localhost_ocsinventory/ocsinv.adm
[Thu Sep 18 15:37:33 2014][debug] OCS Agent initialised
[Thu Sep 18 15:37:33 2014][debug] Turns hooks on for /etc/ocsinventory-agent/modules.conf
[Thu Sep 18 15:37:33 2014][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.1.1
[Thu Sep 18 15:37:33 2014][debug] Log system initialised (File)
[Thu Sep 18 15:37:33 2014][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.1.1
[Thu Sep 18 15:37:33 2014][debug] Log system initialised (File)
[Thu Sep 18 15:37:33 2014][debug] Calling handlers : `start_handler'
[Thu Sep 18 15:37:33 2014][debug] [snmp] Calling snmp_start_handler
[Thu Sep 18 15:37:33 2014][debug]  - Net::SNMP loaded
[Thu Sep 18 15:37:33 2014][debug] [download] Calling download_start_handler
[Thu Sep 18 15:37:33 2014][debug]  - LWP loaded
[Thu Sep 18 15:37:33 2014][debug]  - LWP::Protocol::https loaded
[Thu Sep 18 15:37:33 2014][debug] Compress::Zlib is available.
[Thu Sep 18 15:37:33 2014][debug] Calling handlers : `prolog_writer'
[Thu Sep 18 15:37:33 2014][debug] sending XML
[Thu Sep 18 15:37:33 2014][debug] sending: <?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
  <DEVICEID>ubuntu-2014-09-18-15-05-39</DEVICEID>
  <QUERY>PROLOG</QUERY>
</REQUEST>
[Thu Sep 18 15:37:33 2014][error] Cannot establish communication : 500 SSL_ca_file /etc/ocsinventory-agent does not exist
There is allready a topic on the certificat.
thanks for everything, I will follow that thread !

 

 
Powered by Question2Answer
...