My Nagios receives traps handled by SNMPTT.
I'd like to send the traps to different nagios-services based on the text of the trap.
In order to perform this feature, I manage the text of the trap using a PREEXEC command (SNMPTT) and an external script (/home/user/check_trap)
Code: Select all
PREEXEC /home/user/check_trap "trap text" # --> $p1
EXEC /usr/lib/nagios/plugins/eventhandlers/submit_check_result $r $p1 1 "error"
There is a way to do not use an external script but simplest a SNMPTT command an a external file that will contains the same rules of the script to determine the right service?
The external file may be like this:
Code: Select all
service1 192.168.0.5
service2 192.168.0.7
service3 192.168.0.9
Code: Select all
EXEC /usr/lib/nagios/plugins/eventhandlers/submit_check_result host service2 1 "error"
marco