Check-host-alive vs check_ping


i’m using nagios 3.0 for school purposes since some months, i studied its official documentation, and i’m developing a little project.
I still got a question in mind: i know i can check if a host is alive by checking it as a “host check”, or as a “service check”; in particular, i can define a

define host {
hostname linux1
alias linux system
adress xx.xx.xx.xx
check_command check-host-alive


and then i define the relative command

define command {
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5

but then i can also define a check_ping as a service:

define service{
use generic-service
host_name linux1
service_description PING
check_command check_ping!100.0,20%!500.0,60%

So, basically, i just have two ways to check the same thing, or do this involve something different?


check host alive uses check ping if any service associated with the host goes down, and only then.
cehck ping as a service gives you information about ping times and ping losses, any time you shcedule it to run :slight_smile:


can i say that, if i use both check-host-alive and check_ping on a host, i’m only doing a redundancy? Or it does make sense to use both of them?


again: The check host alive ping is done if any service associated with the host goes down, and only then (if you use a default host config, and you should) it is NOT the same thing… so in fact no, there is no redundancy as only the check ping service is executed.


What about if no services are set for a host, but only the check-host-alive is set? Is it going to be performed?

Another question: i have the host01 been checked with both host-check-alive and check_ping (as a service). As documentation says, only the check_ping is going to be performed; the check-host-alive is performed if ( and only if ) the check_ping service fails. Correct?
So, looking at my implementation, why is check-host-alive planned to be performed every x minutes even if check_ping is currently successfully running?


Great… i just checked and the standard settings changed between nagios 2.x and 3.x.

Now active host checks don’t block the server anymore.
So active checks are scheduled by default and in fact i suppose you could as well use check-host-alive only (or it could even be bettter as there is now in fact a redundancy which wasn’t there until 2.x).

Sorry, my mistake.