Problem with host checks -- host always UP
Posted: Tue Dec 24, 2019 9:44 am
I can't figure out what I did wrong.
I have my host defined:
and I have my command defined
and when my host is down, the command fails
But in nagios, the host is listed as "UP"
Does the ping command need to generate output? As far as I can tell from the documentation https://assets.nagios.com/downloads/nag ... tions.html , all I need to do is return the correct status ... which should be happening as far as I can tell.
What am I missing?
Thanks.
I have my host defined:
Code: Select all
define host{
use windows-server ; Inherit default values from a template
host_name honda ; The name we're giving to this host
address ip.add.re.ss
check_command ping-with-nc
}
Code: Select all
define command{
command_name ping-with-nc
command_line /usr/bin/nc -z -w 2 $HOSTADDRESS$ 22 2>&1
}
Code: Select all
$ nc -z -w 2 honda 22
$ echo $?
1
Does the ping command need to generate output? As far as I can tell from the documentation https://assets.nagios.com/downloads/nag ... tions.html , all I need to do is return the correct status ... which should be happening as far as I can tell.
What am I missing?
Thanks.