Service Dependency

Hi all!

I’m having a hard time getting my head around icinga2 service dependencies and cant seem to figure out how to make a service dependency for another service check. I know Icinga director might be helpful here but dont see the need to install it just for this.

Here’s my scenario:

I have 3 service checks being applied to certain hosts; 1 health check, 1 offers check, and 1 online check (names dont matter other than the health check).

The logic I am trying to follow is as such:

If the health check is critical, then the offers and online checks are auto acknowledged because they are dependent on the overall health check and will always be critical if health is critical.

The trick here is that this is evaluated on a per host basis and if health is critical on one host, it doesnt mean that its critical on ALL hosts that has this check.

Heres a sample scenario:

Host A
health Critical
online auto acknowledged
offers auto acknowledged

Host B
health OK
online OK
offers Critical

Host C (down)
health auto acknowledged
online auto acknowledged
offers auto acknowledged

I am able to configure the Host C scenario but cant seem to figure out how to make Host A and Host B to work the way I want it. Thoughts?

i think you can implement something similar with business-process.
not the auto-acknowledge but a “service” that changes its availability based on your logic, so you get the right notifications.

dont forget to disable the notificatios for your real services “helper services”.

Scenario C normally does not need to be configured as there is an implicit dependency from services to their own host. So if the Host C is down all services of that host will not send out notification.
You need to configure it only if you also want the check execution to stop as long as the Host C is down.
See here

I think for the other scenario the docs example for the agent health check depedency could be helpful.

Change the used boolean variable from the example host.vars.agent_endpoint to something that fits your needs and add it to the hosts that should get the health check (e.g. via another host template)

About the acknowledgements:
You don’t get checks acknowledged via a dependency, they just “appear” like such without the actual ack.
Dependencies are mainly for suppressing mass notifications for child hosts/services and can also be configured to stop check execution during the time of the failed dependency