Dependencies and Notifications

Hi,

i’m struggling at creating dependencies.
I want to achieve that i don’t get multiply notifications for the same error.

Example 1:
I’m checking Windows Services using the icinga 2 agent. If the Icinga Service itself fails every check done by the agent will change to unknown and generates a notification.

Is there a way to create a service (on the icinga host) to check the agent?

Example 2:
Imagine a single DNS Server (no comments on this please :wink: ) if it fails every ping check thats configured to use hostnames will also fail.

Are there some best practise to solve this?
Greetings

For Example 1 you could use cluster-zone to check the agent implicitly. Means if the agent fails the zone is also not connected and this plugin will detect this.

1 Like

Istead of the cluster-Zone check we use the Cluster check. Because we prefer the output of this one.
You can also additionally use the icinga check. This one checks if the icinga-service itself have some troubles, because this one collects a lot of performance data. And you can check if a defined minimum version of icinga is installed.

If you have defined dependencies correctly - for example router - switch, Icinga don’t send notifications for the child like the switch. Look at here.

Define dependencies with the director is easy now. From host to host works very well. But there is an open bug for dependencies where the parent is a host/service combination: https://github.com/Icinga/icingaweb2-module-director/issues/1142

Hi,
thx for reply i will have a look at it.
Meanwhile i had the idea to use chec_ tcp on port 5665. If the agent service is stopped / crashed the check fails.
Now i wanted to set this service as a parent to all agent based services.
Would this idea work or do i need something else. i tried creating that dependency, using

apply Dependency “Icinga_Agent” to Service
{ import “[Generic_Dependency_Template]”
disable_checks = true
disable_notifications = true
assign where service.use_agent == “true”
parent_service_name = “Check_Icinga_Agent” }

but it fails with

[2020-01-16 15:44:58 +0100] critical/config: Error: Invalid field access (for value of type ‘Service’): ‘use_agent’
Location: in [stage]/zones.d/director-global/dependency_apply.conf: 15:18-15:34
[stage]/zones.d/director-global/dependency_apply.conf(13): disable_checks = true
[stage]/zones.d/director-global/dependency_apply.conf(14): disable_notifications = true
[stage]/zones.d/director-global/dependency_apply.conf(15): assign where service.use_agent == “true”
^^^^^^^^^^^^^^^^^
[stage]/zones.d/director-global/dependency_apply.conf(16): parent_service_name = “Check_Icinga_Agent”
[stage]/zones.d/director-global/dependency_apply.conf(17): }

I’m currently doing it like this:
i ran a service check_tcp with port 5665 on every host that has the agent installed.

i create a dependency which applies to all services where service.command_endpoint is set or true.

To lower dependency notifications a also lowered the time