PDA

View Full Version : /libexec/traps/TrapHandler not sending external commands during traps


nebj00la
10-26-2007, 07:58 AM
Hi,

Recently my traps stopped being sent as external commands to the nagios.cmd file. The snmptt.log file shows the traps are being received, yet they never get sent as external commands.

In order to see if the script was even working, within /libexec/traps/TrapHandler I changed:

my $submit = `/bin/echo "[$datetime] PROCESS_SERVICE_CHECK_RESULT;$this_host;$this_serv ice;$status;$arguments_line" >> $conf[0]`;

to

my $submit = `/bin/echo "[$datetime] PROCESS_SERVICE_CHECK_RESULT;$this_host;$this_serv ice;$status;$arguments_line" >> test.txt

test.txt was created within minutes, so I know the script is being called when a trap is received. The problem is nothing being sent to the nagios command file.

Any comments or help would be greatly appreciated.

Thanks,
nebj00la

nebj00la
10-30-2007, 09:43 PM
The issue was due to the "echo" binary missing from /bin. For whatever reason, there was a zero byte size "echo" file which I replaced with the proper binary.

Thanks,
nebj00la