From 162931a1b4d767e39fec3d566a03cb4f72e0b4e6 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Mon, 25 Jul 2016 15:38:50 +0200 Subject: [PATCH] Docs: Better explaination for zones.d and apply rule workaround refs #12217 --- doc/13-distributed-monitoring-ha.md | 42 ++++------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/doc/13-distributed-monitoring-ha.md b/doc/13-distributed-monitoring-ha.md index 2b51b52a6..bf1ddb8d6 100644 --- a/doc/13-distributed-monitoring-ha.md +++ b/doc/13-distributed-monitoring-ha.md @@ -472,45 +472,13 @@ 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" - } +[Apply rules](3-monitoring-basics.md#using-apply) in zone directories underneath `zones.d` +also match against objects defined outside of that particular zone directory. +To work around this issue you can use an `assign where` rule to limit the apply rule to +a specific zone: + assign where host.zone == "dmz1-checker" ## Cluster Health Check