2014-02-05 15:53:22 +01:00
## <a id="object-types"></a> Object Types
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-host"></a> Host
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
A host.
> **Note**
>
2013-10-01 15:59:25 +02:00
> Unlike in Icinga 1.x hosts are not checkable objects in Icinga 2. Instead
2013-10-07 09:35:44 +02:00
> hosts inherit their state from the service that is specified using the `check`
2013-10-01 15:59:25 +02:00
> attribute.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
object Host "localhost" {
display_name = "The best host there is",
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
groups = [ "all-hosts" ],
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
host_dependencies = [ "router" ],
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
service_dependencies = [
{ host = "db-server", service = "mysql" }
],
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
services["ping"] = {
templates = [ "ping" ]
},
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
services["http"] = {
templates = [ "my-http" ],
macros = {
vhost = "test1.example.org",
port = 81
}
2013-10-01 15:33:34 +02:00
},
check = "ping"
2013-09-26 08:59:29 +02:00
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
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.
host_dependencies|**Optional.** A list of host names which this host depends on. These dependencies are used to determine whether the host is unreachable.
service_dependencies|**Optional.** A list of services which this host depends on. Each array element must be a dictionary containing the keys "host" and "service". These dependencies are used to determine whether the host is unreachable.
2014-01-15 20:44:26 +01:00
services |**Optional.** Inline definition of services. Each dictionary item specifies a service.< br />< br /> The `templates` attribute can be used to specify an array of templates that should be inherited by the service.< br />< br /> The new service's name is "hostname!service" - where "service" is the dictionary key in the services dictionary.< br />< br /> The dictionary key is used as the service's short name.
2013-10-01 15:33:34 +02:00
macros |**Optional.** A dictionary containing macros that are specific to this host.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-hostgroup"></a> HostGroup
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
A group of hosts.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
object HostGroup "my-hosts" {
display_name = "My hosts",
2013-09-26 08:59:29 +02:00
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
display_name |**Optional.** A short description of the host group.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-service"></a> Service
2013-09-26 08:59:29 +02:00
Service objects describe network services and how they should be checked
by Icinga 2.
> **Best Practice**
>
2013-10-07 09:35:44 +02:00
> Rather than creating a `Service` object for a specific host it is usually easier
> to just create a `Service` template and using the `services` attribute in the `Host`
2013-09-26 08:59:29 +02:00
> object to associate these templates with a host.
Example:
object Service "localhost-uptime" {
host = "localhost",
short_name = "uptime",
display_name = "localhost Uptime",
check_command = "check_snmp",
macros = {
community = "public",
oid = "DISMAN-EVENT-MIB::sysUpTimeInstance"
}
check_interval = 60s,
retry_interval = 15s,
servicegroups = [ "all-services", "snmp" ],
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-10-07 09:35:44 +02:00
host |**Required.** The host this service belongs to. There must be a `Host` object with that name.
2013-09-26 08:59:29 +02:00
short_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.
2013-10-01 15:33:34 +02:00
macros |**Optional.** A dictionary containing macros that are specific to this host.
2013-09-26 08:59:29 +02:00
check\_command |**Required.** The name of the check command.
2013-10-01 12:59:02 +02:00
max\_check\_attempts|**Optional.** The number of times a service is re-checked before changing into a hard state. Defaults to 3.
2013-09-27 07:19:13 +02:00
check\_period |**Optional.** The name of a time period which determines when this service should be checked. Not set by default.
2013-10-07 09:35:44 +02:00
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.
2013-10-26 09:41:45 +02:00
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.
2013-11-26 13:55:07 +01:00
enable\_notifications|**Optional.** Whether notifications are enabled. Defaults to true.
2013-10-16 13:20:20 +02:00
enable\_active\_checks|**Optional.** Whether active checks are enabled. Defaults to true.
enable\_passive\_checks|**Optional.** Whether passive checks are enabled. Defaults to true.
2013-10-16 15:20:14 +02:00
enable\_event\_handler|**Optional.** Enables event handlers for this service. Defaults to true.
2013-11-26 13:55:07 +01:00
enable\_flap\_detection|**Optional.** Whether flap detection is enabled. Defaults to true.
enable\_perfdata|**Optional.** Whether performance data processing is enabled. Defaults to true.
2013-09-27 07:19:13 +02:00
event\_command |**Optional.** The name of an event command that should be executed every time the service's state changes.
2013-10-18 20:05:08 +02:00
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.
2013-10-01 12:59:02 +02:00
host_dependencies|**Optional.** A list of host names which this host depends on. These dependencies are used to determine whether the host is unreachable.
service_dependencies|**Optional.** A list of services which this host depends on. Each array element must be a dictionary containing the keys "host" and "service". These dependencies are used to determine whether the host is unreachable.
2013-09-26 08:59:29 +02:00
groups |**Optional.** The service groups this service belongs to.
2013-10-07 09:35:44 +02:00
notifications |**Optional.** Inline definition of notifications. Each dictionary item specifies a notification.< br />< br /> The `templates` attribute can be used to specify an array of templates that should be inherited by the notification object.< br />< br /> The new notification object's name is "hostname:service:notification" - where "notification" is the dictionary key in the notifications dictionary.
2014-01-24 14:20:37 +01:00
authorities |**Optional.** A list of Endpoints on which this service check will be executed in a cluster scenario.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-servicegroup"></a> ServiceGroup
2013-09-26 08:59:29 +02:00
A group of services.
Example:
object ServiceGroup "snmp" {
display_name = "SNMP services",
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
display_name |**Optional.** A short description of the service group.
2013-10-11 18:13:49 +02:00
### <a id="objecttype-notification"></a> Notification
2013-09-26 08:59:29 +02:00
2013-10-01 15:33:34 +02:00
Notification objects are used to specify how users should be notified in case
of service state changes and other events.
> **Best Practice**
>
2013-10-07 09:35:44 +02:00
> Rather than creating a `Notification` object for a specific service it is usually easier
> to just create a `Notification` template and using the `notifications` attribute in the `Service`
2013-10-01 15:33:34 +02:00
> object to associate these templates with a service.
2013-09-26 08:59:29 +02:00
Example:
2013-10-01 15:33:34 +02:00
object Notification "localhost-ping-notification" {
host = "localhost",
service = "ping4",
notification_command = "mail-notification",
users = [ "user1", "user2" ]
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
host |**Required.** The name of the host this notification belongs to.
service |**Required.** The short name of the service this notification belongs to.
2013-10-01 15:33:34 +02:00
macros |**Optional.** A dictionary containing macros that are specific to this notification object.
2013-09-27 07:19:13 +02:00
users |**Optional.** A list of user names who should be notified.
user_groups |**Optional.** A list of user group names who should be notified.
2013-10-18 20:05:08 +02:00
times |**Optional.** A dictionary containing `begin` and `end` attributes for the notification.
notification_command|**Required.** The name of the notification command which should be executed when the notification is triggered.
notification_interval|**Optional.** The notification interval (in seconds). This interval is used for active notifications. Defaults to 5 minutes.
notification_period|**Optional.** The name of a time period which determines when this notification should be triggered. Not set by default.
notification_type_filter|**Optional.** A set of state filters when this notification should be triggered. By default everything is matched.
notification_state_filter|**Optional.** A set of type filters when this notification should be triggered. By default everything is matched.
Available notification type and state filters:
StateFilterOK
StateFilterWarning
StateFilterCritical
StateFilterUnknown
NotificationFilterDowntimeStart
NotificationFilterDowntimeEnd
NotificationFilterDowntimeRemoved
NotificationFilterCustom
NotificationFilterAcknowledgement
NotificationFilterProblem
NotificationFilterRecovery
NotificationFilterFlappingStart
NotificationFilterFlappingEnd
> **Note**
>
> In order to notify on problem states, you will need the type filter `NotificationFilterProblem`.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-user"></a> User
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
A user.
2013-09-26 08:59:29 +02:00
Example:
2013-10-17 18:12:52 +02:00
object User "icingaadmin" {
display_name = "Icinga 2 Admin",
groups = [ "icingaadmins" ],
enable_notifications = 1,
notification_period = "24x7",
notification_state_filter = (StateFilterWarning |
StateFilterCritical |
StateFilterUnknown),
notification_type_filter = (NotificationFilterProblem |
NotificationFilterRecovery),
macros = {
"name" = "Icinga 2 Admin",
"email" = "icinga@localhost",
"pager" = "icingaadmin@localhost.localdomain"
},
custom = {
notes = "This is the Icinga 2 Admin account.",
}
}
2013-10-18 20:05:08 +02:00
Available notification type and state filters:
StateFilterOK
StateFilterWarning
StateFilterCritical
StateFilterUnknown
NotificationFilterDowntimeStart
NotificationFilterDowntimeEnd
NotificationFilterDowntimeRemoved
NotificationFilterCustom
NotificationFilterAcknowledgement
NotificationFilterProblem
NotificationFilterRecovery
NotificationFilterFlappingStart
NotificationFilterFlappingEnd
> **Note**
>
> In order to notify on problem states, you will need the type filter `NotificationFilterProblem`.
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
display_name |**Optional.** A short description of the user.
2013-10-01 15:33:34 +02:00
macros |**Optional.** A dictionary containing macros that are specific to this user.
2013-10-17 18:12:52 +02:00
custom |**Optional.** A dictionary containing custom attributes that are specific to this user.
2013-10-18 15:10:34 +02:00
groups |**Optional.** An array of group names.
enable_notifications|**Optional.** Whether notifications are enabled for this user.
2013-10-18 20:05:08 +02:00
notification_period|**Optional.** The name of a time period which determines when this notification should be triggered. Not set by default.
notification_type_filter|**Optional.** A set of state filters when this notification should be triggered. By default everything is matched.
notification_state_filter|**Optional.** A set of type filters when this notification should be triggered. By default everything is matched.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-usergroup"></a> UserGroup
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
A user group.
2013-09-26 08:59:29 +02:00
Example:
2013-10-17 18:12:52 +02:00
object UserGroup "icingaadmins" {
display_name = "Icinga 2 Admin Group"
2013-09-27 07:19:13 +02:00
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
display_name |**Optional.** A short description of the user group.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-timeperiod"></a> TimePeriod
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Time periods can be used to specify when services should be checked or to limit
when notifications should be sent out.
2013-09-26 08:59:29 +02:00
Example:
2013-10-15 22:50:07 +02:00
object TimePeriod "24x7" inherits "legacy-timeperiod" {
display_name = "Icinga 2 24x7 TimePeriod",
ranges = {
"monday" = "00:00-24:00",
"tuesday" = "00:00-24:00",
"wednesday" = "00:00-24:00",
"thursday" = "00:00-24:00",
"friday" = "00:00-24:00",
"saturday" = "00:00-24:00",
"sunday" = "00:00-24:00",
}
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
display_name |**Optional.** A short description of the time period.
2013-10-01 15:33:34 +02:00
methods |**Required.** The "update" script method takes care of updating the internal representation of the time period. In virtually all cases you should just inherit from the "legacy-timeperiod" template to take care of this setting.
2013-10-18 20:05:08 +02:00
ranges |**Required.** A dictionary containing information which days and durations apply to this timeperiod.
2013-09-26 08:59:29 +02:00
2013-10-15 22:50:07 +02:00
The `/etc/icinga2/conf.d/timeperiods.conf` file is usually used to define
timeperiods including this one.
2013-11-13 14:56:31 +01:00
### <a id="objecttype-scheduleddowntime"></a> ScheduledDowntime
ScheduledDowntime objects can be used to set up recurring downtimes for services.
> **Best Practice**
>
> Rather than creating a `ScheduledDowntime` object for a specific service it is usually easier
> to just create a `ScheduledDowntime` template and using the `scheduled_downtimes` attribute in the `Service`
> object to associate these templates with a service.
Example:
object ScheduledDowntime "some-downtime" {
host = "localhost",
service = "ping4",
author = "icingaadmin",
comment = "Some comment",
fixed = false,
duration = 30m,
ranges = {
"sunday" = "02:00-03:00"
}
}
Attributes:
Name |Description
----------------|----------------
host |**Required.** The name of the host this notification belongs to.
service |**Required.** The short name of the service this notification belongs to.
author |**Required.** The author of the downtime.
comment |**Required.** A comment for the downtime.
fixed |**Optional.** Whether this is a fixed downtime. Defaults to true.
duration |**Optional.** How long the downtime lasts. Only has an effect for flexible (non-fixed) downtimes.
ranges |**Required.** A dictionary containing information which days and durations apply to this timeperiod.
2013-10-15 22:50:07 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-filelogger"></a> FileLogger
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Specifies Icinga 2 logging to a file.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
object FileLogger "my-debug-file" {
severity = "debug",
path = "/var/log/icinga2/icinga2-debug.log"
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
path |**Required.** The log path.
severity |**Optional.** The minimum severity for this log. Can be "debug", "information", "warning" or "critical". Defaults to "information".
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-sysloglogger"></a> SyslogLogger
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Specifies Icinga 2 logging to syslog.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
object SyslogLogger "my-crit-syslog" {
severity = "critical"
}
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Attributes:
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Name |Description
----------------|----------------
severity |**Optional.** The minimum severity for this log. Can be "debug", "information", "warning" or "critical". Defaults to "information".
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-checkcommand"></a> CheckCommand
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
A check command definition. Additional default command macros can be
defined here.
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Example:
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
object CheckCommand "check_snmp" inherits "plugin-check-command" {
command = "$plugindir$/check_snmp -H $address$ -C $community$ -o $oid$",
macros = {
address = "127.0.0.1",
community = "public",
2013-09-26 08:59:29 +02:00
}
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-10-01 15:33:34 +02:00
methods |**Required.** The "execute" script method takes care of executing the check. In virtually all cases you should just inherit from the "plugin-check-command" template to take care of this setting.
command |**Required.** The command. This can either be an array of individual command arguments. Alternatively a string can be specified in which case the shell interpreter (usually /bin/sh) takes care of parsing the command.
export_macros |**Optional.** A list of macros which should be exported as environment variables prior to executing the command.
escape_macros |**Optional.** A list of macros which should be shell-escaped in the command.
macros |**Optional.** A dictionary containing macros that are specific to this command.
timeout |**Optional.** The command timeout in seconds. Defaults to 5 minutes.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-notificationcommand"></a> NotificationCommand
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
A notification command definition.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
2014-01-15 21:04:01 +01:00
command = [ (IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh") ],
export_macros = [
"NOTIFICATIONTYPE",
"SERVICEDESC",
"HOSTALIAS",
"HOSTADDRESS",
"SERVICESTATE",
"LONGDATETIME",
"SERVICEOUTPUT",
"NOTIFICATIONAUTHORNAME",
"NOTIFICATIONCOMMENT",
"HOSTDISPLAYNAME",
"SERVICEDISPLAYNAME",
"USEREMAIL"
2013-09-27 07:19:13 +02:00
]
2013-09-26 08:59:29 +02:00
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-10-01 15:33:34 +02:00
methods |**Required.** The "execute" script method takes care of executing the notification. In virtually all cases you should just inherit from the "plugin-notification-command" template to take care of this setting.
command |**Required.** The command. This can either be an array of individual command arguments. Alternatively a string can be specified in which case the shell interpreter (usually /bin/sh) takes care of parsing the command.
export_macros |**Optional.** A list of macros which should be exported as environment variables prior to executing the command.
escape_macros |**Optional.** A list of macros which should be shell-escaped in the command.
macros |**Optional.** A dictionary containing macros that are specific to this command.
timeout |**Optional.** The command timeout in seconds. Defaults to 5 minutes.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-eventcommand"></a> EventCommand
2013-09-27 07:19:13 +02:00
An event command definition.
> **Note**
>
> Similar to Icinga 1.x event handlers.
Example:
object EventCommand "restart-httpd-event" inherits "plugin-event-command" {
command = "/opt/bin/restart-httpd.sh",
}
Attributes:
Name |Description
----------------|----------------
2013-10-01 15:33:34 +02:00
methods |**Required.** The "execute" script method takes care of executing the event handler. In virtually all cases you should just inherit from the "plugin-event-command" template to take care of this setting.
command |**Required.** The command. This can either be an array of individual command arguments. Alternatively a string can be specified in which case the shell interpreter (usually /bin/sh) takes care of parsing the command.
export_macros |**Optional.** A list of macros which should be exported as environment variables prior to executing the command.
escape_macros |**Optional.** A list of macros which should be shell-escaped in the command.
macros |**Optional.** A dictionary containing macros that are specific to this command.
timeout |**Optional.** The command timeout in seconds. Defaults to 5 minutes.
2013-09-27 07:19:13 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-perfdatawriter"></a> PerfdataWriter
2013-09-26 08:59:29 +02:00
Writes check result performance data to a defined path using macro
pattern.
2013-10-14 20:12:42 +02:00
Example:
library "perfdata"
2013-09-26 08:59:29 +02:00
object PerfdataWriter "pnp" {
perfdata_path = "/var/spool/icinga2/perfdata/service-perfdata",
format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$",
rotation_interval = 15s,
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-11-17 20:01:23 +01:00
perfdata\_path |**Optional.** Path to the service performance data file. Defaults to IcingaLocalStateDir + "/spool/icinga2/perfdata/perfdata".
2013-11-21 07:17:34 +01:00
temp\_path |**Optional.** Path to the temporary file. Defaults to IcingaLocalStateDir + "/spool/icinga2/tmp/perfdata".
2013-10-01 15:33:34 +02:00
format\_template|**Optional.** Format template for the performance data file. Defaults to a template that's suitable for use with PNP4Nagios.
2013-10-07 09:35:44 +02:00
rotation\_interval|**Optional.** Rotation interval for the file specified in `perfdata\_path` . Defaults to 30 seconds.
2013-09-26 08:59:29 +02:00
> **Note**
>
2013-10-01 15:33:34 +02:00
> When rotating the performance data file the current UNIX timestamp is appended to the path specified
2013-10-07 09:35:44 +02:00
> in `perfdata\_path` to generate a unique filename.
2013-09-26 08:59:29 +02:00
2013-10-14 20:12:42 +02:00
### <a id="objecttype-graphitewriter"></a> GraphiteWriter
Writes check result metrics and performance data to a defined
Graphite Carbon host.
Example:
library "perfdata"
object GraphiteWriter "graphite" {
host = "127.0.0.1",
port = 2003
}
Attributes:
Name |Description
----------------|----------------
host |**Optional.** Graphite Carbon host address. Defaults to '127.0.0.1'.
port |**Optional.** Graphite Carbon port. Defaults to 2003.
2013-10-11 18:13:49 +02:00
### <a id="objecttype-idomysqlconnection"></a> IdoMySqlConnection
2013-09-26 08:59:29 +02:00
2013-10-30 15:32:33 +01:00
IDO database adapter for MySQL.
2013-09-26 08:59:29 +02:00
Example:
library "db_ido_mysql"
object IdoMysqlConnection "mysql-ido" {
host = "127.0.0.1",
port = 3306,
user = "icinga",
password = "icinga",
database = "icinga",
table_prefix = "icinga_",
instance_name = "icinga2",
2013-10-01 12:59:02 +02:00
instance_description = "icinga2 dev instance",
2013-09-26 17:23:15 +02:00
cleanup = {
2013-09-26 19:05:52 +02:00
downtimehistory_age = 48h,
2013-10-01 12:59:02 +02:00
logentries_age = 31d,
2013-10-30 08:47:23 +01:00
},
categories = (DbCatConfig | DbCatState)
2013-09-26 08:59:29 +02:00
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
host |**Optional.** MySQL database host address. Defaults to "localhost".
port |**Optional.** MySQL database port. Defaults to 3306.
user |**Optional.** MySQL database user with read/write permission to the icinga database. Defaults to "icinga".
2013-09-26 14:01:29 +02:00
password |**Optional.** MySQL database user's password. Defaults to "icinga".
2013-09-26 08:59:29 +02:00
database |**Optional.** MySQL database name. Defaults to "icinga".
table\_prefix |**Optional.** MySQL database table prefix. Defaults to "icinga\_".
instance\_name |**Optional.** Unique identifier for the local Icinga 2 instance. Defaults to "default".
instance\_description|**Optional.** Description for the Icinga 2 instance.
2013-09-26 17:23:15 +02:00
cleanup |**Optional.** Dictionary with items for historical table cleanup.
2013-10-30 08:47:23 +01:00
categories |**Optional.** The types of information that should be written to the database.
2013-09-26 17:23:15 +02:00
2013-10-30 15:32:33 +01:00
Cleanup Items:
Name | Description
----------------|----------------
acknowledgements_age |**Optional.** Max age for acknowledgements table rows (entry_time). Defaults to 0 (never).
commenthistory_age |**Optional.** Max age for commenthistory table rows (entry_time). Defaults to 0 (never).
contactnotifications_age |**Optional.** Max age for contactnotifications table rows (start_time). Defaults to 0 (never).
contactnotificationmethods_age |**Optional.** Max age for contactnotificationmethods table rows (start_time). Defaults to 0 (never).
downtimehistory_age |**Optional.** Max age for downtimehistory table rows (entry_time). Defaults to 0 (never).
eventhandlers_age |**Optional.** Max age for eventhandlers table rows (start_time). Defaults to 0 (never).
externalcommands_age |**Optional.** Max age for externalcommands table rows (entry_time). Defaults to 0 (never).
flappinghistory_age |**Optional.** Max age for flappinghistory table rows (event_time). Defaults to 0 (never).
hostchecks_age |**Optional.** Max age for hostchecks table rows (start_time). Defaults to 0 (never).
logentries_age |**Optional.** Max age for logentries table rows (logentry_time). Defaults to 0 (never).
notifications_age |**Optional.** Max age for notifications table rows (start_time). Defaults to 0 (never).
processevents_age |**Optional.** Max age for processevents table rows (event_time). Defaults to 0 (never).
statehistory_age |**Optional.** Max age for statehistory table rows (state_time). Defaults to 0 (never).
servicechecks_age |**Optional.** Max age for servicechecks table rows (start_time). Defaults to 0 (never).
systemcommands_age |**Optional.** Max age for systemcommands table rows (start_time). Defaults to 0 (never).
Data Categories:
Name | Description
---------------------|----------------
DbCatConfig | Configuration data
DbCatState | Current state data
DbCatAcknowledgement | Acknowledgements
DbCatComment | Comments
DbCatDowntime | Downtimes
DbCatEventHandler | Event handler data
DbCatExternalCommand | External commands
DbCatFlapping | Flap detection data
DbCatCheck | Check results
DbCatLog | Log messages
DbCatNotification | Notifications
DbCatProgramStatus | Program status data
DbCatRetention | Retention data
DbCatStateHistory | Historical state data
2013-11-20 16:41:48 +01:00
Multiple categories can be combined using the `|` operator. In addition to
the category flags listed above the `DbCatEverything` flag may be used as
a shortcut for listing all flags.
2013-10-30 15:32:33 +01:00
### <a id="objecttype-idomysqlconnection"></a> IdoPgSqlConnection
IDO database adapter for PostgreSQL.
Example:
library "db_ido_pgsql"
object IdoMysqlConnection "pgsql-ido" {
host = "127.0.0.1",
port = 5432,
user = "icinga",
password = "icinga",
database = "icinga",
table_prefix = "icinga_",
instance_name = "icinga2",
instance_description = "icinga2 dev instance",
cleanup = {
downtimehistory_age = 48h,
logentries_age = 31d,
},
categories = (DbCatConfig | DbCatState)
}
Attributes:
Name |Description
----------------|----------------
host |**Optional.** PostgreSQL database host address. Defaults to "localhost".
port |**Optional.** PostgreSQL database port. Defaults to "5432".
user |**Optional.** PostgreSQL database user with read/write permission to the icinga database. Defaults to "icinga".
password |**Optional.** PostgreSQL database user's password. Defaults to "icinga".
database |**Optional.** PostgreSQL database name. Defaults to "icinga".
table\_prefix |**Optional.** PostgreSQL database table prefix. Defaults to "icinga\_".
instance\_name |**Optional.** Unique identifier for the local Icinga 2 instance. Defaults to "default".
instance\_description|**Optional.** Description for the Icinga 2 instance.
cleanup |**Optional.** Dictionary with items for historical table cleanup.
categories |**Optional.** The types of information that should be written to the database.
2013-09-26 17:23:15 +02:00
Cleanup Items:
2013-10-01 12:59:02 +02:00
Name | Description
2013-09-26 17:23:15 +02:00
----------------|----------------
2013-10-30 14:07:50 +01:00
acknowledgements_age |**Optional.** Max age for acknowledgements table rows (entry_time). Defaults to 0 (never).
2013-10-01 12:59:02 +02:00
commenthistory_age |**Optional.** Max age for commenthistory table rows (entry_time). Defaults to 0 (never).
contactnotifications_age |**Optional.** Max age for contactnotifications table rows (start_time). Defaults to 0 (never).
contactnotificationmethods_age |**Optional.** Max age for contactnotificationmethods table rows (start_time). Defaults to 0 (never).
downtimehistory_age |**Optional.** Max age for downtimehistory table rows (entry_time). Defaults to 0 (never).
eventhandlers_age |**Optional.** Max age for eventhandlers table rows (start_time). Defaults to 0 (never).
externalcommands_age |**Optional.** Max age for externalcommands table rows (entry_time). Defaults to 0 (never).
flappinghistory_age |**Optional.** Max age for flappinghistory table rows (event_time). Defaults to 0 (never).
hostchecks_age |**Optional.** Max age for hostchecks table rows (start_time). Defaults to 0 (never).
logentries_age |**Optional.** Max age for logentries table rows (logentry_time). Defaults to 0 (never).
notifications_age |**Optional.** Max age for notifications table rows (start_time). Defaults to 0 (never).
processevents_age |**Optional.** Max age for processevents table rows (event_time). Defaults to 0 (never).
statehistory_age |**Optional.** Max age for statehistory table rows (state_time). Defaults to 0 (never).
servicechecks_age |**Optional.** Max age for servicechecks table rows (start_time). Defaults to 0 (never).
systemcommands_age |**Optional.** Max age for systemcommands table rows (start_time). Defaults to 0 (never).
2013-09-26 08:59:29 +02:00
2013-10-30 08:47:23 +01:00
Data Categories:
Name | Description
---------------------|----------------
DbCatConfig | Configuration data
DbCatState | Current state data
DbCatAcknowledgement | Acknowledgements
DbCatComment | Comments
DbCatDowntime | Downtimes
DbCatEventHandler | Event handler data
DbCatExternalCommand | External commands
DbCatFlapping | Flap detection data
DbCatCheck | Check results
DbCatLog | Log messages
DbCatNotification | Notifications
DbCatProgramStatus | Program status data
DbCatRetention | Retention data
DbCatStateHistory | Historical state data
2013-11-20 16:41:48 +01:00
Multiple categories can be combined using the `|` operator. In addition to
the category flags listed above the `DbCatEverything` flag may be used as
a shortcut for listing all flags.
2013-10-30 08:47:23 +01:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-livestatuslistener"></a> LiveStatusListener
2013-09-26 08:59:29 +02:00
2013-11-07 14:04:13 +01:00
Livestatus API interface available as TCP or UNIX socket. Historical table queries
require the `CompatLogger` feature enabled pointing to the log files using the
`compat_log_path` configuration attribute.
2013-09-26 08:59:29 +02:00
Example:
library "livestatus"
object LivestatusListener "livestatus-tcp" {
socket_type = "tcp",
bind_host = "127.0.0.1",
bind_port = "6558"
}
object LivestatusListener "livestatus-unix" {
socket_type = "unix",
2013-12-11 18:28:46 +01:00
socket_path = "/var/run/icinga2/cmd/livestatus"
2013-09-26 08:59:29 +02:00
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-11-07 14:04:13 +01:00
socket\_type |**Optional.** Specifies the socket type. Can be either "tcp" or "unix". Defaults to "unix".
bind\_host |**Optional.** Only valid when socket\_type is "tcp". Host address to listen on for connections. Defaults to "127.0.0.1".
bind\_port |**Optional.** Only valid when `socket\_type` is "tcp". Port to listen on for connections. Defaults to 6558.
2013-12-11 18:28:46 +01:00
socket\_path |**Optional.** Only valid when `socket\_type` is "unix". Specifies the path to the UNIX socket file. Defaults to IcingaLocalStateDir + "/run/icinga2/cmd/livestatus".
2013-11-07 14:04:13 +01:00
compat\_log\_path |**Optional.** Required for historical table queries. Requires `CompatLogger` feature enabled. Defaults to IcingaLocalStateDir + "/log/icinga2/compat"
2013-09-26 08:59:29 +02:00
> **Note**
>
> UNIX sockets are not supported on Windows.
2013-10-11 18:13:49 +02:00
### <a id="objecttype-statusdatawriter"></a> StatusDataWriter
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Periodically writes status data files which are used by the Classic UI and other third-party tools.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
library "compat"
object StatusDataWriter "status" {
2013-09-27 19:41:08 +02:00
status\_path = "/var/cache/icinga2/status.dat",
2013-12-05 10:00:20 +01:00
objects\_path = "/var/cache/icinga2/objects.path",
update\_interval = 30s
2013-09-27 07:19:13 +02:00
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
status\_path |**Optional.** Path to the status.dat file. Defaults to IcingaLocalStateDir + "/cache/icinga2/status.dat".
objects\_path |**Optional.** Path to the objects.cache file. Defaults to IcingaLocalStateDir + "/cache/icinga2/objects.cache".
2013-12-05 10:00:20 +01:00
update\_interval|**Optional.** The interval in which the status files are updated. Defaults to 15 seconds.
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-externalcommandlistener"></a> ExternalCommandListener
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Implements the Icinga 1.x command pipe which can be used to send commands to Icinga.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
library "compat"
object ExternalCommandListener "external" {
2013-09-30 09:42:27 +02:00
command\_path = "/var/run/icinga2/cmd/icinga2.cmd"
2013-09-27 07:19:13 +02:00
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-30 09:42:27 +02:00
command\_path |**Optional.** Path to the command pipe. Defaults to IcingaLocalStateDir + "/run/icinga2/cmd/icinga2.cmd".
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-compatlogger"></a> CompatLogger
2013-09-26 08:59:29 +02:00
2013-09-27 07:19:13 +02:00
Writes log files in a format that's compatible with Icinga 1.x.
2013-09-26 08:59:29 +02:00
Example:
2013-09-27 07:19:13 +02:00
library "compat"
object CompatLogger "my-log" {
2013-10-17 13:57:53 +02:00
log\_dir = "/var/log/icinga2/compat",
2013-09-27 07:19:13 +02:00
rotation\_method = "HOURLY"
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-09-27 07:19:13 +02:00
log\_dir |**Optional.** Path to the compat log directory. Defaults to IcingaLocalStateDir + "/log/icinga2/compat".
rotation\_method|**Optional.** Specifies when to rotate log files. Can be one of "HOURLY", "DAILY", "WEEKLY" or "MONTHLY". Defaults to "HOURLY".
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-checkresultreader"></a> CheckResultReader
2013-09-26 08:59:29 +02:00
2013-10-01 12:59:02 +02:00
Reads Icinga 1.x check results from a directory. This functionality is provided
to help existing Icinga 1.x users and might be useful for certain cluster
scenarios.
2013-09-26 08:59:29 +02:00
Example:
2013-10-01 12:59:02 +02:00
library "compat"
object CheckResultReader "reader" {
spool_dir = "/data/check-results"
}
2013-09-26 08:59:29 +02:00
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-10-01 12:59:02 +02:00
spool\_dir |**Optional.** The directory which contains the check result files. Defaults to IcingaLocalStateDir + "/lib/icinga2/spool/checkresults/".
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-checkcomponent"></a> CheckerComponent
2013-09-26 08:59:29 +02:00
2013-10-01 12:59:02 +02:00
The checker component is responsible for scheduling active checks. There are no configurable options.
2013-09-26 08:59:29 +02:00
Example:
library "checker"
object CheckerComponent "checker" { }
2013-10-11 18:13:49 +02:00
### <a id="objecttype-notificationcomponent"></a> NotificationComponent
2013-09-26 08:59:29 +02:00
2013-10-01 12:59:02 +02:00
The notification component is responsible for sending notifications. There are no configurable options.
2013-09-26 08:59:29 +02:00
Example:
library "notification"
object NotificationComponent "notification" { }
2014-02-17 18:51:16 +01:00
### <a id="objecttype-icingastatuswriter"></a> IcingaStatusWriter
The IcingaStatusWriter feature periodically dumps the current status
and performance data from Icinga 2 and all registered features into
a defined JSON file.
Example:
object IcingaStatusWriter "status" {
2014-02-21 20:04:51 +01:00
status_path = (IcingaLocalStateDir + "/cache/icinga2/status.json"),
2014-02-17 18:51:16 +01:00
update_interval = 15s
}
Attributes:
Name |Description
--------------------------|--------------------------
status\_path |**Optional.** Path to cluster status file. Defaults to IcingaLocalStateDir + "/cache/icinga2/status.json"
update\_interval |**Optional.** The interval in which the status files are updated. Defaults to 15 seconds.
2013-10-11 18:13:49 +02:00
### <a id="objecttype-clusterlistener"></a> ClusterListener
2013-09-26 08:59:29 +02:00
2013-10-18 20:05:08 +02:00
ClusterListener objects are used to specify remote cluster
node peers and the certificate files used for ssl
authorization.
2013-09-26 08:59:29 +02:00
Example:
2013-10-18 15:10:34 +02:00
library "cluster"
object ClusterListener "cluster" {
ca_path = "/etc/icinga2/ca/ca.crt",
cert_path = "/etc/icinga2/ca/icinga-node-1.crt",
key_path = "/etc/icinga2/ca/icinga-node-1.key",
bind_port = 8888,
peers = [ "icinga-node-2" ]
}
2013-09-26 08:59:29 +02:00
Attributes:
2014-02-13 15:15:16 +01:00
Name |Description
--------------------------|--------------------------
cert\_path |**Required.** Path to the public key.
key\_path |**Required.** Path to the private key.
ca\_path |**Required.** Path to the CA certificate file.
crl\_path |**Optional.** Path to the CRL file.
bind\_host |**Optional.** The IP address the cluster listener should be bound to.
bind\_port |**Optional.** The port the cluster listener should be bound to.
peers |**Optional.** A list of
2013-09-26 08:59:29 +02:00
2013-10-11 18:13:49 +02:00
### <a id="objecttype-endpoint"></a> Endpoint
2013-09-26 08:59:29 +02:00
Endpoint objects are used to specify connection information for remote
Icinga 2 instances.
Example:
library "cluster"
object Endpoint "icinga-c2" {
2013-12-11 15:12:20 +01:00
host = "192.168.5.46",
port = 7777,
2014-02-11 09:42:48 +01:00
config_files = [ "/etc/icinga2/cluster.d/*" ],
config_files_recursive = [
"/etc/icinga2/cluster2",
{ path = "/etc/icinga2/cluster3", pattern = "*.myconf" }
]
2013-09-26 08:59:29 +02:00
}
Attributes:
2013-09-26 14:01:29 +02:00
Name |Description
2013-09-26 08:59:29 +02:00
----------------|----------------
2013-12-11 15:12:20 +01:00
host |**Required.** The hostname/IP address of the remote Icinga 2 instance.
port |**Required.** The service name/port of the remote Icinga 2 instance.
2013-10-18 20:05:08 +02:00
config\_files |**Optional.** A list of configuration files sent to remote peers (wildcards possible).
2014-02-11 09:42:48 +01:00
config_files_recursive |**Optional.** A list of configuration files sent to remote peers. Array elements can either be a string (in which case all files in that directory matching the pattern *.conf are included) or a dictionary with elements "path" and "pattern".
2013-09-27 07:19:13 +02:00
accept\_config |**Optional.** A list of endpoint names from which this endpoint accepts configuration files.
2013-10-11 18:13:49 +02:00
### <a id="objecttype-domain"></a> Domain
2013-09-27 07:19:13 +02:00
TODO
Example:
TODO
Attributes:
Name |Description
----------------|----------------
acl |TODO