I'm having problems with nagios passive host checks. Every host state is sent to central server as "0" even if it is warning or critical. Service state has no problem, works like it should.
log from central nagios server
Host check
Code: Select all
Jun 24 17:00:46 srv-nag1 nagios: EXTERNAL COMMAND: PROCESS_HOST_CHECK_RESULT;HS-ai117;0;CRITICAL - Host Unreachable (10.41.12.117)
Jun 24 17:00:53 srv-nag1 nagios: PASSIVE HOST CHECK: HS-ai117;0;CRITICAL - Host Unreachable (10.41.12.117)Code: Select all
Jun 23 03:57:55 srv-nag1 nagios: EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;HS-ai119;ai119;1;Warning: ai119 has a modified date of Sun 22 Jun/2014 13:20
Jun 23 03:57:58 srv-nag1 nagios: PASSIVE SERVICE CHECK: HS-ai119;ai119;1;Warning: ai119 has a modified date of Sun 22 Jun/2014 13:20Code: Select all
#!/bin/bash
# Host Check
cmd="/usr/local/nagios/bin/send_nsca"
cfg="/usr/local/nagios/etc/send_nsca.cfg"
host=$1
result=$2
output=$3
/bin/echo -e "$host\t$result\t$output\n" | $cmd -H 10.50.12.200 -c $cfgCode: Select all
#!/bin/bash
# Service Check
cmd="/usr/local/nagios/bin/send_nsca"
cfg="/usr/local/nagios/etc/send_nsca.cfg"
host=$1
srv=$2
result=$3
output=$4
/bin/echo -e "$host\t$srv\t$result\t$output\n" | $cmd -H 10.50.12.200 -c $cfgCode: Select all
obsess_over_services=1
ocsp_command=service_check
ocsp_timeout=5
obsess_over_hosts=1
ochp_command=host_check
ochp_timeout=5Code: Select all
define command{
command_name service_check
command_line $USER1$/eventhandlers/service_check $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATEID$ '$SERVICEOUTPUT$'
}
define command{
command_name host_check
command_line $USER1$/eventhandlers/host_check $HOSTNAME$ $SERVICESTATEID$ '$HOSTOUTPUT$'
}