Dependency - Where to start

Hi,

We are running icinga2 for a couple of years now but never dig into dependency…

So, an open question, where to start? :wink:

You can share your snippet if you want …

Right now in our dependency.conf we have

apply Dependency "Parent" for (parent in host.vars.parents) to Host {
  parent_host_name = parent
  disable_checks = true

  assign where host.address && host.vars.parents
}

apply Dependency "disable-host-service-checks" to Service {
  disable_checks = true
  disable_notifications = true
  ignore_soft_states = false
  states = [Down]

  assign where host.name
}

Is there a way in icingaweb2 to see if it works ?

What I want to be done it’s

First apply will disable cheks if “parent” is down…
Second apply will disable notification to Service if host “itself” is down…

But not sure if it works as if hostA goes down, I’m unable to see under icingaweb2 that all services are disable for checks and notifications…

The other thing we would like to have it’s disable host/services check IF “parent” is down…

Is there a way in icingaweb2 to see if it works ?

Simulate a machine being down and see whether you do and don’t get the
notifications you expect.

What I want to be done it’s

First apply will disable cheks if “parent” is down…

Find, that’s a commen configuration requirement.

Second apply will disable notification to Service if host “itself” is
down…

That is a default in Icinga - you do not need to define this yourself.

https://icinga.com/docs/icinga-2/latest/doc/03-monitoring-basics/#dependencies

“A service has an implicit dependency (parent) to its host.”

That means that unless you change it, all services for a host are
automatically dependent on that host, and therefore service checks will not be
notified for a host which is “down”.

Antony.

@Pooh
thanks!
that means, the only dependency we can “add” it’s

apply Dependency "disable-host-service-checks" to Service {
  disable_checks = true
  assign where true
}

To disable check to all services when the host is marked as down!?

No, I mean you do not need to do this at all because it is automatic.

Icinga assumes that you want services to be “dependent” on their hosts (in
other words, service checks are only performed and notifications sent for a
host which is “up”).

It is possible to tell Icinga not to do this, but this is not what you want
and it is not what most people want.

So, you should create the host-to-host dependencies you referred to, but the
host-to-service dependencies are automatic.

Antony.

1 Like

Another question related to this matter. What if the router is down, the host get in the automatic non reachable state, but the services still do checks. How can we make services to stop the checks too if the parent of the host is down?.. Any ideas?