Parent_host_name - Internet Connectivity check - not going unreachable

I have defined a Host Object “Internet Connectivity”, a Host Object “Test” has it as a parent, however when Internet Connectivity is down, “Test” does not change to state “unreachable”.

object Host "Internet Connectivity" {
  import "parents"
  check_command = "ping4"
  address = ""

object Host "Test" {
  import "test"
  address = ""

object Dependency "test-internet"{
  parent_host_name = "Internet Connectivity"
  child_host_name = "Test"
  disable_checks = true

What am I missing? Test goes “reachable no” under “Check execution” but the state is Up or Down instead of “Unreachable”.


didn’t know configureing a dependency like this is valid :man_shrugging:

I have always set it up like in the docs:

apply Dependency "internet" to Host {
  parent_host_name = "dsl-router"
  disable_checks = true
  disable_notifications = true

  assign where != "dsl-router"

Also I’m not sure if the UNREACHABLE “status” only turns up when the host/service is re-checked while “reachable” is set to no.

have you tried if setting disable_checks = false changes anything?

The object notation is totally valid, the apply rule generates the child_* attributes automatically from matched objects.

The ‘unreachable’ state is a compat layer from 1.x only available in DB IDO, this doesn’t exist in Icinga 2 where only the reachable runtime attribute exists.

From the IDO code, something I’d like to purge.

        if (currentState != HostUp && !host->IsReachable())
                currentState = 2; /* hardcoded compat state */

To update this in the database, a new host state event is needed, and highly likely this did not happen yet.


1 Like

Thanks for explaining!

Sounds logical, thinking about it (apply rules create objects, duh :smiley: :man_facepalming: )

And thus disable_checks = false is needed, correct? Otherwise how would such an event be generated?

Correct :slight_smile: Chicken egg problem.

1 Like
  disable_checks = false
  disable_notifications = true

This actually works (with icinga 2):

did you try if this changes the “output” from DOWN to UNREACHABLE?