Documentation: Update Advanced -> Dependencies.

Fixes #5724
This commit is contained in:
Michael Friedrich 2014-03-07 12:10:23 +01:00
parent 3b8c1a0c7d
commit 18b9129151

View File

@ -334,10 +334,13 @@ the Icinga 2 daemon.
## <a id="dependencies"></a> Dependencies ## <a id="dependencies"></a> Dependencies
Icinga 2 uses host and service dependencies as attribute directly on the host or Icinga 2 uses host and service [Dependency](#objecttype-dependency) objects either directly
service object or template. A service can depend on a host, and vice versa. A defined or as inline definition as `dependencies` dictionary. The `parent_host` and `parent_service`
service has an implicit dependeny (parent) to its host. A host to host attributes are mandatory, `child_host` and `child_service` attributes are obsolete within
dependency acts implicit as host parent relation. inline definitions in an existing service object or service inline definition.
A service can depend on a host, and vice versa. A service has an implicit dependeny (parent)
to its host. A host to host dependency acts implicit as host parent relation.
A common scenario is the Icinga 2 server behind a router. Checking internet A common scenario is the Icinga 2 server behind a router. Checking internet
access by pinging the Google DNS server `google-dns` is a common method, but access by pinging the Google DNS server `google-dns` is a common method, but
@ -345,7 +348,9 @@ will fail in case the `dsl-router` host is down. Therefore the example below
defines a host dependency which acts implicit as parent relation too. defines a host dependency which acts implicit as parent relation too.
Furthermore the host may be reachable but ping samples are dropped by the Furthermore the host may be reachable but ping samples are dropped by the
router's firewall. router's firewall. In case the `dsl-router``ping4` service check fails, all
further checks for the `google-dns` `ping4` service should be suppressed.
This is achieved by setting the `disable_checks` attribute to `true`.
object Host "dsl-router" { object Host "dsl-router" {
services["ping4"] = { services["ping4"] = {
@ -362,16 +367,21 @@ router's firewall.
services["ping4"] = { services["ping4"] = {
templates = "generic-service", templates = "generic-service",
check_command = "ping4", check_command = "ping4",
service_dependencies = [ dependencies["dsl-router-ping4"] = {
{ host = "dsl-router", service = "ping4" } parent_host = "dsl-router",
] parent_service = "ping4",
disable_checks = true
}
} }
macros = { macros = {
address = "8.8.8.8", address = "8.8.8.8",
}, },
host_dependencies = [ "dsl-router" ] dependencies["dsl-router"] = {
parent_host = "dsl-router"
},
} }
## <a id="check-result-freshness"></a> Check Result Freshness ## <a id="check-result-freshness"></a> Check Result Freshness