I have a problem with SNMP function and I would need help to know if there's a cert problem or a server installation mistake. I read that we need to configure ocsinventory-agent.cfg this way to make SNMP function works:
basevardir=/var/lib/ocsinventory-agent
debug=1
download=1
ca=/etc/pki/CA/certs/cacert.pem
tag=OCS Server
server=https://10.194.97.125/ocsinventory
logfile=/var/log/ocsinventory.log
I have the next log when ocsinventory-agent.cfg is configured this way:
[Tue Sep 20 14:32:04 2016][debug] [download] Calling download_start_handler
[Tue Sep 20 14:32:04 2016][debug] - LWP loaded
[Tue Sep 20 14:32:04 2016][debug] - LWP::Protocol::https loaded
[Tue Sep 20 14:32:04 2016][debug] Compress::Zlib is available.
[Tue Sep 20 14:32:04 2016][debug] Calling handlers : `prolog_writer'
[Tue Sep 20 14:32:04 2016][debug] sending XML
[Tue Sep 20 14:32:04 2016][debug] sending: <?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
<DEVICEID>ocsinventory-ng-2016-09-20-12-23-35</DEVICEID>
<QUERY>PROLOG</QUERY>
</REQUEST>
[Tue Sep 20 14:32:04 2016][error] Cannot establish communication : 500 Can't connect to 10.194.97.125:443
Otherwise, when we configure the ocsinventory-agent.cfg file with server=http://10.194.97.125/ocsinventory ( without https ), we get this log:
<RESPONSE>NO_ACCOUNT_UPDATE</RESPONSE>
</REPLY>
';
[Tue Sep 20 14:37:59 2016][debug] =END=SERVER RET======
[Tue Sep 20 14:37:59 2016][debug] Calling handlers : `end_handler'
[Tue Sep 20 14:37:59 2016][debug] [snmp] Calling snmp_end_handler
[Tue Sep 20 14:37:59 2016][debug] [download] Calling download_end_handler
[Tue Sep 20 14:37:59 2016][info] [download] Beginning work. I am 3245.
[Tue Sep 20 14:37:59 2016][info] [download] No more package to download.
[Tue Sep 20 14:37:59 2016][debug] [download] End of work...
So the agent is reaching the server, but obviously can't execute the SNMP function because the current ocsinventory-agent.cfg configuration.
--------------------------------------------------
Said that, why is there an 500 connection error when we configure ocsinventory-agent.cfg file with server=https://10.194.97.125/ocsinventory, if in fact the server is configure this way ?