Fwding SNMP Traps
I use mod_gearman to distribute my checks. One of the workers is behind a firewall. Instead of punching a hole in the fw for all the devices to be able to send traps back to the primary Nagios server, we have them send them to the worker and it then forwards them to Nagios.
snmptrapd.conf on the worker:
forward default x.x.x.x #x.x.x.x is destination IP for the traps
Setting to change on Nagios server:
I can’t recall. I’m a bad admin and forgot to write it down somewhere!
There is a setting you MUST change or all traps will look as though they came from the worker instead of the originating device!
I believe that setting was changed in snmptt.conf. I think after all the lines calling snmptraphandling.py that I changed the first variable being sent to “$r”
This is what I received from a nagios dev:
The solution for me was to change the “$r” to “$A” which is:
$A – Trap agent host name (see requirements from the SNMPTT DNS link below)
Or if they wanted IP:
$aA – Trap agent IP address