snmp trap sender component

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ss6396
Posts: 35
Joined: Wed Mar 19, 2014 11:26 am

snmp trap sender component

Post by ss6396 »

Short of seeing a trap at the destination, is there a way to verify snmp traps sent by enabling the snmp trap sender component are actually being sent? Are they logged somewhere? Also, what would it take for sent traps to also show up in the notification log?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: snmp trap sender component

Post by slansing »

Traps should be being logged already check the following directory:

Code: Select all

/var/log/snmptt/
As far as a specific trap sender log, I'll need to look into that, not sure if sent traps show up in those logs by default, or at all.
ss6396
Posts: 35
Joined: Wed Mar 19, 2014 11:26 am

Re: snmp trap sender component

Post by ss6396 »

I'm fairly certain /var/log/snmptt.log is for incoming traps. In any event, the trap I know that was sent is not in that log.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: snmp trap sender component

Post by sreinhardt »

You are correct, snmptt.log is for KNOWN traps, ones that are correctly interpreted by snmptt and snmptrapd. snmpttunknown.log is for traps that are UNKNOWN and are not being interpreted correctly. Are you seeing that trap in the unknown log? I have not been able to find an actual log file for the event handler, however you can run:

Code: Select all

tcpdump -i eth0 port 162
This will show outgoing and incoming snmptraps.
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.
ss6396
Posts: 35
Joined: Wed Mar 19, 2014 11:26 am

Re: snmp trap sender component

Post by ss6396 »

Yes, the sent traps were in the snmpttunknown.log, that is how I knew traps were being sent because I set the destination back to itself. I know the snmpttunknown.log only displayed incoming traps because the sent traps did not show up there until I turned on the trap receiving component.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: snmp trap sender component

Post by sreinhardt »

Most likely, we just need to add the nagios mibs to your snmptt.conf. Running the following commands should do it. Once it does, please check snmptt.log for new entries from nagios.

Code: Select all

addmib /usr/local/nagiosxi/html/includes/components/snmptrapsender/mibs/NAGIOS-ROOT-MIB.txt
addmib /usr/local/nagiosxi/html/includes/components/snmptrapsender/mibs/NAGIOS-NOTIFY-MIB.txt
service snmptt restart; service snmptrapd restart
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.
ss6396
Posts: 35
Joined: Wed Mar 19, 2014 11:26 am

Re: snmp trap sender component

Post by ss6396 »

sreinhardt wrote:Most likely, we just need to add the nagios mibs to your snmptt.conf. Running the following commands should do it. Once it does, please check snmptt.log for new entries from nagios.

Code: Select all

addmib /usr/local/nagiosxi/html/includes/components/snmptrapsender/mibs/NAGIOS-ROOT-MIB.txt
addmib /usr/local/nagiosxi/html/includes/components/snmptrapsender/mibs/NAGIOS-NOTIFY-MIB.txt
service snmptt restart; service snmptrapd restart
Thanks but I'm not actually concerned about receiving or processing the incoming traps. I'm only concerned about proof that the outgoing traps were generated and sent. We will eventually be sending those traps to a netcool objectserver and the ability to verify a trap was sent will be important. It would be most helpful if outgoing traps were logged somewhere.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: snmp trap sender component

Post by sreinhardt »

Well, them showing in snmpttunknown.log is proof that they were received by snmptrapd and processed by snmptt, and therefore sent by snmptrap sending component. If you wish to have additional logging or something of that nature, I would ask that you submit a feature request to tracker.nagios.com so that you may view its progress. Otherwise you likely can look in the nagios event log for times when global event handlers were executed.
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