Page 1 of 2

Trying to get Traps to work...

Posted: Thu Jan 31, 2013 4:00 pm
by jbennett
I am trying to get SNMP Traps to finally work on Nagios in our environment. I have configured SNMPTT and I currently have standard SNMP checks working correctly. I can use the iReasoning MIB Browser to send traps to the Nagios box successfully (as verified below).

From my snmptt.log:

Code: Select all

Thu Jan 31 14:40:19 2013 .1.3.6.1.6.3.1.1.5.2 Normal "Status Events" 10.100.29.181 - A warmStart trap signifies that the SNMP entity,
When I check for /var/log/snmptt/snmpttunknown.log, I do not have said file. I have configured it in the snmptt.ini file but it appears to have never been generated. Is this to assume that I've just not had any unknown traps come through?

Code: Select all

unknown_trap_log_file = /var/log/snmptt/snmpttunknown.log
Checking snmptt.debug, I only see the following:

Code: Select all

Sleeping for 5 seconds
Checking snmptthandler.debug, I see the following from the trap that I sent:

Code: Select all

SNMPTTHANDLER started: Thu Jan 31 14:40:19 2013

s = 1359664819, usec = 367522
s_pad = 1359664819, usec_pad = 367522

Data received:

<UNKNOWN>

UDP: [xxx.xxx.xxx.xxx]:1307

.1.3.6.1.2.1.1.3.0 0:0:00:00.00

.1.3.6.1.6.3.1.1.4.1.0 .1.3.6.1.6.3.1.1.5.2

.1.3.6.1.6.3.18.1.3.0 yyy.yyy.yyy.yyy

.1.3.6.1.6.3.18.1.4.0 "zzzzzzz"

.1.3.6.1.6.3.1.1.4.3.0 .0.0
From snmpttsystem.log:

Code: Select all

Thu Jan 31 08:42:23 2013 Reloading configuration file(s)
Thu Jan 31 08:42:23 2013 Loading /usr/share/snmp/mibs/processed_mibs/.txt
Thu Jan 31 08:42:23 2013 Could not open configuration file: /usr/share/snmp/mibs/processed_mibs/.txt
Thu Jan 31 08:42:23 2013 Loading /etc/snmp/snmptt.conf
Thu Jan 31 08:42:23 2013 Finished loading 1374 lines from /etc/snmp/snmptt.conf
Using the SNMP Traps wizard, I have created some services utilizing the xiwizard_snmptrap_service template. What check should be running in that template? I see check_dummy listed, but I don't ever see anything change with this.

Any help would be appreciated.

Re: Trying to get Traps to work...

Posted: Tue Feb 05, 2013 9:03 am
by jbennett
:)

Re: Trying to get Traps to work...

Posted: Wed Feb 06, 2013 12:03 pm
by scottwilkerson
Did you install snmptt with the directions in this file?
http://library.nagios.com/library/produ ... -nagios-xi

Also, lets create the unknown file just in case

Code: Select all

touch /var/log/snmptt/snmpttunknown.log

Re: Trying to get Traps to work...

Posted: Thu Feb 07, 2013 10:34 am
by jbennett
scottwilkerson wrote:Did you install snmptt with the directions in this file?
http://library.nagios.com/library/produ ... -nagios-xi
Yes. I followed it exactly.
Also, lets create the unknown file just in case

Code: Select all

touch /var/log/snmptt/snmpttunknown.log
That helped. I am now getting unknown traps in said file.

Re: Trying to get Traps to work...

Posted: Sun Feb 10, 2013 12:36 am
by scottwilkerson
jbennett wrote: That helped. I am now getting unknown traps in said file.
Excellent, now if you have the mibs you will need to add them with the following procedure from page 2 of the document
Installing MIBs
You may need to configure SNMPTT on the Nagios XI server to use the MIBs your remote devices are using. This may mean having to
load extra MIBs into the /usr/share/snmp/mibs/ directory on the Nagios XI server. This can be done through the command line or also
through the XI interface Admin -> Manage MIBs.

You will then also have to run the following command to import each new MIB (replace <PathToNewMIB> with the path to the MIB you
want to import):

Code: Select all

# addmib <PathToNewMIB>

Re: Trying to get Traps to work...

Posted: Mon Feb 11, 2013 8:40 am
by jbennett
I have already done that as well...I have verified that they were added to the snmptt.conf file too.

Re: Trying to get Traps to work...

Posted: Mon Feb 11, 2013 3:05 pm
by jbennett
I figured I would add that I have been checking the log files again today and I have nothing new showing up. I have tried restarting snmptt as well.

When I send a trap using the iReasoning Trap Sender, it will show up in the snmptt.log file. However, when I check the device I sent it as, It still just shows the following: OK: Trap reset on Tue Feb 5 12:52:51 CST 2013

Re: Trying to get Traps to work...

Posted: Mon Feb 11, 2013 3:43 pm
by mikew
One thing you might check is hostname. I have seen where the host is configured with a hostname like server for example but the DNS entry is a FQDN like server.example.com. When the trap is sent it is sent from "server" and when Nagios sees it, Nagios think the host is "server" but the entry in Nagios for the host is server.example.com and so the trap never gets placed in the web interface. The solution is to add a host in Nagios called server.

Re: Trying to get Traps to work...

Posted: Mon Feb 11, 2013 4:01 pm
by jbennett
mikew wrote:One thing you might check is hostname. I have seen where the host is configured with a hostname like server for example but the DNS entry is a FQDN like server.example.com. When the trap is sent it is sent from "server" and when Nagios sees it, Nagios think the host is "server" but the entry in Nagios for the host is server.example.com and so the trap never gets placed in the web interface. The solution is to add a host in Nagios called server.
Unfortunately, these traps aren't coming from a server, but rather from hardware (PDU & UPS). I would assume the hostname at that point would actually just be the IP address, no?

I should note that I am able to query SNMP via Nagios to these same devices already. It just seems that traps themselves will not populate.

Re: Trying to get Traps to work...

Posted: Mon Feb 11, 2013 4:25 pm
by abrist
Scott's out of town, so I will attempt to continue your support.

Were the mibs populated in /usr/share/snmp/mibs/ after import/addmib?