Page 1 of 1
SNMP Traps testing
Posted: Wed Aug 12, 2015 12:58 pm
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!
Re: SNMP Traps testing
Posted: Wed Aug 12, 2015 1:14 pm
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.
Re: SNMP Traps testing
Posted: Wed Aug 12, 2015 1:42 pm
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?
Re: SNMP Traps testing
Posted: Wed Aug 12, 2015 1:51 pm
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:
Re: SNMP Traps testing
Posted: Wed Aug 12, 2015 2:17 pm
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!
Re: SNMP Traps testing
Posted: Wed Aug 12, 2015 4:00 pm
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
Re: SNMP Traps testing
Posted: Thu Aug 13, 2015 3:01 pm
by agustin.roca
Great! Thanks. That did it!
Re: SNMP Traps testing
Posted: Thu Aug 13, 2015 3:24 pm
by ssax
Great, I'm glad that's working for you, is it ok if we mark this as resolved and lock the topic?
Re: SNMP Traps testing
Posted: Wed Sep 09, 2015 5:12 pm
by agustin.roca
Yes of course!