mirror of https://github.com/Icinga/icinga2.git
parent
b7cdd1b3a5
commit
226d99dc57
|
@ -184,10 +184,10 @@ dictionary.
|
||||||
assign where host.name == "localhost"
|
assign where host.name == "localhost"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply ScheduledDowntime "backup-downtime" {
|
apply ScheduledDowntime "backup-downtime" to Service {
|
||||||
import "backup-downtime"
|
import "backup-downtime"
|
||||||
|
|
||||||
assign where service.host == "localhost" && service.short_name == "load"
|
assign where host.name == "localhost" && service.short_name == "load"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply Service "processes" {
|
apply Service "processes" {
|
||||||
|
|
|
@ -19,14 +19,14 @@ Here is an example of a host object which defines two child services:
|
||||||
check_command = "hostalive"
|
check_command = "hostalive"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply Service "ping4" {
|
object Service "ping4" {
|
||||||
|
host_name = "localhost"
|
||||||
check_command = "ping4"
|
check_command = "ping4"
|
||||||
assign where host.name == "my-server1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply Service "http" {
|
object Service "http" {
|
||||||
|
host_name = "localhost"
|
||||||
check_command = "http_ip"
|
check_command = "http_ip"
|
||||||
assign where host.name == "my-server1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
The example host `my-server1` creates two services which belong to this host:
|
The example host `my-server1` creates two services which belong to this host:
|
||||||
|
|
|
@ -71,9 +71,10 @@ free disk space).
|
||||||
vars.address6 = "::1"
|
vars.address6 = "::1"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply Service "disk" {
|
object Service "disk" {
|
||||||
import "generic-service"
|
import "generic-service"
|
||||||
|
|
||||||
|
host_name = "localhost"
|
||||||
check_command = "disk"
|
check_command = "disk"
|
||||||
|
|
||||||
vars.wfree = 10
|
vars.wfree = 10
|
||||||
|
|
|
@ -78,12 +78,11 @@ default values for some of the latency thresholds and timeouts.
|
||||||
When using the `my-ping` command you can override all or some of the custom
|
When using the `my-ping` command you can override all or some of the custom
|
||||||
attributes in the service definition like this:
|
attributes in the service definition like this:
|
||||||
|
|
||||||
apply Service "ping" {
|
object Service "ping" {
|
||||||
|
host_name = "localhost"
|
||||||
check_command = "my-ping"
|
check_command = "my-ping"
|
||||||
|
|
||||||
vars.packets = 10 // Overrides the default value of 5 given in the command
|
vars.packets = 10 // Overrides the default value of 5 given in the command
|
||||||
|
|
||||||
assign where host.name == "my-server1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
If a custom attribute isn't defined anywhere an empty value is used and a warning is
|
If a custom attribute isn't defined anywhere an empty value is used and a warning is
|
||||||
|
@ -94,14 +93,13 @@ emitted to the Icinga 2 log.
|
||||||
>
|
>
|
||||||
> By convention every host should have an `address` custom attribute. Hosts
|
> By convention every host should have an `address` custom attribute. Hosts
|
||||||
> which have an IPv6 address should also have an `address6` custom attribute.
|
> which have an IPv6 address should also have an `address6` custom attribute.
|
||||||
> This may also be mandatory requirement for using legacy interfaces, user interfaces
|
> This may also be mandatory requirement for using user interfaces and addons.
|
||||||
> and addons.
|
|
||||||
|
|
||||||
### <a id="runtime-custom-attribute-env-vars"></a> Runtime Custom Attributes as Environment Variables
|
### <a id="runtime-custom-attribute-env-vars"></a> Runtime Custom Attributes as Environment Variables
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
||||||
The `env` command object attribute requires a list of environment variables with values calculated
|
The `env` command object attribute specifies a list of environment variables with values calculated
|
||||||
from either runtime macros or custom attributes which should be exported as environment variables
|
from either runtime macros or custom attributes which should be exported as environment variables
|
||||||
prior to executing the command.
|
prior to executing the command.
|
||||||
|
|
||||||
|
@ -114,36 +112,16 @@ when passing credentials to database checks:
|
||||||
command = PluginDir + "/check_mysql -H $address$ -d $db$",
|
command = PluginDir + "/check_mysql -H $address$ -d $db$",
|
||||||
/* default custom attribute values */
|
/* default custom attribute values */
|
||||||
vars = {
|
vars = {
|
||||||
"MYSQLUSER" = "icinga_check",
|
mysql_user = "icinga_check",
|
||||||
"MYSQLPASS" = "1c1ng42r0xx"
|
mysql_pass = "password"
|
||||||
},
|
},
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
"MYSQLUSER" = "$MYSQLUSER$",
|
MYSQLUSER = "$mysql_user$",
|
||||||
"MYSQLPASS" = "$MYSQLPASS$"
|
MYSQLPASS = "$mysql_pass$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
### <a id="configuration-macros"></a> Configuration Macros
|
|
||||||
|
|
||||||
Icinga 2 allows you to define constants which can be used in a limited
|
|
||||||
scope. For example, constant expressions can reference a pre-defined global constant
|
|
||||||
variable and calculate a value for the service check interval.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
const MyCheckInterval = 10m
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
{
|
|
||||||
check_interval = MyCheckInterval / 2.5
|
|
||||||
}
|
|
||||||
|
|
||||||
More details in the chapter [Constant Expressions](#constant-expressions).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## <a id="runtime-macros"></a> Runtime Macros
|
## <a id="runtime-macros"></a> Runtime Macros
|
||||||
|
|
||||||
Next to custom attributes there are additional runtime macros made available by Icinga 2.
|
Next to custom attributes there are additional runtime macros made available by Icinga 2.
|
||||||
|
@ -156,25 +134,25 @@ external commands).
|
||||||
The following host custom attributes are available in all commands that are executed for
|
The following host custom attributes are available in all commands that are executed for
|
||||||
hosts or services:
|
hosts or services:
|
||||||
|
|
||||||
Name | Description
|
Name | Description
|
||||||
-----------------------|--------------
|
---------------------------|--------------
|
||||||
host.name | The name of the host object.
|
host.name | The name of the host object.
|
||||||
host.displayname | The value of the `display_name` attribute.
|
host.displayname | The value of the `display_name` attribute.
|
||||||
host.state | The host's current state. Can be one of `UNREACHABLE`, `UP` and `DOWN`.
|
host.state | The host's current state. Can be one of `UNREACHABLE`, `UP` and `DOWN`.
|
||||||
host.stateid | The host's current state. Can be one of `0` (up), `1` (down) and `2` (unreachable).
|
host.stateid | The host's current state. Can be one of `0` (up), `1` (down) and `2` (unreachable).
|
||||||
host.statetype | The host's current state type. Can be one of `SOFT` and `HARD`.
|
host.statetype | The host's current state type. Can be one of `SOFT` and `HARD`.
|
||||||
host.attempt | The current check attempt number.
|
host.attempt | The current check attempt number.
|
||||||
host.maxattempt | The maximum number of checks which are executed before changing to a hard state.
|
host.maxattempt | The maximum number of checks which are executed before changing to a hard state.
|
||||||
host.laststate | The host's previous state. Can be one of `UNREACHABLE`, `UP` and `DOWN`.
|
host.laststate | The host's previous state. Can be one of `UNREACHABLE`, `UP` and `DOWN`.
|
||||||
host.laststateid | The host's previous state. Can be one of `0` (up), `1` (down) and `2` (unreachable).
|
host.laststateid | The host's previous state. Can be one of `0` (up), `1` (down) and `2` (unreachable).
|
||||||
host.laststatetype | The host's previous state type. Can be one of `SOFT` and `HARD`.
|
host.laststatetype | The host's previous state type. Can be one of `SOFT` and `HARD`.
|
||||||
host.laststatechange | The last state change's timestamp.
|
host.laststatechange | The last state change's timestamp.
|
||||||
host.durationsec | The time since the last state change.
|
host.durationsec | The time since the last state change.
|
||||||
host.latency | The host's check latency.
|
host.latency | The host's check latency.
|
||||||
host.executiontime | The host's check execution time.
|
host.executiontime | The host's check execution time.
|
||||||
host.output | The last check's output.
|
host.output | The last check's output.
|
||||||
host.perfdata | The last check's performance data.
|
host.perfdata | The last check's performance data.
|
||||||
host.lastcheck | The timestamp when the last check was executed.
|
host.lastcheck | The timestamp when the last check was executed.
|
||||||
host.totalservices | Number of services associated with the host.
|
host.totalservices | Number of services associated with the host.
|
||||||
host.totalservicesok | Number of services associated with the host which are in an `OK` state.
|
host.totalservicesok | Number of services associated with the host which are in an `OK` state.
|
||||||
host.totalserviceswarning | Number of services associated with the host which are in a `WARNING` state.
|
host.totalserviceswarning | Number of services associated with the host which are in a `WARNING` state.
|
||||||
|
@ -186,28 +164,26 @@ hosts or services:
|
||||||
The following service macros are available in all commands that are executed for
|
The following service macros are available in all commands that are executed for
|
||||||
services:
|
services:
|
||||||
|
|
||||||
Name | Description
|
Name | Description
|
||||||
-----------------------|--------------
|
------------------------|--------------
|
||||||
service.description | The short name of the service object.
|
service.description | The short name of the service object.
|
||||||
service.displayname | The value of the `display_name` attribute.
|
service.displayname | The value of the `display_name` attribute.
|
||||||
service.checkcommand | This is an alias for the `SERVICEDISPLAYNAME` macro.
|
service.checkcommand | This is an alias for the `SERVICEDISPLAYNAME` macro.
|
||||||
service.state | The service's current state. Can be one of `OK`, `WARNING`, `CRITICAL` and `UNKNOWN`.
|
service.state | The service's current state. Can be one of `OK`, `WARNING`, `CRITICAL` and `UNKNOWN`.
|
||||||
service.stateid | The service's current state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown).
|
service.stateid | The service's current state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown).
|
||||||
service.statetype | The service's current state type. Can be one of `SOFT` and `HARD`.
|
service.statetype | The service's current state type. Can be one of `SOFT` and `HARD`.
|
||||||
service.attempt | The current check attempt number.
|
service.attempt | The current check attempt number.
|
||||||
service.maxattempt | The maximum number of checks which are executed before changing to a hard state.
|
service.maxattempt | The maximum number of checks which are executed before changing to a hard state.
|
||||||
service.laststate | The service's previous state. Can be one of `OK`, `WARNING`, `CRITICAL` and `UNKNOWN`.
|
service.laststate | The service's previous state. Can be one of `OK`, `WARNING`, `CRITICAL` and `UNKNOWN`.
|
||||||
service.laststateid | The service's previous state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown).
|
service.laststateid | The service's previous state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown).
|
||||||
service.laststatetype | The service's previous state type. Can be one of `SOFT` and `HARD`.
|
service.laststatetype | The service's previous state type. Can be one of `SOFT` and `HARD`.
|
||||||
service.laststatechange| The last state change's timestamp.
|
service.laststatechange | The last state change's timestamp.
|
||||||
service.durationsec | The time since the last state change.
|
service.durationsec | The time since the last state change.
|
||||||
service.latency | The service's check latency.
|
service.latency | The service's check latency.
|
||||||
service.executiontime | The service's check execution time.
|
service.executiontime | The service's check execution time.
|
||||||
service.output | The last check's output.
|
service.output | The last check's output.
|
||||||
service.perfdata | The last check's performance data.
|
service.perfdata | The last check's performance data.
|
||||||
service.lastcheck | The timestamp when the last check was executed.
|
service.lastcheck | The timestamp when the last check was executed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### <a id="user-runtime-macros"></a> User Runtime Macros
|
### <a id="user-runtime-macros"></a> User Runtime Macros
|
||||||
|
|
||||||
|
|
|
@ -115,13 +115,13 @@ TODO
|
||||||
|
|
||||||
Use the `apply` keyword to create `Notification` objects for your services:
|
Use the `apply` keyword to create `Notification` objects for your services:
|
||||||
|
|
||||||
apply Notification "mail" {
|
apply Notification "mail" to Service {
|
||||||
import "generic-notification"
|
import "generic-notification"
|
||||||
|
|
||||||
notification_command = "mail-notification"
|
notification_command = "mail-notification"
|
||||||
users = [ "icingaadmin" ]
|
users = [ "icingaadmin" ]
|
||||||
|
|
||||||
assign where service.short_name == "ping4"
|
assign where service.name == "ping4"
|
||||||
}
|
}
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
|
@ -193,15 +193,15 @@ If the problem does not get resolved or acknowledged preventing further notifica
|
||||||
the `escalation-sms-1st-level` user will be escalated `1h` after the initial problem was
|
the `escalation-sms-1st-level` user will be escalated `1h` after the initial problem was
|
||||||
notified, but only for one hour (`2h` as `end` key for the `times` dictionary).
|
notified, but only for one hour (`2h` as `end` key for the `times` dictionary).
|
||||||
|
|
||||||
apply Notification "mail" {
|
apply Notification "mail" to Service {
|
||||||
import "generic-notification"
|
import "generic-notification"
|
||||||
notification_command = "mail-notification"
|
notification_command = "mail-notification"
|
||||||
users = [ "icingaadmin" ]
|
users = [ "icingaadmin" ]
|
||||||
|
|
||||||
assign where service.short_name == "ping4"
|
assign where service.name == "ping4"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply Notification "escalation-sms-2nd-level" {
|
apply Notification "escalation-sms-2nd-level" to Service {
|
||||||
import "generic-notification"
|
import "generic-notification"
|
||||||
notification_command = "sms-notification"
|
notification_command = "sms-notification"
|
||||||
users = [ "icinga-oncall-2nd-level" ]
|
users = [ "icinga-oncall-2nd-level" ]
|
||||||
|
@ -210,9 +210,11 @@ notified, but only for one hour (`2h` as `end` key for the `times` dictionary).
|
||||||
begin = 30m
|
begin = 30m
|
||||||
end = 1h
|
end = 1h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assign where service.name == "ping4"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply Notification "escalation-sms-1st-level" {
|
apply Notification "escalation-sms-1st-level" to Service {
|
||||||
import "generic-notification"
|
import "generic-notification"
|
||||||
notification_command = "sms-notification"
|
notification_command = "sms-notification"
|
||||||
users = [ "icinga-oncall-1st-level" ]
|
users = [ "icinga-oncall-1st-level" ]
|
||||||
|
@ -221,6 +223,8 @@ notified, but only for one hour (`2h` as `end` key for the `times` dictionary).
|
||||||
begin = 1h
|
begin = 1h
|
||||||
end = 2h
|
end = 2h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assign where service.name == "ping4"
|
||||||
}
|
}
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
|
@ -238,12 +242,14 @@ dictionary and set `begin = 15m` as key and value if you want to suppress notifi
|
||||||
in the first 15 minutes. Leave out the `end` key - if not set, Icinga 2 will not check against any
|
in the first 15 minutes. Leave out the `end` key - if not set, Icinga 2 will not check against any
|
||||||
end time for this notification.
|
end time for this notification.
|
||||||
|
|
||||||
apply Notification "mail" {
|
apply Notification "mail" to Service {
|
||||||
import "generic-notification"
|
import "generic-notification"
|
||||||
notification_command = "mail-notification"
|
notification_command = "mail-notification"
|
||||||
users = [ "icingaadmin" ]
|
users = [ "icingaadmin" ]
|
||||||
|
|
||||||
times.begin = 15m // delay first notification
|
times.begin = 15m // delay first notification
|
||||||
|
|
||||||
|
assign where service.name == "ping4"
|
||||||
}
|
}
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
|
|
|
@ -23,7 +23,6 @@ Then add your hosts to this hostgroup
|
||||||
object Host "mssql-srv2" {
|
object Host "mssql-srv2" {
|
||||||
groups = [ "windows" ]
|
groups = [ "windows" ]
|
||||||
vars.mssql_port = 1433
|
vars.mssql_port = 1433
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
> **Best Practice**
|
> **Best Practice**
|
||||||
|
@ -35,7 +34,6 @@ Then add your hosts to this hostgroup
|
||||||
template Host "windows-mssql-template" {
|
template Host "windows-mssql-template" {
|
||||||
groups = [ "windows" ]
|
groups = [ "windows" ]
|
||||||
vars.mssql_port = 1433
|
vars.mssql_port = 1433
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object Host "mssql-srv1" {
|
object Host "mssql-srv1" {
|
||||||
|
|
|
@ -63,10 +63,10 @@ create a new timeperiod named `workhours` defining a work day with
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Assign the timeperiod as `notification_period` to the `Notification`
|
Use the `notification_period` attribute to assign time periods to
|
||||||
object then.
|
`Notification` objects:
|
||||||
|
|
||||||
apply Notification "mail" {
|
apply Notification "mail" to Host {
|
||||||
import "generic-notification"
|
import "generic-notification"
|
||||||
|
|
||||||
notification_command = "mail-notification"
|
notification_command = "mail-notification"
|
||||||
|
|
|
@ -12,5 +12,3 @@ events being triggered.
|
||||||
Common use case scenarios are a failing HTTP check requiring an immediate
|
Common use case scenarios are a failing HTTP check requiring an immediate
|
||||||
restart via event command, or if an application is locked and requires
|
restart via event command, or if an application is locked and requires
|
||||||
a restart upon detection.
|
a restart upon detection.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,8 @@ You can enable the feature using
|
||||||
|
|
||||||
# icinga2-enable-feature graphite
|
# icinga2-enable-feature graphite
|
||||||
|
|
||||||
The `GraphiteWriter` object expects the Graphite Carbon Cache socket listening
|
By default the `GraphiteWriter` object expects the Graphite Carbon Cache to listen at
|
||||||
at `127.0.0.1` on port `2003` by default.
|
`127.0.0.1` on port `2003`.
|
||||||
|
|
||||||
The current naming schema is
|
The current naming schema is
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ in Icinga 2 provided with the `CompatLogger` object.
|
||||||
|
|
||||||
These logs are not only used for informational representation in
|
These logs are not only used for informational representation in
|
||||||
external web interfaces parsing the logs, but also to generate
|
external web interfaces parsing the logs, but also to generate
|
||||||
sla reports and trends in Icinga 1.x Classic UI. Futhermore the
|
SLA reports and trends in Icinga 1.x Classic UI. Futhermore the
|
||||||
`Livestatus` feature uses these logs for answering queries to
|
`Livestatus` feature uses these logs for answering queries to
|
||||||
historical tables.
|
historical tables.
|
||||||
|
|
||||||
|
|
|
@ -16,4 +16,3 @@ on-demand in your Icinga 2 objects configuration.
|
||||||
object CheckResultReader "reader" {
|
object CheckResultReader "reader" {
|
||||||
spool_dir = "/data/check-results"
|
spool_dir = "/data/check-results"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ for specific use cases already around, for example monitoring Cisco routers.
|
||||||
|
|
||||||
The following example uses the [SNMP ITL](#itl-snmp) `CheckCommand` and just
|
The following example uses the [SNMP ITL](#itl-snmp) `CheckCommand` and just
|
||||||
overrides the `oid` custom attribute. A service is created for all hosts which
|
overrides the `oid` custom attribute. A service is created for all hosts which
|
||||||
have the `community` custom attribute set.
|
have the `community` custom attribute.
|
||||||
|
|
||||||
apply Service "uptime" {
|
apply Service "uptime" {
|
||||||
import "generic-service"
|
import "generic-service"
|
||||||
|
|
|
@ -376,7 +376,7 @@ once they are set.
|
||||||
The `apply` keyword can be used to create new objects which are associated with
|
The `apply` keyword can be used to create new objects which are associated with
|
||||||
another group of objects.
|
another group of objects.
|
||||||
|
|
||||||
apply Service "ping" {
|
apply Service "ping" to Host {
|
||||||
import "generic-service"
|
import "generic-service"
|
||||||
|
|
||||||
check_command = "ping4"
|
check_command = "ping4"
|
||||||
|
@ -388,15 +388,21 @@ In this example the `assign where` condition is a boolean expression which is
|
||||||
evaluated for all objects of type `Host` and a new service with name "ping"
|
evaluated for all objects of type `Host` and a new service with name "ping"
|
||||||
is created for each matching host.
|
is created for each matching host.
|
||||||
|
|
||||||
|
The `to` keyword and the target type may be omitted if there is only target
|
||||||
|
type, e.g. for the `Service` type.
|
||||||
|
|
||||||
Depending on the object type used in the `apply` expression additional local
|
Depending on the object type used in the `apply` expression additional local
|
||||||
variables may be available for use in the `where` condition:
|
variables may be available for use in the `where` condition:
|
||||||
|
|
||||||
Source Type | Target Type | Variables
|
Source Type | Target Type | Variables
|
||||||
-----------------|-------------|--------------
|
------------------|-------------|--------------
|
||||||
Service | Host | host
|
Service | Host | host
|
||||||
Dependency | Service | host, service
|
Dependency | Host | host
|
||||||
Notification | Service | host, service
|
Dependency | Service | host, service
|
||||||
ScheduledDowntime| Service | host, service
|
Notification | Host | host
|
||||||
|
Notification | Service | host, service
|
||||||
|
ScheduledDowntime | Host | host
|
||||||
|
ScheduledDowntime | Service | host, service
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
|
|
|
@ -19,9 +19,24 @@ Attributes:
|
||||||
Name |Description
|
Name |Description
|
||||||
----------------|----------------
|
----------------|----------------
|
||||||
display_name |**Optional.** A short description of the host.
|
display_name |**Optional.** A short description of the host.
|
||||||
check |**Optional.** A service that is used to determine whether the host is up or down. This must be a service short name of a service that belongs to the host.
|
|
||||||
groups |**Optional.** A list of host groups this host belongs to.
|
groups |**Optional.** A list of host groups this host belongs to.
|
||||||
vars |**Optional.** A dictionary containing custom attributes that are specific to this host.
|
vars |**Optional.** A dictionary containing custom attributes that are specific to this host.
|
||||||
|
check\_command |**Required.** The name of the check command.
|
||||||
|
max\_check\_attempts|**Optional.** The number of times a host is re-checked before changing into a hard state. Defaults to 3.
|
||||||
|
check\_period |**Optional.** The name of a time period which determines when this host should be checked. Not set by default.
|
||||||
|
check\_interval |**Optional.** The check interval (in seconds). This interval is used for checks when the host is in a `HARD` state. Defaults to 5 minutes.
|
||||||
|
retry\_interval |**Optional.** The retry interval (in seconds). This interval is used for checks when the host is in a `SOFT` state. Defaults to 1 minute.
|
||||||
|
enable\_notifications|**Optional.** Whether notifications are enabled. Defaults to true.
|
||||||
|
enable\_active\_checks|**Optional.** Whether active checks are enabled. Defaults to true.
|
||||||
|
enable\_passive\_checks|**Optional.** Whether passive checks are enabled. Defaults to true.
|
||||||
|
enable\_event\_handler|**Optional.** Enables event handlers for this host. Defaults to true.
|
||||||
|
enable\_flap\_detection|**Optional.** Whether flap detection is enabled. Defaults to true.
|
||||||
|
enable\_perfdata|**Optional.** Whether performance data processing is enabled. Defaults to true.
|
||||||
|
event\_command |**Optional.** The name of an event command that should be executed every time the host's state changes.
|
||||||
|
flapping\_threshold|**Optional.** The flapping threshold in percent when a host is considered to be flapping.
|
||||||
|
volatile |**Optional.** The volatile setting enables always `HARD` state types if `NOT-OK` state changes occur.
|
||||||
|
authorities |**Optional.** A list of Endpoints on which this host check will be executed in a cluster scenario.
|
||||||
|
domains |**Optional.** A list of Domains for this host object in a cluster scenario.
|
||||||
|
|
||||||
### <a id="objecttype-hostgroup"></a> HostGroup
|
### <a id="objecttype-hostgroup"></a> HostGroup
|
||||||
|
|
||||||
|
@ -52,9 +67,8 @@ by Icinga 2.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
object Service "localhost-uptime" {
|
object Service "uptime" {
|
||||||
host_name = "localhost"
|
host_name = "localhost"
|
||||||
name = "uptime"
|
|
||||||
|
|
||||||
display_name = "localhost Uptime"
|
display_name = "localhost Uptime"
|
||||||
|
|
||||||
|
@ -77,25 +91,9 @@ Attributes:
|
||||||
----------------|----------------
|
----------------|----------------
|
||||||
host_name |**Required.** The host this service belongs to. There must be a `Host` object with that name.
|
host_name |**Required.** The host this service belongs to. There must be a `Host` object with that name.
|
||||||
name |**Required.** The service name. Must be unique on a per-host basis (Similar to the service_description attribute in Icinga 1.x).
|
name |**Required.** The service name. Must be unique on a per-host basis (Similar to the service_description attribute in Icinga 1.x).
|
||||||
display_name |**Optional.** A short description of the service.
|
|
||||||
vars |**Optional.** A dictionary containing custom attributes that are specific to this host.
|
|
||||||
check\_command |**Required.** The name of the check command.
|
|
||||||
max\_check\_attempts|**Optional.** The number of times a service is re-checked before changing into a hard state. Defaults to 3.
|
|
||||||
check\_period |**Optional.** The name of a time period which determines when this service should be checked. Not set by default.
|
|
||||||
check\_interval |**Optional.** The check interval (in seconds). This interval is used for checks when the service is in a `HARD` state. Defaults to 5 minutes.
|
|
||||||
retry\_interval |**Optional.** The retry interval (in seconds). This interval is used for checks when the service is in a `SOFT` state. Defaults to 1 minute.
|
|
||||||
enable\_notifications|**Optional.** Whether notifications are enabled. Defaults to true.
|
|
||||||
enable\_active\_checks|**Optional.** Whether active checks are enabled. Defaults to true.
|
|
||||||
enable\_passive\_checks|**Optional.** Whether passive checks are enabled. Defaults to true.
|
|
||||||
enable\_event\_handler|**Optional.** Enables event handlers for this service. Defaults to true.
|
|
||||||
enable\_flap\_detection|**Optional.** Whether flap detection is enabled. Defaults to true.
|
|
||||||
enable\_perfdata|**Optional.** Whether performance data processing is enabled. Defaults to true.
|
|
||||||
event\_command |**Optional.** The name of an event command that should be executed every time the service's state changes.
|
|
||||||
flapping\_threshold|**Optional.** The flapping threshold in percent when a service is considered to be flapping.
|
|
||||||
volatile |**Optional.** The volatile setting enables always `HARD` state types if `NOT-OK` state changes occur.
|
|
||||||
groups |**Optional.** The service groups this service belongs to.
|
groups |**Optional.** The service groups this service belongs to.
|
||||||
authorities |**Optional.** A list of Endpoints on which this service check will be executed in a cluster scenario.
|
|
||||||
domains |**Optional.** A list of Domains for this service object in a cluster scenario.
|
In addition to these attributes you can also use any of the attributes which are also valid for `Host` objects.
|
||||||
|
|
||||||
### <a id="objecttype-servicegroup"></a> ServiceGroup
|
### <a id="objecttype-servicegroup"></a> ServiceGroup
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ recurring downtimes for services.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
apply ScheduledDowntime "backup-downtime" {
|
apply ScheduledDowntime "backup-downtime" to Service {
|
||||||
author = "icingaadmin"
|
author = "icingaadmin"
|
||||||
comment = "Scheduled downtime for backup"
|
comment = "Scheduled downtime for backup"
|
||||||
|
|
||||||
|
@ -89,4 +89,3 @@ Example:
|
||||||
|
|
||||||
assign where "backup" in service.groups
|
assign where "backup" in service.groups
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,17 +17,20 @@ from the `icinga-node-dmz-1` endpoint.
|
||||||
|
|
||||||
object Host "dmz-host1" {
|
object Host "dmz-host1" {
|
||||||
import "generic-host"
|
import "generic-host"
|
||||||
|
}
|
||||||
|
|
||||||
services["dmz-oracledb"] = {
|
object Service "dmz-oracledb" {
|
||||||
templates = [ "generic-service" ]
|
import "generic-service"
|
||||||
domains = [ "dmz-db" ]
|
|
||||||
authorities = [ "icinga-node-dmz-1", "icinga-node-dmz-2"]
|
host_name = "dmz-host1"
|
||||||
}
|
|
||||||
|
domains = [ "dmz-db" ]
|
||||||
|
authorities = [ "icinga-node-dmz-1", "icinga-node-dmz-2"]
|
||||||
}
|
}
|
||||||
|
|
||||||
object Domain "dmz-db" {
|
object Domain "dmz-db" {
|
||||||
acl = {
|
acl = {
|
||||||
icinga-node-dmz-1 = DomainPrivReadOnly
|
"icinga-node-dmz-1" = DomainPrivReadOnly
|
||||||
icinga-node-dmz-2 = DomainPrivReadWrite
|
"icinga-node-dmz-2" = DomainPrivReadWrite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ be suppressed. This is achieved by setting the `disable_checks` attribute to `tr
|
||||||
assign where host.vars.address
|
assign where host.vars.address
|
||||||
}
|
}
|
||||||
|
|
||||||
apply Dependency "internet" {
|
apply Dependency "internet" to Service {
|
||||||
parent_host = "dsl-router"
|
parent_host = "dsl-router"
|
||||||
disable_checks = true
|
disable_checks = true
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,9 @@ services) like in Icinga 1.x but directly after their type definition.
|
||||||
service_description ping4
|
service_description ping4
|
||||||
}
|
}
|
||||||
|
|
||||||
object Service "localhost-ping4" { }
|
object Service "ping4" {
|
||||||
|
host_name = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
## <a id="differences-1x-2-templates"></a> Templates
|
## <a id="differences-1x-2-templates"></a> Templates
|
||||||
|
|
||||||
|
@ -153,7 +155,7 @@ requires an equal sign (=) between them.
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
> Please note that the default time value is seconds, if no duration literal
|
> Please note that the default time value is seconds, if no duration literal
|
||||||
> is given. check_interval = 5 behaves the same as check_interval = 5s.
|
> is given. `check_interval = 5` behaves the same as `check_interval = 5s`.
|
||||||
|
|
||||||
All strings require double quotes in Icinga 2. Therefore a double-quote
|
All strings require double quotes in Icinga 2. Therefore a double-quote
|
||||||
must be escaped with a backslash (e.g. in command line).
|
must be escaped with a backslash (e.g. in command line).
|
||||||
|
@ -212,7 +214,6 @@ TODO
|
||||||
> If you are planning to access custom variables as runtime macros you may access
|
> If you are planning to access custom variables as runtime macros you may access
|
||||||
> them with `_HOST`name as known from Icinga 1.x
|
> them with `_HOST`name as known from Icinga 1.x
|
||||||
|
|
||||||
|
|
||||||
## <a id="differences-1x-2-host-service-relation"></a> Host Service Relation
|
## <a id="differences-1x-2-host-service-relation"></a> Host Service Relation
|
||||||
|
|
||||||
In Icinga 1.x a service object is associated with a host by defining the
|
In Icinga 1.x a service object is associated with a host by defining the
|
||||||
|
|
|
@ -21,8 +21,6 @@ The Vagrant VM is based on CentOS 6.4 and uses the official Icinga 2 RPM
|
||||||
packages from `packages.icinga.org`. The check plugins are installed from
|
packages from `packages.icinga.org`. The check plugins are installed from
|
||||||
EPEL providing RPMs with sources from the Monitoring Plugins project.
|
EPEL providing RPMs with sources from the Monitoring Plugins project.
|
||||||
|
|
||||||
SSH login is available using `vagrant ssh`.
|
|
||||||
|
|
||||||
## <a id="vagrant-demo-guis"></a> Demo GUIs
|
## <a id="vagrant-demo-guis"></a> Demo GUIs
|
||||||
|
|
||||||
In addition to installing Icinga 2 the Vagrant puppet modules also install the
|
In addition to installing Icinga 2 the Vagrant puppet modules also install the
|
||||||
|
|
Loading…
Reference in New Issue