Dependency Host to Host

Hi community,

I’m facing an issue with an apply rule for the dependencies.
I need a host-host dependency, so when the parent Host goes down, the child Host will turn into the unreachable state and no notification will be send out for the child.
Problem is now that the rule I created doesn’t get applied because supposedly the dependency rule doesnt match anywhere. But I can’t realy figure out why the dependency doesn’t match. :sweat_smile:

The rules I created:

With the Icinga director a dependency template got created which gets imported into the dependency apply rule. The Parent-Host Object in the dependency apply rule is set to $host.vars.varname$. I also tried setting the Parent-Host Object to a non variable, an existing Host, but get the same result when trying to deploy it.

The Data Fields for parent_host_name and child_host_name are strings for the datatype and set in the Hosts with the Hostname.
I’ve tried already several properties in the apply rule, with no different result. Am I missing something? I cant’t find any more “tipps” in the Icinga docs. Can someone help me troubleshooting this problem? :slightly_smiling_face:

I’m using the Icinga Web 2 Version 2.9.3. The director is also up to date 1.8.1 and the PHP version is 7.1.30.

Thank you!
Aaron

Hi @aaron

you don’t have to use the “assign where” conditions here. Just create a data field (i. e. “parent_host”) and add it to the dependency.
grafik

Now you can create a new data field called “parent_host” and add it to an existing host template.

PS: I recommend setting the data type of the field to “DirectorObject”, Object to “Host” and Target data type to “Array” so you can choose from already existing hosts. :slight_smile:

Kind regards