Run external script when Acknowledged Host-Down

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
greng
Posts: 1
Joined: Thu May 12, 2016 4:52 am

Run external script when Acknowledged Host-Down

Post by greng »

Hi,
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
}
- checkcommands.cfg

Code: Select all

define command{
   command_name     eventhandler_host_down
   command_line     $USER1$/eventhandlers/eventhandler_host_down.sh $HOSTADDRESS$ $HOSTNAME$ $HOSTSTATE$ $HOSTSTATETYPE$ "$NOTIFICATIONCOMMENT$"
}
- misccommands.cfg

Code: Select all

define command{
   command_name     host-notify-to-extraUSER
   command_line     /bin/echo $DATE$ $HOSTNAME$ $HOSTSTATE$ $HOSTPERFDATA$ >>/home/extraUSER/host_notif.log
}
- contacts.cfg

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
}
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Run external script when Acknowledged Host-Down

Post by rkennedy »

As you're using Centreon, we aren't able to provide support. Your best bet is going to be on their forums.

From a Nagios stand point though, I don't think this is going to be possible as the state isn't going to change, which then leads to event_handler's not triggering.
Former Nagios Employee
Locked