Eventhandler issue


So I setup eventhandler for one of my servers similar to the write up on the nagios site.

I see the eventhandler is triggered in nagios.log.

“[1133367310] SERVICE EVENT HANDLER: ice.asdf.com;HTTP;CRITICAL;HARD;3;restart-httpd”

however, the restart-httpd is not triggered.

so then I ran the script via the command line:
./restart-httpd CRITICAL SOFT 3

the script works.

my check_commands.cfg:
define command{
command_name restart-httpd
command_line /usr/local/nagios/libexec/eventhandlers/restart-httpd $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$

my services.cfg
define service{
use generic-service
host_name ice.asdf.com
service_description HTTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups on-call
notification_interval 1
notification_period 24x7
notification_options c,r
check_command check_http!80
event_handler restart-httpd

can anyone offer an explanation on why it looks like the event trigger is being triggered but the $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$ is not being sent to the script…

what else should I be looking at…?

thanks in advance.


nothing in the Nagios logs?