SNMP Traps not working for all hosts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
corey.rando
Posts: 2
Joined: Mon Dec 23, 2013 10:41 am

SNMP Traps not working for all hosts

Post by corey.rando »

Hello,

So, I'm trying to configure SNMP traps and I have it mostly working. I have all my hosts added into Nagios and when I generate test alerts from all my hosts, only some of them get entered into Nagios. After a little digging around and tailing the snmptt.log.debug file I see that on the hosts that work, snmptraphandling.py gets called on them. On the snmp alerts that don't show up in Nagios, snmptraphandling.py is NOT getting called when the snmp message is received. From looking at all my configuration options, I don't see any difference in the configuration of the hosts. Does anyone have any ideas?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMP Traps not working for all hosts

Post by sreinhardt »

Are the ones that are not passing to nagios, also using a different OID from the ones that are? Generally I would guess that the ones that are not working have 1 of 2 issues. Either the snmptt.conf file does not contain the oid and correct configuration for that trap and are going into the snmptt_unknown.log file, or the snmptt.conf file has an entry without an exec line for that portion and thus it is not calling it but the trap is still correctly passing to snmptt.log because it is a known oid. Which seems to be the case for you? Certainly feel free to post your snmptt.log, snmptt_unknown.log and snmptt.conf or pm them to me and I can take a look with you.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
corey.rando
Posts: 2
Joined: Mon Dec 23, 2013 10:41 am

Re: SNMP Traps not working for all hosts

Post by corey.rando »

sreinhardt wrote:Are the ones that are not passing to nagios, also using a different OID from the ones that are? Generally I would guess that the ones that are not working have 1 of 2 issues. Either the snmptt.conf file does not contain the oid and correct configuration for that trap and are going into the snmptt_unknown.log file, or the snmptt.conf file has an entry without an exec line for that portion and thus it is not calling it but the trap is still correctly passing to snmptt.log because it is a known oid. Which seems to be the case for you? Certainly feel free to post your snmptt.log, snmptt_unknown.log and snmptt.conf or pm them to me and I can take a look with you.
As far as I can tell, The snmptt.conf file seems contain the correct OID and the alerts. I can verify that the alerts not being passed into the snmptt_unknown.log. I spent awhile fighting the mibconverter tool to get them correctly loaded.

As far as the exec line, I don't have any in my snmptt.conf. I'm not exactly sure where the EXEC command in the working trap comes from and why it only does it for some traps.

It looks like the following...

EXEC line(s)
EXEC command: /usr/local/bin/snmptraphandling.py "dell.cmc" "SNMP Traps" "INFORMATIONAL" "1387811667" "" "CMC Test Trap: CMC Test Trap"

Do you know what generates that and how it decides what traps it appends it to?+

Thank you!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMP Traps not working for all hosts

Post by sreinhardt »

Well if you are using our documentation, yes it's for XI but 98% applies to core, you would use the addmib tool. This will add the correct oids and values as well as the exec line. I think it would be easiest if you sent me a tar from the commands below.

Code: Select all

mkdir /tmp/snmptt
cp /etc/snmp/snmptt.conf /tmp/snmptt/
cp /var/log/snmptt/{snmptt.log,snmptt_unknown.log} /tmp/snmptt/
cd /tmp
tar czf snmptt.tar.gz ./snmptt
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked