SNMP Traps testing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

SNMP Traps testing

Post by agustin.roca »

Hi guys,

Having issues trying to configure snmptraps.

I added with the wizard snmptraps for an existing host.

I followed the pdf configuring snmptt and all.

I send a test trap like:

snmptrap -v 1 -c public 10.0.0.1 .1.3.6.1.6.3 "" 0 0 coldStart.0

I received it in the logs of my nagios xi ok

==> snmptt/snmptt.log <==
Wed Aug 12 14:45:48 2015 .1.3.6.1.6.3.1.1.5.1 Critical "Status Events" name_of_host - Device reinitialized (coldStart)


How can i see if nagios is processing or seeing this?

Thanks!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SNMP Traps testing

Post by tgriep »

In the Nagios XI GUI, go to Admin > Unconfigured Objects.
The first time a trap is sent to the XI system, this is where they are located.
Then in this screen, you need to configure the trap which sets it up to be monitored. After that, you can see the traps on the Home > Service Details screen.
Be sure to check out our Knowledgebase for helpful articles and solutions!
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Re: SNMP Traps testing

Post by agustin.roca »

Hi tgriep!

Already checked and there are no unconfigured Objects. Perhaps someone cleaned it up? If it was cleaned, how can i generate it again?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: SNMP Traps testing

Post by ssax »

This is most likely related to the default snmptt entries (they get set when it gets installed) not being setup for Nagios.

Remove the coldStart, warmStart, and authenticationFailure traps from your /etc/snmp/snmptt.conf.

Then run this command (this will process the mibs and make them work with Nagios):

Code: Select all

addmib /usr/share/snmp/mibs/SNMPv2-MIB.txt
Then restart snmptt and try again:

Code: Select all

service snmptt restart
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Re: SNMP Traps testing

Post by agustin.roca »

Great!

I can see it now! thanks! Now i see that the hostname from the snmptra sent is different as the one i am monitoring. the one sent is short and the host created is the FQDN.

I see it now in the Unconfigured objects. WIll try to see how to send the fqdn nome in the test trap now! but i can see it working and the logs in nagios show it!

Thanks!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: SNMP Traps testing

Post by ssax »

You might want to check to see if these setting in your /etc/snmp/snmptt.ini can be useful to you:

Code: Select all

# SNMPTRAPD passes the IP address of device sending the trap, and the IP address of the
# actual SNMP agent.  These addresses could differ if the trap was sent on behalf of another
# device (relay, proxy etc).
# If DNS is enabled, the agent IP address is converted to a host name using a DNS lookup
# (which includes the local hosts file, depending on how the OS is configured).  This name
# will be used for: NODES entry matches, hostname field in logged traps (file / database),
# and the $A variable.  Host names on the NODES line will be resolved and the IP address
# will then be used for comparing.
# Set to 0 to disable DNS resolution
# Set to 1 to enable DNS resolution
dns_enable = 1

# Set to 0 to enable the use of FQDN (Fully Qualified Domain Names).  If a host name is
# passed to SNMPTT that contains a domain name, it will not be altered in any way by
# SNMPTT.  This also affects resolve_value_ip_addresses.
# Set to 1 to have SNMPTT strip the domain name from the host name passed to it.  For
# example, server01.domain.com would be changed to server01
# Set to 2 to have SNMPTT strip the domain name from the host name passed to it
# based on the list of domains in strip_domain_list
strip_domain = 1
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Re: SNMP Traps testing

Post by agustin.roca »

Great! Thanks. That did it!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: SNMP Traps testing

Post by ssax »

Great, I'm glad that's working for you, is it ok if we mark this as resolved and lock the topic?
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Re: SNMP Traps testing

Post by agustin.roca »

Yes of course!
Locked