Page 1 of 1
SNMPTrap Service Setup
Posted: Thu Oct 17, 2019 12:23 pm
by dslaughter
I've read the snmp docs from nagios but I'm still have a question. How do I configure services? Does each host that sends a trap have a snmptrap service defined or only the trap receiver?
Re: SNMPTrap Service Setup
Posted: Thu Oct 17, 2019 2:41 pm
by cdienger
Each host that sends in snmp traps should have their own passive services that handle the snmp traps. You can configure multiple traps to send to the same passive service, but most of the time you'll want to have snmp traps send to their own passive service.
Have you seen
https://www.youtube.com/watch?v=3cpMf5Tl04Y? It goes through adding services.
Re: SNMPTrap Service Setup
Posted: Thu Oct 17, 2019 3:40 pm
by dslaughter
Thanks for the video. It was pretty good but I'm still not 100% clear on service setup.
For every host that SENDS traps should have a single passive snmp trap service configured.
The trap RECEIVER is not required to have a passive snmp trap service configured unless the host is also sending traps. My receiver is the nagiosxi server itself.
Is that correct?
Re: SNMPTrap Service Setup
Posted: Fri Oct 18, 2019 9:45 am
by cdienger
The trap RECEIVER is not required to have a passive snmp trap service configured unless the host is also sending traps.
Correct.
Code: Select all
For every host that SENDS traps should have a single passive snmp trap service configured.
The receiver should be configured with
at least one passive service. The receiver
can accept all traps on a single passive service, but if there are a lot of different traps it isn't ideal. For example, a sender may send a trap for CPU usage and another trap for disk usage. With a single trap setup for both, if a critical trap comes in for the CPU and then a warning trap comes in for the disk usage, the Nagios system will display the status of the disk usage trap(the last one to come in). It makes more sense to have two passive checks - one for the CPU trap and the other for disk usage. Traps are usually differentiated with with OIDs which then can have their own passive service. You can also use advanced criteria to dictate if an incoming trap triggers a passive service on the XI system. For example, the MATCH operator. See
http://snmptt.sourceforge.net/docs/snmp ... ile-format for details on that, but I'd focus on setting services passed on trap OIDs first and only add advanced config if necessary.
Re: SNMPTrap Service Setup
Posted: Mon Oct 21, 2019 7:54 am
by dslaughter
Is it possible to have a default service on the receiver to log all traps that have not been defined so I don't miss any traps? I tried to set this up but couldn't get it to work.
Re: SNMPTrap Service Setup
Posted: Mon Oct 21, 2019 2:32 pm
by mbellerue
There are a couple of places where traps can get trapped.
If the system doesn't have a valid OID for the trap, the trap will get logged in /var/log/snmptt/snmpttunknown.log. You could monitor this file by datetime since modification, or one of the check_log plugins.
If the system has a valid OID for the trap, but Nagios doesn't have a host/service configured for it, it will get logged in /usr/local/nagiosxi/var/corelog.newobjects. You can use similar methods to monitor this file.
Re: SNMPTrap Service Setup
Posted: Tue Oct 22, 2019 2:13 pm
by dslaughter
ok, thanks for the info. Go ahead and lock this. I'm going to start watching that log. If I have any problems I'll start a new thread.