I'm novice with Nagios (Nagios v.3.2.3, Centos v.6.6, Centreon).
I can't resolve the problem how to run external script (bash) when somebody Acknowledged event Host-Down.
My eventhandler script do not receive $NOTIFICATIONCOMMENT$ (Notification box was checked and Comment was written).
Eventhandler recognise host DOWN (soft, hard), RECOVERY but I need to recognise state Acknowledge and run bash script.
In next step I’ve created extraUser with host notifier (simple /bin/echo instead of script), but doesn’t work.
- host.cfg
Code: Select all
define host{
host_name SWITCH_13
use generic-host
alias SWITCH_13
address 10.2.22.52
_HOST_ID 97
hostgroups brocade_san_switches
event_handler eventhandler_host_down
contacts [email protected],extraUSER
notification_interval 0
first_notification_delay 0
notification_period 24x7
notification_options d,u,r,s
notifications_enabled 1
}Code: Select all
define command{
command_name eventhandler_host_down
command_line $USER1$/eventhandlers/eventhandler_host_down.sh $HOSTADDRESS$ $HOSTNAME$ $HOSTSTATE$ $HOSTSTATETYPE$ "$NOTIFICATIONCOMMENT$"
}
Code: Select all
define command{
command_name host-notify-to-extraUSER
command_line /bin/echo $DATE$ $HOSTNAME$ $HOSTSTATE$ $HOSTPERFDATA$ >>/home/extraUSER/host_notif.log
}Code: Select all
define contact{
contact_name extraUSER
alias extraUSER
contactgroups extraUSER
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r,s
service_notification_options w,u,c,r,s
host_notification_commands host-notify-to-extraUSER
service_notification_commands service-notify-to-extraUSER
email [email protected]
host_notifications_enabled 1
service_notifications_enabled 1
}