Page 1 of 1

Change check that marks a host UP/DOWN

Posted: Mon Dec 08, 2014 3:07 pm
by Jtessaro
We have a number of hardened appliances (Linux -- CentOS/RedHat based) that will not return to pings but are being monitored via SNMP. When added to Nagios these appliances appear to be down due to the ping failure, how can we change the way Nagios decides if a host is up or down? (ex. if the host is open to SSH it is up)

Re: Change check that marks a host UP/DOWN

Posted: Mon Dec 08, 2014 3:14 pm
by tmcdonald
This is as simple as changing the check command that is run. So instead of using check_icmp or check_ping, you can give it something like check_tcp or check_snmp with a specific OID that will respond positively.

Re: Change check that marks a host UP/DOWN

Posted: Mon Dec 08, 2014 5:06 pm
by eloyd
To answer with the specific example you used, you can use check_ssh to probe the SSH port. If you use a non-standard SSH port that's different on each machine, you can use custom host variables and pass the variable to the check_ssh command via the -p <port> parameter:

Code: Select all

check_command     $USER1$/check_ssh -H $HOSTADDRESS$ p $_HOSTSSH_PORT
This assumes you define a custom host variable called _SSH_PORT on each host.

Re: Change check that marks a host UP/DOWN

Posted: Tue Dec 09, 2014 10:59 am
by slansing
Thank you for the example Eloyd! Yep, it really is as easy as just changing the check command.