Icinga2 host state for passive host

icinga

I am using icinga2 for monitoring, and I want to include devices like NVR's located at customer sites. These cannot be pinged to check the host state.

The Icinga2 agent reports everything I need just fine without needing to forward certain ports.

However the host state itself is always 'DOWN' because this is checked using ping.
I would need the host to only be considered 'DOWN' if the agent hasn't reported anything in a timely manner.
For now I am checking on the HTTPS website that the NVR exposes, but that isn't exactly what I want since it could be possible that the NVR service is down but the device itself is up.

Best Answer

The default check set in generic-host is called hostalive, which will check if the host is pingable in any ways.

You would need to change the host state to a dummy check. Since Icinga2 always wants to know if the host is still alive.

Example:

template Host "non-pingable" {
  import "generic-host"

  check_command = "dummy"
  vars.dummy_state = 0
  vars.dummy_text = "Host can not be pinged, should be up, hopefully..."
}

This will run a very generic check, but setting your host state to UP.

You can also use any other check, like SSH, or a port test.