Event_handler on host DOWN/UP not starting... Help please

Hi,

I have a problem using the event_handler feature.
Basically, I’d like to start a script whenever a host is down.
For a start, my script would be :

#!/bin/sh

Location of the echo and mail commands

echocmd="/bin/echo"

Only take action on hard host states…

case "$1" in
	DOWN)
		$echocmd $1 $2 > /tmp/testDOWN.txt
		;;

	UP)
		$echocmd $1 $2 > /tmp/testUP.txt
		;;

	*)
		$echocmd $1 $2 > /tmp/testELSE.txt
		;;
esac

exit 0

Very basic, just only to test the script execution (that does not happen :frowning: ).
I checked the script is OK by typing the command

./testscript DOWN TESTSERVER

=> the /tmp/testDOWN.txt is created.

In the checkcommands.cfg :

define command{ command_name test_event command_line /usr/lib/nagios/plugins/testscript $HOSTSTATE$ $HOSTADDRESS$ }

In the hosts.cfg :

define host{ name host-template notifications_enabled 1 flap_detection_enabled 1 event_handler_enabled 1 event_handler test_event process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 max_check_attempts 5 notification_interval 60 notification_period 24x7 notification_options d,u,r register 0 }

define host{
use host-template
host_name MYSERVER
alias MYSERVER
address 192.168.10.1
check_command check-host-alive
}

Moreover, in the Web GUI, I have “Enable event handler for this host” checked.

That’s all for the config…

When I test, the nagios.log file says :
[1136361525] HOST ALERT: MYSERVER;DOWN;SOFT;1;CRITICAL - Plugin timed out after 10 seconds
[1136361535] HOST ALERT: MYSERVER;DOWN;SOFT;2;CRITICAL - Plugin timed out after 10 seconds
[1136361545] HOST ALERT: MYSERVER;DOWN;SOFT;3;CRITICAL - Plugin timed out after 10 seconds
[1136361555] HOST ALERT: MYSERVER;DOWN;SOFT;4;CRITICAL - Plugin timed out after 10 seconds
[1136361565] HOST ALERT: spare330;DOWN;HARD;5;CRITICAL - Plugin timed out after 10 seconds
[1136361565] SERVICE ALERT: MYSERVER;Ping;CRITICAL;HARD;1;CRITICAL - Plugin timed out after 30 seconds

But nothing happens regarding the event_handler :frowning:

I’m completely lost ! Why doesn’t it work ??
I’ve also tried to setup the event_handler in the services.cfg file but with the same bad luck…

Could anybody help me ? Please ? ;-/
Thanx for you time reading this anyway… and a bigger one for answering if any idea :frowning:
Edited ]