Page 1 of 1

host_down_disable_service_checks - passive checks

Posted: Mon Sep 23, 2019 5:07 am
by ghugon
Hi,

I'd like to be able to do passive checks while host_down_disable_service_checks is enabled, is that possible ?
(https://support.nagios.com/forum/viewto ... 20#p292425)
We decided it shouldn't negate the performance benefits we get from host_down_disable_service_checks as it would only do one passive service check per service instead of one every x minutes if host_down_disable_service_checks is not enabled.

But it doesn't seem to work when done through nagios xi ui and when done using a script aswell.
Also, the checks are done by gearman workers.

The eventhandler script would look something like this, right ?

Code: Select all

#!/bin/bash
HOSTNAME=$1
HOSTSTATE=$2
SERVICENAME=$3
DATE=$(date)
COMMANDFILE='/usr/local/nagios/var/rw/nagios.cmd'
case "$HOSTSTATE" in 
    DOWN) 
    /bin/printf "[%lu] PROCESS_SERVICE_CHECK_RESULT;$HOSTNAME;$SERVICENAME;2;CRITICAL" $DATE > $COMMANDFILE
esac

Re: host_down_disable_service_checks - passive checks

Posted: Mon Sep 23, 2019 8:36 am
by scottwilkerson
ghugon wrote:Also, the checks are done by gearman workers.
This is your problem right here. You cannot process a command on a worker that is trying to write to the command pipe (/usr/local/nagios/var/rw/nagios.cmd) on the Nagios server, it just won't work.