Skip to content

Commit

Permalink
Dependency apply rule for multiple parents. Update of readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zampat committed Jul 11, 2019
1 parent 1a0227d commit 6a5ea9f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
19 changes: 19 additions & 0 deletions monitoring/configurations/icinga/dependency/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Dependeny apply rule samples

## Parent - Child dependency rule

The Dependency Apply rule activates a dependency for all hosts, where (field) host_parent is set.
This rule works for a parent field of type:
- single host (String)
- multiple hosts (Array)
Simply define the type of field according the preference so assign single or multiple hosts.

Instructions:
1) Define a field: "host_parent" of type Director Host
2) Assign field to host template be able to define a "parent" for a host object.
3) place dependency_parentChild.conf in NetEye4 folder: /neteye/shared/icinga2/conf/icinga2/conf.d/
4) Reload icinga2 service

## Icinga Agent dependency rule

This rule defines a service dependency of Services named "*win*" to the service verifying the Icinga Agent availabiliy.
8 changes: 0 additions & 8 deletions monitoring/configurations/icinga/dependency/README.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ apply Dependency "generic-dependency-on-vars_parent" to Host {
disable_notifications = true
ignore_soft_states = true
states = [ Up ]
assign where host.vars.host_parent
assign where host.vars.host_parent && typeof(host.vars.host_parent) == String
}

apply Dependency "generic-dependency-on-vars_parent" for (parent in host.vars.host_parent) to Host {
parent_host_name = parent
disable_checks = false
disable_notifications = true
ignore_soft_states = true
states = [ Up ]
assign where host.vars.host_parent && typeof(host.vars.host_parent) == Array
}

0 comments on commit 6a5ea9f

Please sign in to comment.