Page 1 of 1

SNMP Traps not working

Posted: Fri Aug 02, 2013 9:17 am
by mzoumboulakis
Hello,

I'm in the process of evaluating Nagios XI (2012R2.2 running on CentOS 6.4 i686) and I'm having trouble integrating the SNMP Traps functionality.
I've followed this document http://assets.nagios.com/downloads/nagi ... ith_XI.pdf and the Nagios XI server receives traps, SNMPTT does its bit (the traps are processed according to /var/log/snmptt/snmptt.log), the hostname matches exactly the hostname of the monitored hosts in NagiosXI, BUT, the service status in Nagios XI is always "Waiting for traps..."

I have some familiarity with processing (successfully) traps in Nagios Core - in Nagios XI, the documentation seems to be missing what program should be executed when a trap is received i.e. the EXEC part of snmptt.conf. In Nagios Core we used to execute /usr/local/nagios/libexec/eventhandlers/submit_check_result but this doesn't exist in Nagios XI.
Can you please tell me if I'm missing something obvious?

Thanks

Re: SNMP Traps not working

Posted: Fri Aug 02, 2013 10:24 am
by scottwilkerson
If you installed the rpm from the document it should have put in a script /usr/local/bin/snmptraphandling.py

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py ...

Re: SNMP Traps not working

Posted: Fri Aug 02, 2013 11:20 am
by mzoumboulakis
Thanks for that, it's all working now. The system had its own snmptt and I didn't read the doc carefully enough to note that Nagios supplied a different one.

IMHO, the document can be improved by adding a couple of lines to say that you need to translate your MIBs with a command such as:

Code: Select all

snmpttconvertmib --in=/usr/share/snmp/mibs/cpqhlth.mib --out=/etc/snmp/compaq.conf --exec='/usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*"'
And then adding the contents of the .conf file to /etc/snmp/snmptt.conf.

And you need to configure your snmptrapd by adding the -On option in /etc/init.d/snmptrapd.

Thanks

Re: SNMP Traps not working

Posted: Fri Aug 02, 2013 1:58 pm
by lmiltchev
I'm glad it's working now. Thanks for the tips on improving our docs!