mirror of https://github.com/Icinga/icinga2.git
33 lines
824 B
Markdown
33 lines
824 B
Markdown
## <a id="using-templates"></a> Using Templates
|
|
|
|
Templates may be used to apply a set of identical attributes to more than one
|
|
object:
|
|
|
|
template Service "generic-service" {
|
|
max_check_attempts = 3
|
|
check_interval = 5m
|
|
retry_interval = 1m
|
|
enable_perfdata = true
|
|
}
|
|
|
|
object Service "ping4" {
|
|
import "generic-service"
|
|
|
|
host_name = "localhost"
|
|
check_command = "ping4"
|
|
}
|
|
|
|
object Service "ping6" {
|
|
import "generic-service"
|
|
|
|
host_name = "localhost"
|
|
check_command = "ping6"
|
|
}
|
|
|
|
In this example the `ping4` and `ping6` services inherit properties from the
|
|
template `generic-service`.
|
|
|
|
Objects as well as templates themselves can import an arbitrary number of
|
|
templates. Attributes inherited from a template can be overridden in the
|
|
object if necessary.
|