Service-to-Service Dependency


#1

Hi all,
latest Icinga2:
I am trying to build a dependency, that disables all checks on my satellite, when the Icinga Service itself is not running. As far as I understood the dependencies, every child service should automatically be acknowlegded, when the parent service is not $state$ (like it is at all services, when a host goes down)
So I built the following apply rule:

    apply Dependency "icinga" to Service {
      parent_service_name = "icinga"
      disable_checks = true
      disable_notifications = true
      ignore_soft_states = true
      states = [ OK ]
      assign where host.name == "xyz"
      ignore where service.name == "icinga"
    }

When I stop the icinga2 service on host xyz all checks in Icingaweb2 stay on unknown and are not acknowlegded. Did I understand sth. wrong?

Cheers,
Marcus


#2

If I see this correctly you are missing a parent_host in your dependency configuration.

Small side note1: The dependent objects will be marked “UNREACHABLE”, not acknowledged (though it looks nearly the same).

Small side note2: If you use three backticks ``` in front of and after your code snippet, it will be highlighted nicely:)


#3

Nope, you don’t need this:

When using apply rules for dependencies, you can leave out certain attributes which will be automatically determined by Icinga 2.
Service-to-Service-on-the-same-Host Dependency Example:

apply Dependency “disable-agent-checks” to Service {
parent_service_name = “agent-health”

assign where service.check_command == “ssh”
ignore where service.name == “agent-health”
}
This example omits the parent_host_name attribute and Icinga 2 automatically sets its value to the name of the host object matched by the apply rule condition. All services where apply matches are made implicit child services in this dependency relation.

When there is no auto-ack for self written dependencies, why is there an integrated auto-ack for services @ down hosts? :smiley: I want this for my dependencies, too ! :smiley: :smiley: :smiley:


#4

Good to know, thanks :slight_smile:

Imo an acknowledgement is a manual operation by a user which will give the service or the host the little tick and a commented reason, why the ack was set:
image

The (implicit) dependencies create a state that looks close to an acknowledged service, but it is not the same (i.e. the tick is missing). The services or hosts are “UNREACHABLE” and their notifications are disabled (default). That’s what the IcingaWeb2 interface tells you with image


#5

And exact this look is missing in my Icingaweb.
The service itself switches to unreachable, but the Service Background does not change from full background color to side background. So for the user it looks like the service is as unknown as it would be without dependency.


#6

Ah, now I got what you mean :smiley:

Yes, the entries of “UNREACHABLE” objects are still “full color”.

Maybe your users should just read the text :wink:
Jokes aside there already is a feature-request/enhancement going for this issue:

best regards :wave:


#7

I see. Thanks for the info!