I am wondering what the proper configuration syntax is, in order to have event handler on a host group service.
By this I mean, what is the correct way to inform the event handler service of the correct hostname/address to pass on to the event handlers script?
Currently I have these defined:
Code: Select all
define command {
command_name restart-x
command_line $USER1$/eventhandlers/x_reset $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $HOSTNAME$ $ARG1$
}
define service {
check_command check_nrpe!check_x
contacts contactsadmin
event_handler restart-x
event_handler_enabled 1
hostgroup_name x_servers
max_check_attempts 3
notification_interval 60
notification_period 24x7
service_description Check X Service
}
Code: Select all
[Tue Apr 20 14:19:41 2021] SERVICE EVENT HANDLER: server1;Check X Service;CRITICAL;SOFT;1;restart-x
[Tue Apr 20 14:20:51 2021] SERVICE ALERT: server1;Check X Service;CRITICAL;SOFT;2;CRITICAL - Plugin timed out while executing system call
[Tue Apr 20 14:20:51 2021] SERVICE EVENT HANDLER: server1;Check X Service;CRITICAL;SOFT;2;restart-x