Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using Icinga (Nagios fork) to also monitor uptime of external hosts and services. Currently when looking at the "Critical" count I find it difficult to decide if an internal service is affected (I should take immediate action) or an external service (I just acknowledge the problem).

Is there a way to keep a problem acknowledgement for future down-times of the checked host/service? Is there some way to auto-acknowledge the state change of external hosts/services?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Have found out how to do auto-acknowledges for external hosts.

First define an event handler for the external host:

define host {
        name            some-external-server
        # ...
        event_handler   handle_external_host
        # ...
}

Then define the command to be used as the event handler:

define command {
        command_name    handle_external_host
        command_line    $USER1$/eventhandlers/acknowledge_host_problem $HOSTNAME$ icingaadmin "Handled by external user"
}

Finally put the event handler script into file /usr/local/icinga/libexec/eventhandlers/acknowledge_host_problem (or where your event handers are installed):

#!/bin/sh

printf_cmd="/usr/bin/printf"
command_file="/usr/local/icinga/var/rw/icinga.cmd"

hostname="$1"
author="$2"
comment="$3"

# get the current date/time in seconds since UNIX epoch
now=`date +%s`

# pipe the command to the command file
$printf_cmd "[%lu] ACKNOWLEDGE_HOST_PROBLEM;%s;1;1;0;%s;%s\n" $now "$hostname" "$author" "$comment" >> $command_file

Don't forget to make the script executable using command "chmod +x" or similar. For details on ACKNOWLEDGE_HOST_PROBLEM see the Icinga documentation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.