Service Dependency with servicesets

I try to add a service dependency. If Service1 on Host1 is OK, Service2 at Host2 should not be checked. So far - so good. This should be easy with dependencies in the director.

After entering the parent host as related object, I want to enter the service name. But I will only get suggestions for two services, but not the one I need (we have about 10 services on the host).
These two services are assigned by “Service Apply Rules” in the director. All the other missing services are assigned with “servicesets”.
Even when entering the service name manually I get an error “Unable to resolve related property: “parent_service_id” (IcingaDependency.php:584)”.

Is it because the director treats servicesets in another way so I can not add any services from servicesets? Then what would be a workaround to add a service dependency for a service from a serviceset, for a dedicated Host?
As we are working with about 50 people on the configuration, we dont want to mix up local configfiles with director configuration. Any ideas?

Thanks and regards

Hi, there is an open issue: https://github.com/Icinga/icingaweb2-module-director/issues/1142 :wink:

2 Likes

Thanks!
I have no idea, why I didnt find this issue.
Even its not a real solution there, I can track the status.

1 Like

You’re welcome. We are also waiting for the version where this is fixed :wink:

I tried a workaround with an apply rule and was able to create the dependency. Because its a failover Host, I created two dependencies:

apply Dependency "Failover1" to Service {
    import "blank Dependency"
    parent_host_name = "host2.xyz.de"
    parent_service_name = "Healthcheck"
    ignore_soft_states = true
    period = "alldaylong"
    assign where host.name == "host1.xyz.de"
    states = [ Critical, Unknown, Warning ]
}

and

apply Dependency "Failover2" to Service {
    import "blank Dependency"
    parent_host_name = "host1.xyz.de"
    parent_service_name = "Healthcheck"
    ignore_soft_states = true
    period = "alldaylong"
    assign where host.name == "host2.xyz.de"
    states = [ Critical, Unknown, Warning ]
}

But that escalated quickly …
Bothers masters crashed with the following error: " Too many nested dependencies (>256) for checkable". Seems like we build a kind of loop with our dependencies and its known limitation to have a max of 256 (https://github.com/Icinga/icinga2/issues/5762 and https://github.com/Icinga/icinga2/issues/1719) .
Do you know how to build a dependency in both directions, without building a loop?

  1. Host1 Healthcheck is OK.
    Host2 Healtchcheck is CRIT (because only one instance can run at the same time)
    ==>> No notification (rule 2)

  2. Host1 Healthcheck is CRIT.
    Host2 Healtcheck is OK (because of automatic failover)
    ==>> No notification (rule 1)

  3. Host1 Healthcheck is CRIT.
    Host2 Healthcheck is CRIT.
    ==> ALARM

Much appreciate your help!

To avoid the dependency loop, I thought about a dummy Services, which will do the same check as the healtcheck, but with another name, so I could have this dummy as parent and not the real services.
Would this help?