[icinga-checkins] icinga.org: icinga2/feature/ido-groups: Fix incorrect documentation about apply rules in zones.d directories

git at icinga.org git at icinga.org
Mon Jul 25 14:49:35 CEST 2016


Module: icinga2
Branch: feature/ido-groups
Commit: 463beb9aa8b82b735c58cb1515c8e624d103fd2a
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=463beb9aa8b82b735c58cb1515c8e624d103fd2a

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Mon Jul 25 10:41:21 2016 +0200

Fix incorrect documentation about apply rules in zones.d directories

Provides an example how it is done too.

fixes #12217

---

 doc/13-distributed-monitoring-ha.md |   41 +++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/doc/13-distributed-monitoring-ha.md b/doc/13-distributed-monitoring-ha.md
index eddf975..931e421 100644
--- a/doc/13-distributed-monitoring-ha.md
+++ b/doc/13-distributed-monitoring-ha.md
@@ -427,9 +427,8 @@ the actual configuration organization:
 * Generic `Templates`, `timeperiods`, `downtimes` should be synchronized in a global zone as well.
 * [Apply rules](3-monitoring-basics.md#using-apply) can be synchronized globally. Keep in mind that they are evaluated on each instance,
 and might require additional filters (e.g. `match("icinga2*", NodeName) or similar based on the zone information.
-* [Apply rules](3-monitoring-basics.md#using-apply) specified inside zone directories will only affect endpoints in the same zone or below.
 * Host configuration must be put into the specific zone directory.
-* Duplicated host and service objects (also generated by faulty apply rules) will generate a configuration error.
+* Duplicated host and service objects (also generated by apply rules) will generate a configuration error.
 * Consider using custom constants in your host/service configuration. Each instance may set their local value, e.g. for `PluginDir`.
 
 This example specifies the following hierarchy over three levels:
@@ -473,6 +472,44 @@ If you are planning to synchronize local service health checks inside a zone, lo
 [command endpoint](13-distributed-monitoring-ha.md#cluster-health-check-command-endpoint)
 explainations.
 
+[Apply rules](3-monitoring-basics.md#using-apply) put into zone directories underneath `zones.d`
+must specify the zone where they should be applied to e.g. `assign where host.zone == "dmz1-checker"`.
+
+    # tree /etc/icinga2/zones.d
+    /etc/icinga2/zones.d
+    ├── dmz1-checker
+    │   ├── hosts.conf
+    │   ├── apply_services.conf
+    ├── dmz2-checker
+    │   └── hosts.conf
+    ├── global-templates
+    │   ├── apply_services.conf
+    │   ├── commands.conf
+    ├── ha-master
+    │   └── health.conf
+    └── README
+
+Global apply rules:
+
+    # cat /etc/icinga2/zones.d/global-templates/apply_services.conf
+
+    apply Service "ping4" {
+      check_command = "ping4"
+
+      assign where host.address
+    }
+
+
+Zone-specific apply rules:
+
+    # cat /etc/icinga2/zones.d/dmz1-checker/apply_services.conf
+
+    apply Service "mysql" {
+      check_command = "mysql"
+
+      assign where host.zone == "dmz1-checker" && host.vars.db_type == "mysql"
+    }
+
 
 
 ## <a id="cluster-health-check"></a> Cluster Health Check



More information about the icinga-checkins mailing list