Check another host if main host is down


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 = ""
  check_command = "nrpe-check-1arg" = ""
  vars.check = "check_ceph_df"

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

I hope this makes sense?


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.