Command works on CLI but not in SNMPTT event handler

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gavnor
Posts: 11
Joined: Thu Jan 10, 2019 10:00 pm

Re: Command works on CLI but not in SNMPTT event handler

Post by gavnor »

I apologize for the delayed response. This did resolve my issue. Traps are now being received and processed.

If I don't have reverse-dns entries for my servers, is there any way to tie an IP back to a host name? It seems right now that the only way to receive traps for my hosts without reverse dns entries is to name them by IP.

I also don't like that it drops traps from unknown hosts. I'd like traps from unknown hosts to go to a log, at the very least, if not a generic "Unknown" host. I have a few ideas but I'm curious if there's a standard or any common methods for handling these.

Thoughts?
swolf

Re: Command works on CLI but not in SNMPTT event handler

Post by swolf »

I'm glad to hear that your issues are resolved.

There isn't a direct way to link an IP Address to a nagios hostname in the SNMP Trap Interface. However, you may have some success by tweaking the exact variable you send.

The default trap definition has "Host Name" set to $aR, which is the IP address. You could try using $r or $R instead, which would be the associated hostname (click the "?" next to the EXEC line to see all of the available macros). If the hostnames aren't an exact match, you could then edit /etc/hosts on your XI server to get the DNS to match properly. It's a bit of a hack but I think it would work for your purposes.

Data from "unknown" traps should go to a couple of places:
-For unrecognized OIDs, they go to a log file (/var/log/snmptt/snmpttunknown.log). If you want to see the file's contents from the web interface, you can go to "Advanced" -> "Show Unknown Trap Log".
-For unrecognized hosts, they should still get sorted into the 'normal' trap log (/var/log/snmptt/snmptt.log). We don't currently have a way to view this from the web interface.
-Also, if your trap definitions include the Passive Service Setup and you receive a trap from an unknown host, you can see these in Admin -> Monitoring Config -> Unconfigured Objects. This doesn't show every single event, but it does show each host, and it includes a way to easily turn those into hosts/services within Nagios.
Locked