[Nagiosplug-help] eventhandler

Winn Johnston winn_johnston at yahoo.com
Tue Aug 5 15:46:31 CEST 2008


Hey guys i am trying to configure nagios to restart bind when it hits check number 4.

The monitoring side is up and running. I have taken the sample eventhandler (rstart-httpd) from here http://nagios.sourceforge.net/docs/2_0/eventhandlers.html and modified it for bind. I have added on my nagios server what you see below to the commands.cfg

define command{
        command_name    restart-bind
        command_line    /usr/local/nagios/libexec/eventhandlers/restart-bind $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$
}

and added this to the services.cfg on the same machine
define service{
        hostgroup               haa_dns
        service_description     dig
        check_command           check_dig!xxx.mydomain.com!ip.add.re.ss
        max_check_attempts      5
        normal_check_interval   5
        retry_check_interval    3
        check_period            24x7
        event_handler           restart-bind
        notification_interval   30
        notification_period     24x7
        notification_options    w,c,r
        contact_groups          admins
}


When i shut down bind i get this message in the logs

case 1
Aug  5 08:59:51 nagios nagios: SERVICE ALERT: dns3;dig;CRITICAL;SOFT;1;CRITICAL - Plugin timed out while executing system call
Aug  5 08:59:51 nagios nagios: SERVICE EVENT HANDLER: dns3;dig;(null);(null);(null);restart-bind


Also if i schedule downtime for the service will the eventhandler still run?

Thanks in advance :)
Winn Johnston


      




More information about the Help mailing list