Change check that marks a host UP/DOWN
Change check that marks a host UP/DOWN
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
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.
Former Nagios employee
Re: Change check that marks a host UP/DOWN
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:
This assumes you define a custom host variable called _SSH_PORT on each host.
Code: Select all
check_command $USER1$/check_ssh -H $HOSTADDRESS$ p $_HOSTSSH_PORT
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Change check that marks a host UP/DOWN
Thank you for the example Eloyd! Yep, it really is as easy as just changing the check command.