Check another host if main host is down

Hi,

with this object service I wondered if it would be possible to make it check more than one hostname if the first one is not available:

object Service "Check Pool DF" {
  import "generic-service"
  host_name = "server01.mydomain.com"
  check_command = "nrpe-check-1arg"
  vars.host = "10.10.10.10"
  vars.check = "check_ceph_df"
}

So if server01.mydomain.com doesn’t respond it will check another host for example server02.

I hope this makes sense?

Hi,

you would need to write a plugin wrapper for that and pass the host name list in there. The actual magic with connection fallback must be done in that plugin, Icinga doesn’t provide such a fallback itself - it just executes a command with parameters, not knowing any logic hidden in here.

Cheers,
Michael