Unpingable host - how to monitor?

Been having a lot of fun setting up Nagios and trying to learn Linux, SNMP, apache at the same time… It’s been great, and a challenge, and a headache but very enjoyable. Something I haven’t been able to work out is how to monitor a host which I can’t ping. I’m more than happy to be pointed to the manual rather than just be given the answer. Just give a pointer on where to look.

Want I want to do is monitor a host by it’s services, rather than ping. In my naive and innocent way, I thought I’d just be able to define a host, then define the services, and those service checks would provide the checks to give host up / down notifications. This doesn’t seem to be the case. Nagios appears (from a wireshark trace) ping the defined host without being told to. What I’ve configured for this device is:

[code]define host{
use linux-server ; Name of host template to use
host_name Web Server
alias www.company.com
address 1.2.3.4
}
define service{
use generic-service ; Name of service template to use
host_name Web Server
service_description SSH
check_command check_ssh!-p 1234
}

define service{
use generic-service
host_name Web Server
service_description HTTP
check_command check_http
}[/code]

From that I am getting:

Host Status Services
Web Server DOWN 2 OK

I’ve tried playing with the config for active and passive checks, but this seems to be related more to additional devices that would be able to “ping” the device, and pass that on to Nagios. As such I just managed to “Disable active checks of this host”, it still insists the device is down, but services are up.

Any pointers much appreciated.

create a different host template (linux-server2) and use ssh a host check…
or open the firewall and make ping work. :slight_smile:

[quote=“luca”]create a different host template (linux-server2) and use ssh a host check…
or open the firewall and make ping work. :)[/quote]

Luca, thank you.

You are right, ping is defined in the template.cfg file. Changing the check-host-alive to check_ssh got it showing avalible.

Much appreciated.

keep in mind that with this configuration if ssh dies you could get a host down notification… :slight_smile: