Event Handler script not running
Posted: Sat May 02, 2015 7:35 pm
I can't get the event-handler script to run. I'm not getting any errors in the log file and the script runs manually.
Service:
define service{
use local-service
host_name localhost
service_description restart ulink PolicyServer
check_command check_ulink_procs!2:2!'uLinkPolicyServer'
check_interval 2
event_handler restart_ulink-policy
}
Handler (defined in command.cfg):
define command{
command_name restart_ulink-policy
command_line /usr/local/nagios/libexec/eventhandlers/restart_ulink-policy $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
}
The script is the template copied from the nagios event-handler instructions.
permissions for the script:
-rwxr-xr-x restart_ulink-policy
nagios.log doesn't indicate any problems:
[1430607293] SERVICE EVENT HANDLER: localhost;restart ulink PolicyServer;CRITICAL;SOFT;3;restart_ulink-policy
[1430607353] SERVICE ALERT: localhost;restart ulink PolicyServer;CRITICAL;HARD;4;PROCS CRITICAL: 0 processes with args 'uLinkPolicyServer'
[1430607353] SERVICE NOTIFICATION: nagiosadmin;localhost;restart ulink PolicyServer;CRITICAL;notify-service-by-email;PROCS CRITICAL: 0 processes with args 'uLinkPolicyServer'
[1430607353] SERVICE EVENT HANDLER: localhost;restart ulink PolicyServer;CRITICAL;HARD;4;restart_ulink-policy
[1430607593] SERVICE ALERT: localhost;restart ulink PolicyServer;OK;HARD;4;PROCS OK: 2 processes with args 'uLinkPolicyServer'
It seems the script isn't being run at all. echo commands in the script isn't being printed either.
Any help would be greatly appreciated as I'm out of ideas.
Service:
define service{
use local-service
host_name localhost
service_description restart ulink PolicyServer
check_command check_ulink_procs!2:2!'uLinkPolicyServer'
check_interval 2
event_handler restart_ulink-policy
}
Handler (defined in command.cfg):
define command{
command_name restart_ulink-policy
command_line /usr/local/nagios/libexec/eventhandlers/restart_ulink-policy $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
}
The script is the template copied from the nagios event-handler instructions.
permissions for the script:
-rwxr-xr-x restart_ulink-policy
nagios.log doesn't indicate any problems:
[1430607293] SERVICE EVENT HANDLER: localhost;restart ulink PolicyServer;CRITICAL;SOFT;3;restart_ulink-policy
[1430607353] SERVICE ALERT: localhost;restart ulink PolicyServer;CRITICAL;HARD;4;PROCS CRITICAL: 0 processes with args 'uLinkPolicyServer'
[1430607353] SERVICE NOTIFICATION: nagiosadmin;localhost;restart ulink PolicyServer;CRITICAL;notify-service-by-email;PROCS CRITICAL: 0 processes with args 'uLinkPolicyServer'
[1430607353] SERVICE EVENT HANDLER: localhost;restart ulink PolicyServer;CRITICAL;HARD;4;restart_ulink-policy
[1430607593] SERVICE ALERT: localhost;restart ulink PolicyServer;OK;HARD;4;PROCS OK: 2 processes with args 'uLinkPolicyServer'
It seems the script isn't being run at all. echo commands in the script isn't being printed either.
Any help would be greatly appreciated as I'm out of ideas.