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)

the agent is running on the same server Ocs.

the permissions on the file are correct.

strangely I can not find a log file agent.

/var/log/ and /etc/ocsinventory-agent there is no log file.

the only log file this is /var/log/ocsinventory-server/activity.log, here I have this error
error: agent must communicate using https to be Able to get SNMP communities (Affects only OCS unix agent

wanting to uninstall the agent, there is a unistal.PL?

look on the /etc/ocsinventory-agent/ocsinventory-agent.cfg

you must have a line

logfile=/xxx/xxx/xxx/xxx

it's the path for the log.

For snmp scan you must be in https and put certificats.

in the configuration file path is:
logfile = / etc / ocsinventory-agent

unfortunately in this path I have no log file

ssl is enabled on the server and I get no errors https: // myserver

wanting to uninstall the agent and then reinstall it as I proceed? there is no unistall.pl unfortunately.

these are the files related to ocs server and agent on my server:

/usr/local/bin/ocsinventory-agent
/usr/local/share/man/man3/Ocsinventory::Agent::Modules::Databases::Oracle::Instances.3pm
/usr/local/share/man/man3/Ocsinventory::Agent::Modules::Apache::Vhosts::Common.3pm
/usr/local/share/man/man3/Ocsinventory::Agent::XML::Inventory.3pm
/usr/local/share/man/man3/Ocsinventory::Agent::Common.3pm
/usr/local/share/man/man1/ocsinventory-agent.1p
/usr/local/share/perl/5.14.2/Apache/Ocsinventory.pm
/var/www/glpi/plugins/ocsinventoryng/pics/ocsinventoryng.png
/etc/ocsinventory-agent/ocsinventory-agent.cfg
/etc/cron.d/ocsinventory-agent
/etc/apache2/conf.d/ocsinventory-reports.conf
/etc/logrotate.d/ocsinventory-server
/usr/local/share/perl/5.14.2/Ocsinventory
/usr/local/share/perl/5.14.2/Apache/Ocsinventory
/usr/local/lib/perl/5.14.2/auto/Ocsinventory
/usr/local/lib/perl/5.14.2/auto/Apache/Ocsinventory
/usr/share/ocsinventory-reports
/var/www/glpi/plugins/ocsinventoryng
/var/log/ocsinventory-server
/var/lib/ocsinventory-reports
/var/lib/ocsinventory-agent
/etc/ocsinventory-agent
/etc/ocsinventory-server
/etc/ocsinventory-server/perl/Apache/Ocsinventory

 

 

For the log, you must give a file name and no a directory name.

You must not put a log in /etc

I am looking for the file is:
find / -type f -iname "ocsinven*"
what's wrong?

as suggested I changed the path of the log file
Logfile =/var/log/ocsinventory-agent

but still the file is not created, the permissions for the folder are 755 for root groups

can you do a

ls -l /var/log/ocsinventory-agent

Which user are you using for execute the ocs agent?

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