1 # <a id="configuring-icinga2"></a> Configuring Icinga 2
3 ## <a id="global-constants"></a> Global Constants
5 Icinga 2 provides a number of special global constants. Some of them can be overridden using the `--define` command line parameter:
8 --------------------|-------------------
9 PrefixDir |**Read-only.** Contains the installation prefix that was specified with cmake -DCMAKE_INSTALL_PREFIX. Defaults to "/usr/local".
10 SysconfDir |**Read-only.** Contains the path of the sysconf directory. Defaults to PrefixDir + "/etc".
11 ZonesDir |**Read-only.** Contains the path of the zones.d directory. Defaults to SysconfDir + "/zones.d".
12 LocalStateDir |**Read-only.** Contains the path of the local state directory. Defaults to PrefixDir + "/var".
13 RunDir |**Read-only.** Contains the path of the run directory. Defaults to LocalStateDir + "/run".
14 PkgDataDir |**Read-only.** Contains the path of the package data directory. Defaults to PrefixDir + "/share/icinga2".
15 StatePath |**Read-write.** Contains the path of the Icinga 2 state file. Defaults to LocalStateDir + "/lib/icinga2/icinga2.state".
16 ObjectsPath |**Read-write.** Contains the path of the Icinga 2 objects file. Defaults to LocalStateDir + "/cache/icinga2/icinga2.debug".
17 PidPath |**Read-write.** Contains the path of the Icinga 2 PID file. Defaults to RunDir + "/icinga2/icinga2.pid".
18 Vars |**Read-write.** Contains a dictionary with global custom attributes. Not set by default.
19 NodeName |**Read-write.** Contains the cluster node name. Set to the local hostname by default.
20 ApplicationType |**Read-write.** Contains the name of the Application type. Defaults to "icinga/IcingaApplication".
21 EnableNotifications |**Read-write.** Whether notifications are globally enabled. Defaults to true.
22 EnableEventHandlers |**Read-write.** Whether event handlers are globally enabled. Defaults to true.
23 EnableFlapping |**Read-write.** Whether flap detection is globally enabled. Defaults to true.
24 EnableHostChecks |**Read-write.** Whether active host checks are globally enabled. Defaults to true.
25 EnableServiceChecks |**Read-write.** Whether active service checks are globally enabled. Defaults to true.
26 EnablePerfdata |**Read-write.** Whether performance data processing is globally enabled. Defaults to true.
27 UseVfork |**Read-write.** Whether to use vfork(). Only available on *NIX. Defaults to true.
29 ## <a id="reserved-keywords"></a> Reserved Keywords
31 These keywords are reserved by the configuration parser and must not be
32 used as constants or custom attributes.
53 You can escape reserved keywords using the `@` character. The following example
54 will try to set `vars.include` which references a reserved keyword and generates
58 [2014-09-15 17:24:00 +0200] critical/config: Location:
59 /etc/icinga2/conf.d/hosts/localhost.conf(13): vars.sla = "24x7"
60 /etc/icinga2/conf.d/hosts/localhost.conf(14):
61 /etc/icinga2/conf.d/hosts/localhost.conf(15): vars.include = "some cmdb export field"
63 /etc/icinga2/conf.d/hosts/localhost.conf(16): }
64 /etc/icinga2/conf.d/hosts/localhost.conf(17):
66 Config error: in /etc/icinga2/conf.d/hosts/localhost.conf: 15:8-15:14: syntax error, unexpected include (T_INCLUDE), expecting T_IDENTIFIER
67 [2014-09-15 17:24:00 +0200] critical/config: 1 errors, 0 warnings.
69 You can escape the `include` key with an additional `@` character becoming `vars.@include`:
71 object Host "localhost" {
80 vars.@include = "some cmdb export field"
84 ## <a id="configuration-syntax"></a> Configuration Syntax
86 ### <a id="object-definition"></a> Object Definition
88 Icinga 2 features an object-based configuration format. You can define new
89 objects using the `object` keyword:
91 object Host "host1.example.org" {
92 display_name = "host1"
94 address = "192.168.0.1"
98 In general you need to write each statement on a new line. Expressions started
99 with `{`, `(` and `[` extend until the matching closing character and can be broken
100 up into multiple lines.
102 Alternatively you can write multiple statements on a single line by separating
103 them with a semicolon:
105 object Host "host1.example.org" {
106 display_name = "host1"
108 address = "192.168.0.1"; address6 = "::1"
111 Each object is uniquely identified by its type (`Host`) and name
112 (`host1.example.org`). Some types have composite names, e.g. the
113 `Service` type which uses the `host_name` attribute and the name
114 you specified to generate its object name.
116 Exclamation marks (!) are not permitted in object names.
118 Objects can contain a comma-separated list of property
119 declarations. Instead of commas semicolons may also be used.
120 The following data types are available for property values:
124 The following expressions can be used on the right-hand side of dictionary
127 #### <a id="numeric-literals"></a> Numeric Literals
129 A floating-point number.
135 #### <a id="duration-literals"></a> Duration Literals
137 Similar to floating-point numbers except for the fact that they support
138 suffixes to help with specifying time durations.
144 Supported suffixes include ms (milliseconds), s (seconds), m (minutes),
145 h (hours) and d (days).
147 Duration literals are converted to seconds by the config parser and
148 are treated like numeric literals.
150 #### <a id="string-literals"></a> String Literals
158 Certain characters need to be escaped. The following escape sequences
161 Character | Escape sequence
162 --------------------------|------------------------------------
166 <CARRIAGE-RETURN> | \\r
167 <LINE-FEED> | \\n
169 <FORM-FEED> | \\f
171 In addition to these pre-defined escape sequences you can specify
172 arbitrary ASCII characters using the backslash character (\\) followed
173 by an ASCII character in octal encoding.
175 #### <a id="multiline-string-literals"></a> Multi-line String Literals
177 Strings spanning multiple lines can be specified by enclosing them in
187 Unlike in ordinary strings special characters do not have to be escaped
188 in multi-line string literals.
190 #### <a id="boolean-literals"></a> Boolean Literals
192 The keywords `true` and `false` are equivalent to 1 and 0 respectively.
194 #### <a id="null-value"></a> Null Value
196 The `null` keyword can be used to specify an empty value.
198 #### <a id="dictionary"></a> Dictionary
200 An unordered list of key-value pairs. Keys must be unique and are
201 compared in a case-insensitive manner.
203 Individual key-value pairs must either be comma-separated or on separate lines.
204 The comma after the last key-value pair is optional.
209 address = "192.168.0.1"
213 Identifiers may not contain certain characters (e.g. space) or start
214 with certain characters (e.g. digits). If you want to use a dictionary
215 key that is not a valid identifier you can enclose the key in double
218 Setting a dictionary key to null causes the key and its value to be
219 removed from the dictionary.
221 #### <a id="array"></a> Array
223 An ordered list of values.
225 Individual array elements must be comma-separated.
226 The comma after the last element is optional.
232 An array may simultaneously contain values of different types, such as
235 #### <a id="expression-operators"></a> Operators
237 The following operators are supported in expressions:
239 Operator | Examples (Result) | Description
240 ---------|-----------------------------------------------|--------------------------------
241 ! | !"Hello" (false), !false (true) | Logical negation of the operand
242 ~ | ~true (false) | Bitwise negation of the operand
243 + | 1 + 3 (4), "hello " + "world" ("hello world") | Adds two numbers; concatenates strings
244 - | 3 - 1 (2) | Subtracts two numbers
245 * | 5m * 10 (3000) | Multiplies two numbers
246 / | 5m / 5 (60) | Divides two numbers
247 & | 7 & 3 (3) | Binary AND
248 | | 2 | 3 (3) | Binary OR
249 && | true && false (false) | Logical AND
250 || | true || false (true) | Logical OR
251 < | 3 < 5 (true) | Less than
252 > | 3 > 5 (false) | Greater than
253 <= | 3 <= 3 (true) | Less than or equal
254 >= | 3 >= 3 (true) | Greater than or equal
255 << | 4 << 8 (1024) | Left shift
256 >> | 1024 >> 4 (64) | Right shift
257 == | "hello" == "hello" (true), 3 == 5 (false) | Equal to
258 != | "hello" != "world" (true), 3 != 3 (false) | Not equal to
259 in | "foo" in [ "foo", "bar" ] (true) | Element contained in array
260 !in | "foo" !in [ "bar", "baz" ] (true) | Element not contained in array
261 () | (3 + 3) * 5 | Groups sub-expressions
263 Constants may be used in expressions:
265 const MyCheckInterval = 10m
270 check_interval = MyCheckInterval / 2.5
273 #### <a id="function-calls"></a> Function Calls
275 Functions can be called using the `()` operator:
277 const MyGroups = [ "test1", "test" ]
280 check_interval = len(MyGroups) * 1m
285 > Use these functions in [apply](#using-apply) rule expressions.
287 assign where match("192.168.*", host.address)
290 Function | Description
291 --------------------------------|-----------------------
292 regex(pattern, text) | Returns true if the regex pattern matches the text, false otherwise.
293 match(pattern, text) | Returns true if the wildcard pattern matches the text, false otherwise.
294 len(value) | Returns the length of the value, i.e. the number of elements for an array or dictionary, or the length of the string in bytes.
295 union(array, array, ...) | Returns an array containing all unique elements from the specified arrays.
296 intersection(array, array, ...) | Returns an array containing all unique elements which are common to all specified arrays.
297 keys(dict) | Returns an array containing the dictionary's keys.
298 string(value) | Converts the value to a string.
299 number(value) | Converts the value to a number.
300 bool(value) | Converts the value to a bool.
301 random() | Returns a random value between 0 and RAND_MAX (as defined in stdlib.h).
302 log(value) | Writes a message to the log. Non-string values are converted to a JSON string.
303 log(severity, facility, value) | Writes a message to the log. `severity` can be one of `LogDebug`, `LogNotice`, `LogInformation`, `LogWarning`, and `LogCritical`. Non-string values are converted to a JSON string.
304 exit(integer) | Terminates the application.
306 ### <a id="dictionary-operators"></a> Dictionary Operators
308 In addition to the `=` operator shown above a number of other operators
309 to manipulate dictionary elements are supported. Here's a list of all
312 #### <a id="operator-assignment"></a> Operator =
314 Sets a dictionary element to the specified value.
323 In this example `a` has the value `7` after both instructions are executed.
325 #### <a id="operator-additive-assignment"></a> Operator +=
327 The += operator is a shortcut. The following expression:
341 #### <a id="operator-substractive-assignment"></a> Operator -=
343 The -= operator is a shortcut. The following expression:
357 #### <a id="operator-multiply-assignment"></a> Operator \*=
359 The *= operator is a shortcut. The following expression:
373 #### <a id="operator-dividing-assignment"></a> Operator /=
375 The /= operator is a shortcut. The following expression:
389 ### <a id="indexer"></a> Indexer
391 The indexer syntax provides a convenient way to set dictionary elements.
399 Example (alternative syntax):
402 hello["key"] = "world"
405 This is equivalent to writing:
413 ### <a id="template-imports"></a> Template Imports
415 Objects can import attributes from other objects.
419 template Host "default-host" {
423 template Host "test-host" {
424 import "default-host"
429 object Host "localhost" {
432 address = "127.0.0.1"
436 The `default-host` and `test-host` objects are marked as templates
437 using the `template` keyword. Unlike ordinary objects templates are not
438 instantiated at run-time. Parent objects do not necessarily have to be
439 templates, however in general they are.
441 The `vars` dictionary for the `localhost` object contains all three
442 custom attributes and the custom attribute `colour` has the value `"blue"`.
444 Parent objects are resolved in the order they're specified using the
447 ### <a id="constants"></a> Constants
449 Global constants can be set using the `const` keyword:
451 const VarName = "some value"
453 Once defined a constant can be accessed from any file. Constants cannot be changed
456 There is a defined set of [global constants](#global-constants) which allow
457 you to specify application settings.
459 ### <a id="apply"></a> Apply
461 The `apply` keyword can be used to create new objects which are associated with
462 another group of objects.
464 apply Service "ping" to Host {
465 import "generic-service"
467 check_command = "ping4"
469 assign where host.name == "localhost"
472 In this example the `assign where` condition is a boolean expression which is
473 evaluated for all objects of type `Host` and a new service with name "ping"
474 is created for each matching host. [Expression operators](#expression-operators)
475 may be used in `assign where` conditions.
477 The `to` keyword and the target type may be omitted if there is only one target
478 type, e.g. for the `Service` type.
480 Depending on the object type used in the `apply` expression additional local
481 variables may be available for use in the `where` condition:
483 Source Type | Target Type | Variables
484 ------------------|-------------|--------------
485 Service | Host | host
486 Dependency | Host | host
487 Dependency | Service | host, service
488 Notification | Host | host
489 Notification | Service | host, service
490 ScheduledDowntime | Host | host
491 ScheduledDowntime | Service | host, service
493 Any valid config attribute can be accessed using the `host` and `service`
494 variables. For example, `host.address` would return the value of the host's
495 "address" attribute - or null if that attribute isn't set.
497 ### <a id="group-assign"></a> Group Assign
499 Group objects can be assigned to specific member objects using the `assign where`
500 and `ignore where` conditions.
502 object HostGroup "linux-servers" {
503 display_name = "Linux Servers"
505 assign where host.vars.os == "Linux"
508 In this example the `assign where` condition is a boolean expression which is evaluated
509 for all objects of the type `Host`. Each matching host is added as member to the host group
510 with the name "linux-servers". Membership exclusion can be controlled using the `ignore where`
511 condition. [Expression operators](#expression-operators) may be used in `assign where` and
512 `ignore where` conditions.
514 Source Type | Variables
515 ------------------|--------------
517 ServiceGroup | host, service
521 ### <a id="boolean-values"></a> Boolean Values
523 The `assign where` and `ignore where` statements, the `!`, `&&` and `||`
524 operators as well as the `bool()` function convert their arguments to a
525 boolean value based on the following rules:
527 Description | Example Value | Boolean Value
528 ---------------------|-------------------|--------------
529 Empty value | null | false
531 Non-zero integer | -23945 | true
532 Empty string | "" | false
533 Non-empty string | "Hello" | true
534 Empty array | [] | false
535 Non-empty array | [ "Hello" ] | true
536 Empty dictionary | {} | false
537 Non-empty dictionary | { key = "value" } | true
539 For a list of supported expression operators for `assign where` and `ignore where`
540 statements, see [expression operators](#expression-operators).
542 ### <a id="comments"></a> Comments
544 The Icinga 2 configuration format supports C/C++-style and shell-style comments.
551 object Host "localhost" {
552 check_interval = 30 // this is also a comment.
553 retry_interval = 15 # yet another comment
556 ### <a id="includes"></a> Includes
558 Other configuration files can be included using the `include` directive.
559 Paths must be relative to the configuration file that contains the
564 include "some/other/file.conf"
565 include "conf.d/*.conf"
567 Wildcard includes are not recursive.
569 Icinga also supports include search paths similar to how they work in a
574 Note the use of angle brackets instead of double quotes. This causes the
575 config compiler to search the include search paths for the specified
576 file. By default $PREFIX/share/icinga2 is included in the list of search
577 paths. Additional include search paths can be added using
578 [command-line options](#cmdline).
580 Wildcards are not permitted when using angle brackets.
582 ### <a id="recursive-includes"></a> Recursive Includes
584 The `include_recursive` directive can be used to recursively include all
585 files in a directory which match a certain pattern.
589 include_recursive "conf.d", "*.conf"
590 include_recursive "templates"
592 The first parameter specifies the directory from which files should be
593 recursively included.
595 The file names need to match the pattern given in the second parameter.
596 When no pattern is specified the default pattern "*.conf" is used.
598 ### <a id="library"></a> Library directive
600 The `library` directive can be used to manually load additional
601 libraries. Libraries can be used to provide additional object types and
610 ## <a id="object-types"></a> Object Types
612 ### <a id="objecttype-host"></a> Host
618 object Host "localhost" {
619 display_name = "The best host there is"
620 address = "127.0.0.1"
623 groups = [ "all-hosts" ]
625 check_command = "hostalive"
631 ----------------|----------------
632 display_name |**Optional.** A short description of the host.
633 address |**Optional.** The host's address. Available as command runtime macro `$address$` if set.
634 address6 |**Optional.** The host's address. Available as command runtime macro `$address6$` if set.
635 groups |**Optional.** A list of host groups this host belongs to.
636 vars |**Optional.** A dictionary containing custom attributes that are specific to this host.
637 check\_command |**Required.** The name of the check command.
638 max\_check\_attempts|**Optional.** The number of times a host is re-checked before changing into a hard state. Defaults to 3.
639 check\_period |**Optional.** The name of a time period which determines when this host should be checked. Not set by default.
640 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.
641 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.
642 enable\_notifications|**Optional.** Whether notifications are enabled. Defaults to true.
643 enable\_active\_checks|**Optional.** Whether active checks are enabled. Defaults to true.
644 enable\_passive\_checks|**Optional.** Whether passive checks are enabled. Defaults to true.
645 enable\_event\_handler|**Optional.** Enables event handlers for this host. Defaults to true.
646 enable\_flapping|**Optional.** Whether flap detection is enabled. Defaults to true.
647 enable\_perfdata|**Optional.** Whether performance data processing is enabled. Defaults to true.
648 event\_command |**Optional.** The name of an event command that should be executed every time the host's state changes or the host is in a `SOFT` state.
649 flapping\_threshold|**Optional.** The flapping threshold in percent when a host is considered to be flapping.
650 volatile |**Optional.** The volatile setting enables always `HARD` state types if `NOT-OK` state changes occur.
651 zone |**Optional.** The zone this object is a member of.
652 notes |**Optional.** Notes for the host.
653 notes_url |**Optional.** Url for notes for the host (for example, in notification commands).
654 action_url |**Optional.** Url for actions for the host (for example, an external graphing tool).
655 icon_image |**Optional.** Icon image for the host. Used by external interfaces only.
656 icon_image_alt |**Optional.** Icon image description for the host. Used by external interface only.
660 > The `address` and `address6` attributes are required for running commands using
661 > the `$address$` and `$address6$` runtime macros.
664 ### <a id="objecttype-hostgroup"></a> HostGroup
670 > Assign host group members using the [group assign](#group-assign) rules.
674 object HostGroup "my-hosts" {
675 display_name = "My hosts"
681 ----------------|----------------
682 display_name |**Optional.** A short description of the host group.
683 groups |**Optional.** An array of nested group names.
685 ### <a id="objecttype-service"></a> Service
687 Service objects describe network services and how they should be checked
692 > Rather than creating a `Service` object for a specific host it is usually easier
693 > to just create a `Service` template and use the `apply` keyword to assign the
694 > service to a number of hosts.
695 > Check the [apply](#using-apply) chapter for details.
699 object Service "uptime" {
700 host_name = "localhost"
702 display_name = "localhost Uptime"
704 check_command = "check_snmp"
706 vars.community = "public"
707 vars.oid = "DISMAN-EVENT-MIB::sysUpTimeInstance"
712 groups = [ "all-services", "snmp" ]
718 ----------------|----------------
719 display_name |**Optional.** A short description of the service.
720 host_name |**Required.** The host this service belongs to. There must be a `Host` object with that name.
721 name |**Required.** The service name. Must be unique on a per-host basis (Similar to the service_description attribute in Icinga 1.x).
722 groups |**Optional.** The service groups this service belongs to.
723 vars |**Optional.** A dictionary containing custom attributes that are specific to this service.
724 check\_command |**Required.** The name of the check command.
725 max\_check\_attempts|**Optional.** The number of times a service is re-checked before changing into a hard state. Defaults to 3.
726 check\_period |**Optional.** The name of a time period which determines when this service should be checked. Not set by default.
727 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.
728 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.
729 enable\_notifications|**Optional.** Whether notifications are enabled. Defaults to true.
730 enable\_active\_checks|**Optional.** Whether active checks are enabled. Defaults to true.
731 enable\_passive\_checks|**Optional.** Whether passive checks are enabled. Defaults to true.
732 enable\_event\_handler|**Optional.** Enables event handlers for this host. Defaults to true.
733 enable\_flapping|**Optional.** Whether flap detection is enabled. Defaults to true.
734 enable\_perfdata|**Optional.** Whether performance data processing is enabled. Defaults to true.
735 event\_command |**Optional.** The name of an event command that should be executed every time the service's state changes or the service is in a `SOFT` state.
736 flapping\_threshold|**Optional.** The flapping threshold in percent when a service is considered to be flapping.
737 volatile |**Optional.** The volatile setting enables always `HARD` state types if `NOT-OK` state changes occur.
738 zone |**Optional.** The zone this object is a member of.
739 notes |**Optional.** Notes for the service.
740 notes_url |**Optional.** Url for notes for the service (for example, in notification commands).
741 action_url |**Optional.** Url for actions for the service (for example, an external graphing tool).
742 icon_image |**Optional.** Icon image for the service. Used by external interfaces only.
743 icon_image_alt |**Optional.** Icon image description for the service. Used by external interface only.
746 Service objects have composite names, i.e. their names are based on the host_name attribute and the name you specified. This means
747 you can define more than one object with the same (short) name as long as the `host_name` attribute has a different value.
749 ### <a id="objecttype-servicegroup"></a> ServiceGroup
755 > Assign service group members using the [group assign](#group-assign) rules.
759 object ServiceGroup "snmp" {
760 display_name = "SNMP services"
766 ----------------|----------------
767 display_name |**Optional.** A short description of the service group.
768 groups |**Optional.** An array of nested group names.
771 ### <a id="objecttype-user"></a> User
777 object User "icingaadmin" {
778 display_name = "Icinga 2 Admin"
779 groups = [ "icingaadmins" ]
780 email = "icinga@localhost"
781 pager = "icingaadmin@localhost.localdomain"
785 states = [ OK, Warning, Critical, Unknown ]
786 types = [ Problem, Recovery ]
788 vars.additional_notes = "This is the Icinga 2 Admin account."
791 Available notification state filters:
800 Available notification type filters:
815 ----------------|----------------
816 display_name |**Optional.** A short description of the user.
817 email |**Optional.** An email string for this user. Useful for notification commands.
818 pager |**Optional.** A pager string for this user. Useful for notification commands.
819 vars |**Optional.** A dictionary containing custom attributes that are specific to this user.
820 groups |**Optional.** An array of group names.
821 enable_notifications|**Optional.** Whether notifications are enabled for this user.
822 period |**Optional.** The name of a time period which determines when a notification for this user should be triggered. Not set by default.
823 types |**Optional.** A set of type filters when this notification should be triggered. By default everything is matched.
824 states |**Optional.** A set of state filters when this notification should be triggered. By default everything is matched.
825 zone |**Optional.** The zone this object is a member of.
828 ### <a id="objecttype-usergroup"></a> UserGroup
834 > Assign user group members using the [group assign](#group-assign) rules.
838 object UserGroup "icingaadmins" {
839 display_name = "Icinga 2 Admin Group"
845 ----------------|----------------
846 display_name |**Optional.** A short description of the user group.
847 groups |**Optional.** An array of nested group names.
848 zone |**Optional.** The zone this object is a member of.
852 ### <a id="objecttype-checkcommand"></a> CheckCommand
854 A check command definition. Additional default command custom attributes can be
859 object CheckCommand "check_http" {
860 import "plugin-check-command"
862 command = [ PluginDir + "/check_http" ]
865 "-H" = "$http_vhost$"
866 "-I" = "$http_address$"
870 set_if = "$http_ssl$"
873 set_if = "$http_sni$"
876 value = "$http_auth_pair$"
877 description = "Username:password on sites with basic authentication"
880 set_if = "$http_ignore_body$"
882 "-r" = "$http_expect_body_regex$"
883 "-w" = "$http_warn_time$"
884 "-c" = "$http_critical_time$"
885 "-e" = "$http_expect$"
888 vars.http_address = "$address$"
889 vars.http_ssl = false
890 vars.http_sni = false
897 ----------------|----------------
898 methods |**Required.** The "execute" script method takes care of executing the check. In virtually all cases you should import the "plugin-check-command" template to take care of this setting.
899 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. When using the "arguments" attribute this must be an array.
900 env |**Optional.** A dictionary of macros which should be exported as environment variables prior to executing the command.
901 vars |**Optional.** A dictionary containing custom attributes that are specific to this command.
902 timeout |**Optional.** The command timeout in seconds. Defaults to 60 seconds.
903 zone |**Optional.** The zone this object is a member of.
904 arguments |**Optional.** A dictionary of command arguments.
907 Command arguments can be defined as key-value-pairs in the `arguments`
908 dictionary. If the argument requires additional configuration for example
909 a `description` attribute or an optional condition, the value can be defined
910 as dictionary specifying additional options.
914 vars.x_val = "My command argument value."
922 description = "My plugin requires this argument for doing X."
923 required = false /* optional, no error if not set */
924 skip_key = false /* always use "-X <value>" */
925 set_if = "$have_x$" /* only set if variable defined and resolves to a numeric value. String values are not supported */
926 order = -1 /* first position */
930 description = "My plugin requires this argument for doing Y."
931 required = false /* optional, no error if not set */
932 skip_key = true /* don't prefix "-Y" only use "<value>" */
933 set_if = "$have_y$" /* only set if variable defined and resolves to a numeric value. String values are not supported */
934 order = 0 /* second position */
939 ------------|--------------
940 value | Optional argument value.
941 description | Optional argument description.
942 required | Required argument. Execution error if not set. Defaults to false (optional).
943 skip_key | Use the value as argument and skip the key.
944 set_if | Argument is added if the macro resolves to a defined numeric value. String values are not supported.
945 order | Set if multiple arguments require a defined argument order.
948 `..., -3, -2, -1, <un-ordered keys>, 1, 2, 3, ...`
951 ### <a id="objecttype-notificationcommand"></a> NotificationCommand
953 A notification command definition.
957 object NotificationCommand "mail-service-notification" {
958 import "plugin-notification-command"
961 SysconfDir + "/icinga2/scripts/mail-notification.sh"
965 NOTIFICATIONTYPE = "$notification.type$"
966 SERVICEDESC = "$service.name$"
967 HOSTALIAS = "$host.display_name$"
968 HOSTADDRESS = "$address$"
969 SERVICESTATE = "$service.state$"
970 LONGDATETIME = "$icinga.long_date_time$"
971 SERVICEOUTPUT = "$service.output$"
972 NOTIFICATIONAUTHORNAME = "$notification.author$"
973 NOTIFICATIONCOMMENT = "$notification.comment$"
974 HOSTDISPLAYNAME = "$host.display_name$"
975 SERVICEDISPLAYNAME = "$service.display_name$"
976 USEREMAIL = "$user.email$"
983 ----------------|----------------
984 methods |**Required.** The "execute" script method takes care of executing the notification. In virtually all cases you should import the "plugin-notification-command" template to take care of this setting.
985 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.
986 env |**Optional.** A dictionary of macros which should be exported as environment variables prior to executing the command.
987 vars |**Optional.** A dictionary containing custom attributes that are specific to this command.
988 timeout |**Optional.** The command timeout in seconds. Defaults to 60 seconds.
989 zone |**Optional.** The zone this object is a member of.
990 arguments |**Optional.** A dictionary of command arguments.
992 Command arguments can be used the same way as for `CheckCommand` objects.
995 ### <a id="objecttype-eventcommand"></a> EventCommand
997 An event command definition.
1001 object EventCommand "restart-httpd-event" {
1002 import "plugin-event-command"
1004 command = "/opt/bin/restart-httpd.sh"
1011 ----------------|----------------
1012 methods |**Required.** The "execute" script method takes care of executing the event handler. In virtually all cases you should import the "plugin-event-command" template to take care of this setting.
1013 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.
1014 env |**Optional.** A dictionary of macros which should be exported as environment variables prior to executing the command.
1015 vars |**Optional.** A dictionary containing custom attributes that are specific to this command.
1016 timeout |**Optional.** The command timeout in seconds. Defaults to 60 seconds.
1017 arguments |**Optional.** A dictionary of command arguments.
1019 Command arguments can be used the same way as for `CheckCommand` objects.
1022 ### <a id="objecttype-notification"></a> Notification
1024 Notification objects are used to specify how users should be notified in case
1025 of host and service state changes and other events.
1029 > Rather than creating a `Notification` object for a specific host or service it is
1030 > usually easier to just create a `Notification` template and use the `apply` keyword
1031 > to assign the notification to a number of hosts or services. Use the `to` keyword
1032 > to set the specific target type for `Host` or `Service`.
1033 > Check the [notifications](#notifications) chapter for detailed examples.
1037 object Notification "localhost-ping-notification" {
1038 host_name = "localhost"
1039 service_name = "ping4"
1041 command = "mail-notification"
1043 users = [ "user1", "user2" ]
1045 types = [ Problem, Recovery ]
1051 --------------------------|----------------
1052 host_name | **Required.** The name of the host this notification belongs to.
1053 service_name | **Optional.** The short name of the service this notification belongs to. If omitted this notification object is treated as host notification.
1054 vars | **Optional.** A dictionary containing custom attributes that are specific to this notification object.
1055 users | **Optional.** A list of user names who should be notified.
1056 user_groups | **Optional.** A list of user group names who should be notified.
1057 times | **Optional.** A dictionary containing `begin` and `end` attributes for the notification.
1058 command | **Required.** The name of the notification command which should be executed when the notification is triggered.
1059 interval | **Optional.** The notification interval (in seconds). This interval is used for active notifications. Defaults to 30 minutes. If set to 0, [re-notifications](#disable-renotification) are disabled.
1060 period | **Optional.** The name of a time period which determines when this notification should be triggered. Not set by default.
1061 zone |**Optional.** The zone this object is a member of.
1062 types | **Optional.** A list of type filters when this notification should be triggered. By default everything is matched.
1063 states | **Optional.** A list of state filters when this notification should be triggered. By default everything is matched.
1065 Available notification state filters:
1074 Available notification type filters:
1088 ### <a id="objecttype-timeperiod"></a> TimePeriod
1090 Time periods can be used to specify when hosts/services should be checked or to limit
1091 when notifications should be sent out.
1095 object TimePeriod "24x7" {
1096 import "legacy-timeperiod"
1098 display_name = "Icinga 2 24x7 TimePeriod"
1101 monday = "00:00-24:00"
1102 tuesday = "00:00-24:00"
1103 wednesday = "00:00-24:00"
1104 thursday = "00:00-24:00"
1105 friday = "00:00-24:00"
1106 saturday = "00:00-24:00"
1107 sunday = "00:00-24:00"
1114 ----------------|----------------
1115 display_name |**Optional.** A short description of the time period.
1116 methods |**Required.** The "update" script method takes care of updating the internal representation of the time period. In virtually all cases you should import the "legacy-timeperiod" template to take care of this setting.
1117 zone |**Optional.** The zone this object is a member of.
1118 ranges |**Required.** A dictionary containing information which days and durations apply to this timeperiod.
1120 The `/etc/icinga2/conf.d/timeperiods.conf` file is usually used to define
1121 timeperiods including this one.
1124 ### <a id="objecttype-scheduleddowntime"></a> ScheduledDowntime
1126 ScheduledDowntime objects can be used to set up recurring downtimes for hosts/services.
1130 > Rather than creating a `ScheduledDowntime` object for a specific host or service it is usually easier
1131 > to just create a `ScheduledDowntime` template and use the `apply` keyword to assign the
1132 > scheduled downtime to a number of hosts or services. Use the `to` keyword to set the specific target
1133 > type for `Host` or `Service`.
1134 > Check the [recurring downtimes](#recurring-downtimes) example for details.
1138 object ScheduledDowntime "some-downtime" {
1139 host_name = "localhost"
1140 service_name = "ping4"
1142 author = "icingaadmin"
1143 comment = "Some comment"
1149 "sunday" = "02:00-03:00"
1156 ----------------|----------------
1157 host_name |**Required.** The name of the host this scheduled downtime belongs to.
1158 service_name |**Optional.** The short name of the service this scheduled downtime belongs to. If omitted this downtime object is treated as host downtime.
1159 author |**Required.** The author of the downtime.
1160 comment |**Required.** A comment for the downtime.
1161 fixed |**Optional.** Whether this is a fixed downtime. Defaults to true.
1162 duration |**Optional.** How long the downtime lasts. Only has an effect for flexible (non-fixed) downtimes.
1163 zone |**Optional.** The zone this object is a member of.
1164 ranges |**Required.** A dictionary containing information which days and durations apply to this timeperiod.
1166 ScheduledDowntime objects have composite names, i.e. their names are based
1167 on the `host_name` and `service_name` attributes and the
1168 name you specified. This means you can define more than one object
1169 with the same (short) name as long as one of the `host_name` and
1170 `service_name` attributes has a different value.
1173 ### <a id="objecttype-dependency"></a> Dependency
1175 Dependency objects are used to specify dependencies between hosts and services. Dependencies
1176 can be defined as Host-to-Host, Service-to-Service, Service-to-Host, or Host-to-Service
1181 > Rather than creating a `Dependency` object for a specific host or service it is usually easier
1182 > to just create a `Dependency` template and use the `apply` keyword to assign the
1183 > dependency to a number of hosts or services. Use the `to` keyword to set the specific target
1184 > type for `Host` or `Service`.
1185 > Check the [dependencies](#dependencies) chapter for detailed examples.
1187 Service-to-Service Example:
1189 object Dependency "webserver-internet" {
1190 parent_host_name = "internet"
1191 parent_service_name = "ping4"
1193 child_host_name = "webserver"
1194 child_service_name = "ping4"
1196 states = [ OK, Warning ]
1198 disable_checks = true
1201 Host-to-Host Example:
1203 object Dependency "webserver-internet" {
1204 parent_host_name = "internet"
1206 child_host_name = "webserver"
1210 disable_checks = true
1216 ----------------------|----------------
1217 parent_host_name |**Required.** The parent host.
1218 parent_service_name |**Optional.** The parent service. If omitted this dependency object is treated as host dependency.
1219 child_host_name |**Required.** The child host.
1220 child_service_name |**Optional.** The child service. If omitted this dependency object is treated as host dependency.
1221 disable_checks |**Optional.** Whether to disable checks when this dependency fails. Defaults to false.
1222 disable_notifications |**Optional.** Whether to disable notifications when this dependency fails. Defaults to true.
1223 period |**Optional.** Time period during which this dependency is enabled.
1224 zone |**Optional.** The zone this object is a member of.
1225 states |**Optional.** A list of state filters when this dependency should be OK. Defaults to [ OK, Warning ] for services and [ Up ] for hosts.
1227 Available state filters:
1236 When using [apply rules](#using-apply) for dependencies, you can leave out certain attributes which will be
1237 automatically determined by Icinga 2.
1239 Service-to-Host Dependency Example:
1241 apply Dependency "internet" to Service {
1242 parent_host_name = "dsl-router"
1243 disable_checks = true
1245 assign where host.name != "dsl-router"
1248 This example sets all service objects matching the assign condition into a dependency relation to
1249 the parent host object `dsl-router` as implicit child services.
1251 Service-to-Service-on-the-same-Host Dependency Example:
1253 apply Dependency "disable-nrpe-checks" to Service {
1254 parent_service_name = "nrpe-health"
1256 assign where service.check_command == "nrpe"
1257 ignore where service.name == "nrpe-health"
1260 This example omits the `parent_host_name` attribute and Icinga 2 automatically sets its value to the name of the
1261 host object matched by the apply rule condition. All services where apply matches are made implicit child services
1262 in this dependency relation.
1265 Dependency objects have composite names, i.e. their names are based on the `child_host_name` and `child_service_name` attributes and the
1266 name you specified. This means you can define more than one object with the same (short) name as long as one of the `child_host_name` and
1267 `child_service_name` attributes has a different value.
1270 ### <a id="objecttype-perfdatawriter"></a> PerfdataWriter
1272 Writes check result performance data to a defined path using macro
1273 pattern consisting of custom attributes and runtime macros.
1279 object PerfdataWriter "pnp" {
1280 host_perfdata_path = "/var/spool/icinga2/perfdata/host-perfdata"
1282 service_perfdata_path = "/var/spool/icinga2/perfdata/service-perfdata"
1284 host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tHOSTPERFDATA::$host.perfdata$\tHOSTCHECKCOMMAND::$host.check_command$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$"
1285 service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.name$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.check_command$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.state_type$"
1287 rotation_interval = 15s
1293 ------------------------|----------------
1294 host_perfdata\_path |**Optional.** Path to the host performance data file. Defaults to LocalStateDir + "/spool/icinga2/perfdata/host-perfdata".
1295 service_perfdata\_path |**Optional.** Path to the service performance data file. Defaults to LocalStateDir + "/spool/icinga2/perfdata/service-perfdata".
1296 host_temp\_path |**Optional.** Path to the temporary host file. Defaults to LocalStateDir + "/spool/icinga2/tmp/host-perfdata".
1297 service_temp\_path |**Optional.** Path to the temporary service file. Defaults to LocalStateDir + "/spool/icinga2/tmp/service-perfdata".
1298 host_format\_template |**Optional.** Host Format template for the performance data file. Defaults to a template that's suitable for use with PNP4Nagios.
1299 service_format\_template|**Optional.** Service Format template for the performance data file. Defaults to a template that's suitable for use with PNP4Nagios.
1300 rotation\_interval |**Optional.** Rotation interval for the files specified in `{host,service}_perfdata_path`. Defaults to 30 seconds.
1302 When rotating the performance data file the current UNIX timestamp is appended to the path specified
1303 in `host_perfdata_path` and `service_perfdata_path` to generate a unique filename.
1306 ### <a id="objecttype-graphitewriter"></a> GraphiteWriter
1308 Writes check result metrics and performance data to a defined
1309 Graphite Carbon host.
1315 object GraphiteWriter "graphite" {
1323 ----------------------|----------------------
1324 host |**Optional.** Graphite Carbon host address. Defaults to '127.0.0.1'.
1325 port |**Optional.** Graphite Carbon port. Defaults to 2003.
1326 host_name_template |**Optional.** Metric prefix for host name. Defaults to "icinga.$host.name$".
1327 service_name_template |**Optional.** Metric prefix for service name. Defaults to "icinga.$host.name$.$service.name$".
1329 Metric prefix names can be modified using [runtime macros](#runtime-macros).
1331 Example with your custom [global constant](#global-constants) `GraphiteEnv`:
1333 const GraphiteEnv = "icinga.env1"
1335 host_name_template = GraphiteEnv + ".$host.name$"
1336 service_name_template = GraphiteEnv + ".$host.name$.$service.name$"
1338 ### <a id="objecttype-gelfwriter"></a> GelfWriter
1340 Writes event log entries to a defined GELF receiver host (Graylog2, Logstash).
1346 object GelfWriter "gelf" {
1354 ----------------------|----------------------
1355 host |**Optional.** GELF receiver host address. Defaults to '127.0.0.1'.
1356 port |**Optional.** GELF receiver port. Defaults to `12201`.
1357 source |**Optional.** Source name for this instance. Defaults to `icinga2`.
1360 ### <a id="objecttype-idomysqlconnection"></a> IdoMySqlConnection
1362 IDO database adapter for MySQL.
1366 library "db_ido_mysql"
1368 object IdoMysqlConnection "mysql-ido" {
1374 table_prefix = "icinga_"
1375 instance_name = "icinga2"
1376 instance_description = "icinga2 instance"
1379 downtimehistory_age = 48h
1380 logentries_age = 31d
1383 categories = DbCatConfig | DbCatState
1389 ----------------|----------------
1390 host |**Optional.** MySQL database host address. Defaults to "localhost".
1391 port |**Optional.** MySQL database port. Defaults to 3306.
1392 user |**Optional.** MySQL database user with read/write permission to the icinga database. Defaults to "icinga".
1393 password |**Optional.** MySQL database user's password. Defaults to "icinga".
1394 database |**Optional.** MySQL database name. Defaults to "icinga".
1395 table\_prefix |**Optional.** MySQL database table prefix. Defaults to "icinga\_".
1396 instance\_name |**Optional.** Unique identifier for the local Icinga 2 instance. Defaults to "default".
1397 instance\_description|**Optional.** Description for the Icinga 2 instance.
1398 enable_ha |**Optional.** Enable the high availability functionality. Only valid in a [cluster setup](#high-availability-db-ido). Defaults to "true".
1399 failover_timeout | **Optional.** Set the failover timeout in a [HA cluster](#high-availability-db-ido). Must not be lower than 60s. Defaults to "60s".
1400 cleanup |**Optional.** Dictionary with items for historical table cleanup.
1401 categories |**Optional.** The types of information that should be written to the database.
1406 ----------------|----------------
1407 acknowledgements_age |**Optional.** Max age for acknowledgements table rows (entry_time). Defaults to 0 (never).
1408 commenthistory_age |**Optional.** Max age for commenthistory table rows (entry_time). Defaults to 0 (never).
1409 contactnotifications_age |**Optional.** Max age for contactnotifications table rows (start_time). Defaults to 0 (never).
1410 contactnotificationmethods_age |**Optional.** Max age for contactnotificationmethods table rows (start_time). Defaults to 0 (never).
1411 downtimehistory_age |**Optional.** Max age for downtimehistory table rows (entry_time). Defaults to 0 (never).
1412 eventhandlers_age |**Optional.** Max age for eventhandlers table rows (start_time). Defaults to 0 (never).
1413 externalcommands_age |**Optional.** Max age for externalcommands table rows (entry_time). Defaults to 0 (never).
1414 flappinghistory_age |**Optional.** Max age for flappinghistory table rows (event_time). Defaults to 0 (never).
1415 hostchecks_age |**Optional.** Max age for hostalives table rows (start_time). Defaults to 0 (never).
1416 logentries_age |**Optional.** Max age for logentries table rows (logentry_time). Defaults to 0 (never).
1417 notifications_age |**Optional.** Max age for notifications table rows (start_time). Defaults to 0 (never).
1418 processevents_age |**Optional.** Max age for processevents table rows (event_time). Defaults to 0 (never).
1419 statehistory_age |**Optional.** Max age for statehistory table rows (state_time). Defaults to 0 (never).
1420 servicechecks_age |**Optional.** Max age for servicechecks table rows (start_time). Defaults to 0 (never).
1421 systemcommands_age |**Optional.** Max age for systemcommands table rows (start_time). Defaults to 0 (never).
1425 Name | Description | Required by
1426 ---------------------|------------------------|--------------------
1427 DbCatConfig | Configuration data | Icinga Web/Reporting
1428 DbCatState | Current state data | Icinga Web/Reporting
1429 DbCatAcknowledgement | Acknowledgements | Icinga Web/Reporting
1430 DbCatComment | Comments | Icinga Web/Reporting
1431 DbCatDowntime | Downtimes | Icinga Web/Reporting
1432 DbCatEventHandler | Event handler data | Icinga Web/Reporting
1433 DbCatExternalCommand | External commands | Icinga Web/Reporting
1434 DbCatFlapping | Flap detection data | Icinga Web/Reporting
1435 DbCatCheck | Check results | --
1436 DbCatLog | Log messages | Icinga Web/Reporting
1437 DbCatNotification | Notifications | Icinga Web/Reporting
1438 DbCatProgramStatus | Program status data | Icinga Web/Reporting
1439 DbCatRetention | Retention data | Icinga Web/Reporting
1440 DbCatStateHistory | Historical state data | Icinga Web/Reporting
1442 Multiple categories can be combined using the `|` operator. In addition to
1443 the category flags listed above the `DbCatEverything` flag may be used as
1444 a shortcut for listing all flags.
1446 External interfaces like Icinga Web require everything except `DbCatCheck`
1447 which is the default value if `categories` is not set.
1449 ### <a id="objecttype-idomysqlconnection"></a> IdoPgSqlConnection
1451 IDO database adapter for PostgreSQL.
1455 library "db_ido_pgsql"
1457 object IdoMysqlConnection "pgsql-ido" {
1463 table_prefix = "icinga_"
1464 instance_name = "icinga2"
1465 instance_description = "icinga2 instance"
1468 downtimehistory_age = 48h
1469 logentries_age = 31d
1472 categories = DbCatConfig | DbCatState
1478 ----------------|----------------
1479 host |**Optional.** PostgreSQL database host address. Defaults to "localhost".
1480 port |**Optional.** PostgreSQL database port. Defaults to "5432".
1481 user |**Optional.** PostgreSQL database user with read/write permission to the icinga database. Defaults to "icinga".
1482 password |**Optional.** PostgreSQL database user's password. Defaults to "icinga".
1483 database |**Optional.** PostgreSQL database name. Defaults to "icinga".
1484 table\_prefix |**Optional.** PostgreSQL database table prefix. Defaults to "icinga\_".
1485 instance\_name |**Optional.** Unique identifier for the local Icinga 2 instance. Defaults to "default".
1486 instance\_description|**Optional.** Description for the Icinga 2 instance.
1487 enable_ha |**Optional.** Enable the high availability functionality. Only valid in a [cluster setup](#high-availability-db-ido). Defaults to "true".
1488 failover_timeout | **Optional.** Set the failover timeout in a [HA cluster](#high-availability-db-ido). Must not be lower than 60s. Defaults to "60s".
1489 cleanup |**Optional.** Dictionary with items for historical table cleanup.
1490 categories |**Optional.** The types of information that should be written to the database.
1495 ----------------|----------------
1496 acknowledgements_age |**Optional.** Max age for acknowledgements table rows (entry_time). Defaults to 0 (never).
1497 commenthistory_age |**Optional.** Max age for commenthistory table rows (entry_time). Defaults to 0 (never).
1498 contactnotifications_age |**Optional.** Max age for contactnotifications table rows (start_time). Defaults to 0 (never).
1499 contactnotificationmethods_age |**Optional.** Max age for contactnotificationmethods table rows (start_time). Defaults to 0 (never).
1500 downtimehistory_age |**Optional.** Max age for downtimehistory table rows (entry_time). Defaults to 0 (never).
1501 eventhandlers_age |**Optional.** Max age for eventhandlers table rows (start_time). Defaults to 0 (never).
1502 externalcommands_age |**Optional.** Max age for externalcommands table rows (entry_time). Defaults to 0 (never).
1503 flappinghistory_age |**Optional.** Max age for flappinghistory table rows (event_time). Defaults to 0 (never).
1504 hostchecks_age |**Optional.** Max age for hostalives table rows (start_time). Defaults to 0 (never).
1505 logentries_age |**Optional.** Max age for logentries table rows (logentry_time). Defaults to 0 (never).
1506 notifications_age |**Optional.** Max age for notifications table rows (start_time). Defaults to 0 (never).
1507 processevents_age |**Optional.** Max age for processevents table rows (event_time). Defaults to 0 (never).
1508 statehistory_age |**Optional.** Max age for statehistory table rows (state_time). Defaults to 0 (never).
1509 servicechecks_age |**Optional.** Max age for servicechecks table rows (start_time). Defaults to 0 (never).
1510 systemcommands_age |**Optional.** Max age for systemcommands table rows (start_time). Defaults to 0 (never).
1514 Name | Description | Required by
1515 ---------------------|------------------------|--------------------
1516 DbCatConfig | Configuration data | Icinga Web/Reporting
1517 DbCatState | Current state data | Icinga Web/Reporting
1518 DbCatAcknowledgement | Acknowledgements | Icinga Web/Reporting
1519 DbCatComment | Comments | Icinga Web/Reporting
1520 DbCatDowntime | Downtimes | Icinga Web/Reporting
1521 DbCatEventHandler | Event handler data | Icinga Web/Reporting
1522 DbCatExternalCommand | External commands | Icinga Web/Reporting
1523 DbCatFlapping | Flap detection data | Icinga Web/Reporting
1524 DbCatCheck | Check results | --
1525 DbCatLog | Log messages | Icinga Web/Reporting
1526 DbCatNotification | Notifications | Icinga Web/Reporting
1527 DbCatProgramStatus | Program status data | Icinga Web/Reporting
1528 DbCatRetention | Retention data | Icinga Web/Reporting
1529 DbCatStateHistory | Historical state data | Icinga Web/Reporting
1531 Multiple categories can be combined using the `|` operator. In addition to
1532 the category flags listed above the `DbCatEverything` flag may be used as
1533 a shortcut for listing all flags.
1535 External interfaces like Icinga Web require everything except `DbCatCheck`
1536 which is the default value if `categories` is not set.
1538 ### <a id="objecttype-livestatuslistener"></a> LiveStatusListener
1540 Livestatus API interface available as TCP or UNIX socket. Historical table queries
1541 require the `CompatLogger` feature enabled pointing to the log files using the
1542 `compat_log_path` configuration attribute.
1546 library "livestatus"
1548 object LivestatusListener "livestatus-tcp" {
1550 bind_host = "127.0.0.1"
1554 object LivestatusListener "livestatus-unix" {
1555 socket_type = "unix"
1556 socket_path = "/var/run/icinga2/cmd/livestatus"
1562 ----------------|----------------
1563 socket\_type |**Optional.** Specifies the socket type. Can be either "tcp" or "unix". Defaults to "unix".
1564 bind\_host |**Optional.** Only valid when socket\_type is "tcp". Host address to listen on for connections. Defaults to "127.0.0.1".
1565 bind\_port |**Optional.** Only valid when `socket_type` is "tcp". Port to listen on for connections. Defaults to 6558.
1566 socket\_path |**Optional.** Only valid when `socket_type` is "unix". Specifies the path to the UNIX socket file. Defaults to RunDir + "/icinga2/cmd/livestatus".
1567 compat\_log\_path |**Optional.** Required for historical table queries. Requires `CompatLogger` feature enabled. Defaults to LocalStateDir + "/log/icinga2/compat"
1571 > UNIX sockets are not supported on Windows.
1573 ### <a id="objecttype-statusdatawriter"></a> StatusDataWriter
1575 Periodically writes status data files which are used by the Classic UI and other third-party tools.
1581 object StatusDataWriter "status" {
1582 status_path = "/var/cache/icinga2/status.dat"
1583 objects_path = "/var/cache/icinga2/objects.path"
1584 update_interval = 30s
1590 ----------------|----------------
1591 status\_path |**Optional.** Path to the status.dat file. Defaults to LocalStateDir + "/cache/icinga2/status.dat".
1592 objects\_path |**Optional.** Path to the objects.cache file. Defaults to LocalStateDir + "/cache/icinga2/objects.cache".
1593 update\_interval|**Optional.** The interval in which the status files are updated. Defaults to 15 seconds.
1596 ### <a id="objecttype-externalcommandlistener"></a> ExternalCommandListener
1598 Implements the Icinga 1.x command pipe which can be used to send commands to Icinga.
1604 object ExternalCommandListener "external" {
1605 command_path = "/var/run/icinga2/cmd/icinga2.cmd"
1611 ----------------|----------------
1612 command\_path |**Optional.** Path to the command pipe. Defaults to RunDir + "/icinga2/cmd/icinga2.cmd".
1614 ### <a id="objecttype-compatlogger"></a> CompatLogger
1616 Writes log files in a format that's compatible with Icinga 1.x.
1622 object CompatLogger "my-log" {
1623 log_dir = "/var/log/icinga2/compat"
1624 rotation_method = "HOURLY"
1630 ----------------|----------------
1631 log\_dir |**Optional.** Path to the compat log directory. Defaults to LocalStateDir + "/log/icinga2/compat".
1632 rotation\_method|**Optional.** Specifies when to rotate log files. Can be one of "HOURLY", "DAILY", "WEEKLY" or "MONTHLY". Defaults to "HOURLY".
1635 ### <a id="objecttype-checkresultreader"></a> CheckResultReader
1637 Reads Icinga 1.x check results from a directory. This functionality is provided
1638 to help existing Icinga 1.x users and might be useful for certain cluster
1645 object CheckResultReader "reader" {
1646 spool_dir = "/data/check-results"
1652 ----------------|----------------
1653 spool\_dir |**Optional.** The directory which contains the check result files. Defaults to LocalStateDir + "/lib/icinga2/spool/checkresults/".
1656 ### <a id="objecttype-checkcomponent"></a> CheckerComponent
1658 The checker component is responsible for scheduling active checks. There are no configurable options.
1664 object CheckerComponent "checker" { }
1666 Can be enabled/disabled using
1668 # icinga2 feature enable checker
1671 ### <a id="objecttype-notificationcomponent"></a> NotificationComponent
1673 The notification component is responsible for sending notifications. There are no configurable options.
1677 library "notification"
1679 object NotificationComponent "notification" { }
1684 ----------------|----------------
1685 enable_ha |**Optional.** Enable the high availability functionality. Only valid in a [cluster setup](#high-availability). Defaults to "true".
1688 Can be enabled/disabled using
1690 # icinga2 feature enable notification
1693 ### <a id="objecttype-filelogger"></a> FileLogger
1695 Specifies Icinga 2 logging to a file.
1699 object FileLogger "debug-file" {
1701 path = "/var/log/icinga2/debug.log"
1707 ----------------|----------------
1708 path |**Required.** The log path.
1709 severity |**Optional.** The minimum severity for this log. Can be "debug", "notice", "information", "warning" or "critical". Defaults to "information".
1712 ### <a id="objecttype-sysloglogger"></a> SyslogLogger
1714 Specifies Icinga 2 logging to syslog.
1718 object SyslogLogger "crit-syslog" {
1719 severity = "critical"
1725 ----------------|----------------
1726 severity |**Optional.** The minimum severity for this log. Can be "debug", "notice", "information", "notice", "warning" or "critical". Defaults to "warning".
1730 ### <a id="objecttype-icingastatuswriter"></a> IcingaStatusWriter
1732 The IcingaStatusWriter feature periodically dumps the current status
1733 and performance data from Icinga 2 and all registered features into
1734 a defined JSON file.
1738 object IcingaStatusWriter "status" {
1739 status_path = LocalStateDir + "/cache/icinga2/status.json"
1740 update_interval = 15s
1746 --------------------------|--------------------------
1747 status\_path |**Optional.** Path to cluster status file. Defaults to LocalStateDir + "/cache/icinga2/status.json"
1748 update\_interval |**Optional.** The interval in which the status files are updated. Defaults to 15 seconds.
1751 ### <a id="objecttype-apilistener"></a> ApiListener
1753 ApiListener objects are used for distributed monitoring setups
1754 specifying the certificate files used for ssl authorization.
1756 The `NodeName` constant must be defined in [constants.conf](#constants-conf).
1760 object ApiListener "api" {
1761 cert_path = SysconfDir + "/icinga2/pki/" + NodeName + ".crt"
1762 key_path = SysconfDir + "/icinga2/pki/" + NodeName + ".key"
1763 ca_path = SysconfDir + "/icinga2/pki/ca.crt"
1770 --------------------------|--------------------------
1771 cert\_path |**Required.** Path to the public key.
1772 key\_path |**Required.** Path to the private key.
1773 ca\_path |**Required.** Path to the CA certificate file.
1774 crl\_path |**Optional.** Path to the CRL file.
1775 bind\_host |**Optional.** The IP address the api listener should be bound to. Defaults to `0.0.0.0`.
1776 bind\_port |**Optional.** The port the api listener should be bound to. Defaults to `5665`.
1777 accept\_config |**Optional.** Accept zone configuration. Defaults to `false`.
1780 ### <a id="objecttype-endpoint"></a> Endpoint
1782 Endpoint objects are used to specify connection information for remote
1787 object Endpoint "icinga2b" {
1788 host = "192.168.5.46"
1795 ----------------|----------------
1796 host |**Required.** The hostname/IP address of the remote Icinga 2 instance.
1797 port |**Optional.** The service name/port of the remote Icinga 2 instance. Defaults to `5665`.
1798 log_duration |**Optional.** Duration for keeping replay logs on connection loss. Defaults to `1d`.
1801 ### <a id="objecttype-zone"></a> Zone
1803 Zone objects are used to specify which Icinga 2 instances are located in a zone.
1804 All zone endpoints elect one active master instance among them (required for High-Availability setups).
1808 object Zone "config-ha-master" {
1809 endpoints = [ "icinga2a", "icinga2b" ]
1813 object Zone "check-satellite" {
1814 endpoints = [ "icinga2c" ]
1815 parent = "config-ha-master"
1821 ----------------|----------------
1822 endpoints |**Optional.** Dictionary with endpoints located in this zone.
1823 parent |**Optional.** Parent zone.
1827 ## <a id="icinga-template-library"></a> Icinga Template Library
1829 ### <a id="itl-overview"></a> Overview
1831 The Icinga Template Library (ITL) implements standard templates and object
1832 definitions for commonly used services.
1834 You can include the ITL by using the `include` directive in your configuration
1839 ### <a id="itl-generic-templates"></a> Generic Templates
1841 These templates are imported by the provided example configuration.
1843 #### <a id="itl-plugin-check-command"></a> plugin-check-command
1845 Command template for check plugins executed by Icinga 2.
1847 The `plugin-check-command` command does not support any vars.
1849 #### <a id="itl-plugin-notification-command"></a> plugin-notification-command
1851 Command template for notification scripts executed by Icinga 2.
1853 The `plugin-notification-command` command does not support any vars.
1855 #### <a id="itl-plugin-event-command"></a> plugin-event-command
1857 Command template for event handler scripts executed by Icinga 2.
1859 The `plugin-event-command` command does not support any vars.
1861 ### <a id="itl-check-commands"></a> Check Commands
1863 These check commands are embedded into Icinga 2 and do not require any external
1866 #### <a id="itl-icinga"></a> icinga
1868 Check command for the built-in `icinga` check. This check returns performance
1869 data for the current Icinga instance.
1871 The `icinga` check command does not support any vars.
1873 #### <a id="itl-icinga-cluster"></a> cluster
1875 Check command for the built-in `cluster` check. This check returns performance
1876 data for the current Icinga instance and connected endpoints.
1878 The `cluster` check command does not support any vars.
1880 #### <a id="itl-icinga-cluster-zone"></a> cluster-zone
1882 Check command for the built-in `cluster-zone` check.
1887 -------------|---------------
1888 cluster_zone | **Optional.** The zone name. Defaults to "$host.name$".
1890 ## <a id="plugin-check-commands"></a> Plugin Check Commands
1892 ### <a id="plugin-check-command-overview"></a> Overview
1894 The Plugin Check Commands provides example configuration for plugin check commands
1895 provided by the Monitoring Plugins project.
1897 You can include the plugin check command definitions by using the `include`
1898 directive in your configuration file:
1902 The plugin check commands assume that there's a global constant named `PluginDir`
1903 which contains the path of the plugins from the Monitoring Plugins project.
1906 #### <a id="plugin-check-command-ping4"></a> ping4
1908 Check command object for the `check_ping` plugin.
1913 ----------------|--------------
1914 ping_address | **Optional.** The host's IPv4 address. Defaults to "$address$".
1915 ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100.
1916 ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5.
1917 ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200.
1918 ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15.
1919 ping_packets | **Optional.** The number of packets to send. Defaults to 5.
1920 ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
1922 #### <a id="plugin-check-command-ping6"></a> ping6
1924 Check command object for the `check_ping` plugin.
1929 ----------------|--------------
1930 ping_address | **Optional.** The host's IPv6 address. Defaults to "$address6$".
1931 ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100.
1932 ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5.
1933 ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200.
1934 ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15.
1935 ping_packets | **Optional.** The number of packets to send. Defaults to 5.
1936 ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
1938 #### <a id="plugin-check-command-hostalive"></a> hostalive
1940 Check command object for the `check_ping` plugin with host check default values.
1945 ----------------|--------------
1946 ping_address | **Optional.** The host's IPv4 address. Defaults to "$address$".
1947 ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 3000.
1948 ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 80.
1949 ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 5000.
1950 ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 100.
1951 ping_packets | **Optional.** The number of packets to send. Defaults to 5.
1952 ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
1954 #### <a id="plugin-check-command-fping4"></a> fping4
1956 Check command object for the `check_fping` plugin.
1961 ----------------|--------------
1962 fping_address | **Optional.** The host's IPv4 address. Defaults to "$address$".
1963 fping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100.
1964 fping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5.
1965 fping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200.
1966 fping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15.
1967 fping_number | **Optional.** The number of packets to send. Defaults to 5.
1968 fping_interval | **Optional.** The interval between packets in milli-seconds. Defaults to 500.
1969 fping_bytes | **Optional.** The size of ICMP packet.
1970 fping_target_timeout | **Optional.** The target timeout in milli-seconds.
1971 fping_source_ip | **Optional.** The name or ip address of the source ip.
1972 fping_source_interface | **Optional.** The source interface name.
1974 #### <a id="plugin-check-command-fping6"></a> fping6
1976 Check command object for the `check_fping` plugin.
1981 ----------------|--------------
1982 fping_address | **Optional.** The host's IPv6 address. Defaults to "$address6$".
1983 fping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100.
1984 fping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5.
1985 fping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200.
1986 fping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15.
1987 fping_number | **Optional.** The number of packets to send. Defaults to 5.
1988 fping_interval | **Optional.** The interval between packets in milli-seconds. Defaults to 500.
1989 fping_bytes | **Optional.** The size of ICMP packet.
1990 fping_target_timeout | **Optional.** The target timeout in milli-seconds.
1991 fping_source_ip | **Optional.** The name or ip address of the source ip.
1992 fping_source_interface | **Optional.** The source interface name.
1995 #### <a id="plugin-check-command-dummy"></a> dummy
1997 Check command object for the `check_dummy` plugin.
2002 ----------------|--------------
2003 dummy_state | **Optional.** The state. Can be one of 0 (ok), 1 (warning), 2 (critical) and 3 (unknown). Defaults to 0.
2004 dummy_text | **Optional.** Plugin output. Defaults to "Check was successful.".
2006 #### <a id="plugin-check-command-passive"></a> passive
2008 Specialised check command object for passive checks executing the `check_dummy` plugin with appropriate default values.
2013 ----------------|--------------
2014 dummy_state | **Optional.** The state. Can be one of 0 (ok), 1 (warning), 2 (critical) and 3 (unknown). Defaults to 3.
2015 dummy_text | **Optional.** Plugin output. Defaults to "No Passive Check Result Received.".
2017 #### <a id="plugin-check-command-tcp"></a> tcp
2019 Check command object for the `check_tcp` plugin.
2024 ----------------|--------------
2025 tcp_address | **Optional.** The host's address. Defaults to "$address$".
2026 tcp_port | **Required.** The port that should be checked.
2028 #### <a id="plugin-check-command-ssl"></a> ssl
2030 Check command object for the `check_tcp` plugin, using ssl-related options.
2035 ------------------------------|--------------
2036 ssl_address | **Optional.** The host's address. Defaults to "$address$".
2037 ssl_port | **Required.** The port that should be checked.
2038 ssl_timeout | **Optional.** Timeout in seconds for the connect and handshake. The plugin default is 10 seconds.
2039 ssl_cert_valid_days_warn | **Optional.** Warning threshold for days before the certificate will expire. When used, ssl_cert_valid_days_critical must also be set.
2040 ssl_cert_valid_days_critical | **Optional.** Critical threshold for days before the certificate will expire. When used, ssl_cert_valid_days_warn must also be set.
2042 #### <a id="plugin-check-command-udp"></a> udp
2044 Check command object for the `check_udp` plugin.
2049 ----------------|--------------
2050 udp_address | **Optional.** The host's address. Defaults to "$address$".
2051 udp_port | **Required.** The port that should be checked.
2053 #### <a id="plugin-check-command-http"></a> http
2055 Check command object for the `check_http` plugin.
2060 -------------------------|--------------
2061 http_address | **Optional.** The host's address. Defaults to "$address".
2062 http_vhost | **Optional.** The virtual host that should be sent in the "Host" header.
2063 http_uri | **Optional.** The request URI.
2064 http_port | **Optional.** The TCP port. Defaults to 80 when not using SSL, 443 otherwise.
2065 http_ssl | **Optional.** Whether to use SSL. Defaults to false.
2066 http_sni | **Optional.** Whether to use SNI. Defaults to false.
2067 http_auth_pair | **Optional.** Add 'username:password' authorization pair.
2068 http_proxy_auth_pair | **Optional.** Add 'username:password' authorization pair for proxy.
2069 http_ignore_body | **Optional.** Don't download the body, just the headers.
2070 http_linespan | **Optional.** Allow regex to span newline.
2071 http_expect_body_regex | **Optional.** A regular expression which the body must match against. Incompatible with http_ignore_body.
2072 http_expect_body_eregi | **Optional.** A case-insensitive expression which the body must match against. Incompatible with http_ignore_body.
2073 http_invertregex | **Optional.** Changes behaviour of http_expect_body_regex and http_expect_body_eregi to return CRITICAL if found, OK if not.
2074 http_warn_time | **Optional.** The warning threshold.
2075 http_critical_time | **Optional.** The critical threshold.
2076 http_expect | **Optional.** Comma-delimited list of strings, at least one of them is expected in the first (status) line of the server response. Default: HTTP/1.
2077 http_certificate | **Optional.** Minimum number of days a certificate has to be valid. Port defaults to 443.
2078 http_clientcert | **Optional.** Name of file contains the client certificate (PEM format).
2079 http_privatekey | **Optional.** Name of file contains the private key (PEM format).
2080 http_headerstring | **Optional.** String to expect in the response headers.
2081 http_string | **Optional.** String to expect in the content.
2082 http_post | **Optional.** URL encoded http POST data.
2083 http_method | **Optional.** Set http method (for example: HEAD, OPTIONS, TRACE, PUT, DELETE).
2084 http_maxage | **Optional.** Warn if document is more than seconds old.
2085 http_contenttype | **Optional.** Specify Content-Type header when POSTing.
2086 http_useragent | **Optional.** String to be sent in http header as User Agent.
2087 http_header | **Optional.** Any other tags to be sent in http header.
2088 http_extendedperfdata | **Optional.** Print additional perfdata. Defaults to "false".
2089 http_onredirect | **Optional.** How to handle redirect pages. Possible values: "ok" (default), "warning", "critical", "follow", "sticky" (like follow but stick to address), "stickyport" (like sticky but also to port)
2090 http_pagesize | **Optional.** Minimum page size required:Maximum page size required.
2091 http_timeout | **Optional.** Seconds before connection times out.
2094 #### <a id="plugin-check-command-ftp"></a> ftp
2096 Check command object for the `check_ftp` plugin.
2101 -------------------|--------------
2102 ftp_address | **Optional.** The host's address. Defaults to "$address".
2104 #### <a id="plugin-check-command-smtp"></a> smtp
2106 Check command object for the `check_smtp` plugin.
2111 ---------------------|--------------
2112 smtp_address | **Optional.** The host's address. Defaults to "$address$".
2113 smtp_port | **Optional.** The port that should be checked. Defaults to 25.
2114 smtp_mail_from | **Optional.** Test a MAIL FROM command with the given email address.
2116 #### <a id="plugin-check-command-ssmtp"></a> ssmtp
2118 Check command object for the `check_ssmtp` plugin.
2123 ----------------|--------------
2124 ssmtp_address | **Required.** The host's address. Defaults to "$address$".
2125 ssmtp_port | **Optional.** The port that should be checked. Defaults to 465.
2126 ssmtp_mail_from | **Optional.** Test a MAIL FROM command with the given email address.
2128 #### <a id="plugin-check-command-imap"></a> imap
2130 Check command object for the `check_imap` plugin.
2135 ----------------|--------------
2136 imap_address | **Optional.** The host's address. Defaults to "$address$".
2137 imap_port | **Optional.** The port that should be checked. Defaults to 143.
2139 #### <a id="plugin-check-command-simap"></a> simap
2141 Check command object for the `check_simap` plugin.
2146 ----------------|--------------
2147 simap_address | **Optional.** The host's address. Defaults to "$address$".
2148 simap_port | **Optional.** The host's port.
2150 #### <a id="plugin-check-command-pop"></a> pop
2152 Check command object for the `check_pop` plugin.
2157 ----------------|--------------
2158 pop_address | **Optional.** The host's address. Defaults to "$address$".
2159 pop_port | **Optional.** The port that should be checked. Defaults to 110.
2161 #### <a id="plugin-check-command-spop"></a> spop
2163 Check command object for the `check_spop` plugin.
2168 ----------------|--------------
2169 spop_address | **Optional.** The host's address. Defaults to "$address$".
2170 spop_port | **Optional.** The host's port.
2172 #### <a id="plugin-check-command-ntp-time"></a> ntp_time
2174 Check command object for the `check_ntp_time` plugin.
2179 ----------------|--------------
2180 ntp_address | **Optional.** The host's address. Defaults to "$address$".
2182 #### <a id="plugin-check-command-ssh"></a> ssh
2184 Check command object for the `check_ssh` plugin.
2189 ----------------|--------------
2190 ssh_address | **Optional.** The host's address. Defaults to "$address$".
2191 ssh_port | **Optional.** The port that should be checked. Defaults to 22.
2192 ssh_timeout | **Optional.** Seconds before connection times out. Defaults to 10.
2194 #### <a id="plugin-check-command-disk"></a> disk
2196 Check command object for the `check_disk` plugin.
2201 ------------------------|------------------------
2202 disk_wfree | **Optional.** The free space warning threshold in %. Defaults to 20.
2203 disk_cfree | **Optional.** The free space critical threshold in %. Defaults to 10.
2204 disk_inode_wfree | **Optional.** The free inode warning threshold.
2205 disk_inode_cfree | **Optional.** The free inode critical threshold.
2206 disk_partition | **Optional.** The partition.
2207 disk_partition_excluded | **Optional.** The excluded partition.
2209 #### <a id="plugin-check-command-users"></a> users
2211 Check command object for the `check_users` plugin.
2216 ----------------|--------------
2217 users_wgreater | **Optional.** The user count warning threshold. Defaults to 20.
2218 users_cgreater | **Optional.** The user count critical threshold. Defaults to 50.
2220 #### <a id="plugin-check-command-processes"></a> procs
2222 Check command object for the `check_procs` plugin.
2227 ---------------------|--------------
2228 procs_warning | **Optional.** The process count warning threshold. Defaults to 250.
2229 procs_critical | **Optional.** The process count critical threshold. Defaults to 400.
2230 procs_metric | **Optional.** Check thresholds against metric.
2231 procs_timeout | **Optional.** Seconds before plugin times out.
2232 procs_traditional | **Optional.** Filter own process the traditional way by PID instead of /proc/pid/exe. Defaults to "false".
2233 procs_state | **Optional.** Only scan for processes that have one or more of the status flags you specify.
2234 procs_ppid | **Optional.** Only scan for children of the parent process ID indicated.
2235 procs_vsz | **Optional.** Only scan for processes with VSZ higher than indicated.
2236 procs_rss | **Optional.** Only scan for processes with RSS higher than indicated.
2237 procs_pcpu | **Optional.** Only scan for processes with PCPU higher than indicated.
2238 procs_user | **Optional.** Only scan for processes with user name or ID indicated.
2239 procs_argument | **Optional.** Only scan for processes with args that contain STRING.
2240 procs_argument_regex | **Optional.** Only scan for processes with args that contain the regex STRING.
2241 procs_command | **Optional.** Only scan for exact matches of COMMAND (without path).
2242 procs_nokthreads | **Optional.** Only scan for non kernel threads. Defaults to "false".
2244 #### <a id="plugin-check-command-swap"></a> swap
2246 Check command object for the `check_swap` plugin.
2251 ----------------|--------------
2252 swap_wfree | **Optional.** The free swap space warning threshold in %. Defaults to 50.
2253 swap_cfree | **Optional.** The free swap space critical threshold in %. Defaults to 25.
2255 #### <a id="plugin-check-command-load"></a> load
2257 Check command object for the `check_load` plugin.
2262 ----------------|--------------
2263 load_wload1 | **Optional.** The 1-minute warning threshold. Defaults to 5.
2264 load_wload5 | **Optional.** The 5-minute warning threshold. Defaults to 4.
2265 load_wload15 | **Optional.** The 15-minute warning threshold. Defaults to 3.
2266 load_cload1 | **Optional.** The 1-minute critical threshold. Defaults to 10.
2267 load_cload5 | **Optional.** The 5-minute critical threshold. Defaults to 6.
2268 load_cload15 | **Optional.** The 15-minute critical threshold. Defaults to 4.
2270 #### <a id="plugin-check-command-snmp"></a> snmp
2272 Check command object for the `check_snmp` plugin.
2277 --------------------|--------------
2278 snmp_address | **Optional.** The host's address. Defaults to "$address$".
2279 snmp_oid | **Required.** The SNMP OID.
2280 snmp_community | **Optional.** The SNMP community. Defaults to "public".
2281 snmp_warn | **Optional.** The warning threshold.
2282 snmp_crit | **Optional.** The critical threshold.
2283 snmp_string | **Optional.** Return OK state if the string matches exactly with the output value
2284 snmp_ereg | **Optional.** Return OK state if extended regular expression REGEX matches with the output value
2285 snmp_eregi | **Optional.** Return OK state if case-insensitive extended REGEX matches with the output value
2286 snmp_label | **Optional.** Prefix label for output value
2287 snmp_invert_search | **Optional.** Invert search result and return CRITICAL state if found
2288 snmp_units | **Optional.** Units label(s) for output value (e.g., 'sec.').
2290 #### <a id="plugin-check-command-snmp"></a> snmpv3
2292 Check command object for the `check_snmp` plugin, using SNMPv3 authentication and encryption options.
2297 ------------------|--------------
2298 snmpv3_address | **Optional.** The host's address. Defaults to "$address$".
2299 snmpv3_user | **Required.** The username to log in with.
2300 snmpv3_auth_alg | **Optional.** The authentication algorithm. Defaults to SHA.
2301 snmpv3_auth_key | **Required.** The authentication key.
2302 snmpv3_priv_alg | **Optional.** The encryption algorithm. Defaults to AES.
2303 snmpv3_priv_key | **Required.** The encryption key.
2304 snmpv3_oid | **Required.** The SNMP OID.
2305 snmpv3_warn | **Optional.** The warning threshold.
2306 snmpv3_crit | **Optional.** The critical threshold.
2308 #### <a id="plugin-check-command-snmp-uptime"></a> snmp-uptime
2310 Check command object for the `check_snmp` plugin.
2315 ----------------|--------------
2316 snmp_address | **Optional.** The host's address. Defaults to "$address$".
2317 snmp_oid | **Optional.** The SNMP OID. Defaults to "1.3.6.1.2.1.1.3.0".
2318 snmp_community | **Optional.** The SNMP community. Defaults to "public".
2320 #### <a id="plugin-check-command-dns"></a> dns
2322 Check command object for the `check_dns` plugin.
2327 ---------------------|--------------
2328 dns_lookup | **Optional.** The hostname or IP to query the DNS for. Defaults to $host_name$.
2329 dns_server | **Optional.** The DNS server to query. Defaults to the server configured in the OS.
2330 dns_expected_answer | **Optional.** The answer to look for. A hostname must end with a dot.
2331 dns_authoritative | **Optional.** Expect the server to send an authoritative answer.
2333 #### <a id="plugin-check-command-dig"></a> dig
2335 Check command object for the `check_dig` plugin.
2340 ---------------------|--------------
2341 dig_server | **Optional.** The DNS server to query. Defaults to "127.0.0.1".
2342 dig_lookup | **Optional.** The address that should be looked up.
2344 #### <a id="plugin-check-command-dhcp"></a> dhcp
2346 Check command object for the `check_dhcp` plugin.
2351 ----------------|--------------
2352 dhcp_serverip | **Optional.** The IP address of the DHCP server which we should get a response from.
2353 dhcp_requestedip| **Optional.** The IP address which we should be offered by a DHCP server.
2354 dhcp_timeout | **Optional.** The timeout in seconds.
2355 dhcp_interface | **Optional.** The interface to use.
2356 dhcp_mac | **Optional.** The MAC address to use in the DHCP request.
2357 dhcp_unicast | **Optional.** Whether to use unicast requests. Defaults to false.
2359 #### <a id="plugin-check-command-nscp"></a> nscp
2361 Check command object for the `check_nt` plugin.
2366 ----------------|--------------
2367 nscp_address | **Optional.** The host's address. Defaults to "$address$".
2368 nscp_port | **Optional.** The NSClient++ port. Defaults to 12489.
2369 nscp_password | **Optional.** The NSClient++ password.
2370 nscp_variable | **Required.** The variable that should be checked.
2371 nscp_params | **Optional.** Parameters for the query.
2372 nscp_warn | **Optional.** The warning threshold.
2373 nscp_crit | **Optional.** The critical threshold.
2374 nscp_timeout | **Optional.** The query timeout in seconds.
2376 #### <a id="plugin-check-command-by-ssh"></a> by_ssh
2378 Check command object for the `check_by_ssh` plugin.
2383 ----------------|--------------
2384 by_ssh_address | **Optional.** The host's address. Defaults to "$address$".
2385 by_ssh_port | **Optional.** The SSH port. Defaults to 22.
2386 by_ssh_command | **Optional.** The command that should be executed.
2387 by_ssh_logname | **Optional.** The SSH username.
2388 by_ssh_identity | **Optional.** The SSH identity.
2389 by_ssh_quiet | **Optional.** Whether to suppress SSH warnings. Defaults to false.
2390 by_ssh_warn | **Optional.** The warning threshold.
2391 by_ssh_crit | **Optional.** The critical threshold.
2392 by_ssh_timeout | **Optional.** The timeout in seconds.
2394 #### <a id="plugin-check-command-ups"></a> ups
2396 Check command object for the `check_ups` plugin.
2401 ----------------|--------------
2402 ups_address | **Optional.** The host's address. Defaults to "$address$".
2403 ups_name | **Optional.** The UPS name. Defaults to `ups`.
2406 #### <a id="plugin-check-command-nrpe"></a> nrpe
2408 Check command object for the `check_nrpe` plugin.
2413 ----------------|--------------
2414 nrpe_address | **Optional.** The host's address. Defaults to "$address$".
2415 nrpe_port | **Optional.** The NRPE port. Defaults to 5668.
2416 nrpe_command | **Optional.** The command that should be executed.
2417 nrpe_no_ssl | **Optional.** Whether to disable SSL or not. Defaults to `false`.
2418 nrpe_timeout_unknown | **Optional.** Whether to set timeouts to unknown instead of critical state. Defaults to `false`.
2419 nrpe_timeout | **Optional.** The timeout in seconds.
2421 #### <a id="plugin-check-command-apt"></a> apt
2423 Check command for the `check_apt` plugin.
2425 The `apt` check command does not support any vars.
2428 #### <a id="plugin-check-command-running-kernel"></a> running_kernel
2430 Check command object for the `check_running_kernel` plugin
2431 provided by the `nagios-plugins-contrib` package on Debian.
2433 The `running_kernel` check command does not support any vars.
2436 ## <a id="snmp-manubulon-plugin-check-commands"></a> SNMP Manubulon Plugin Check Commands
2438 ### <a id="snmp-manubulon-plugin-check-commands-overview"></a> Overview
2440 The `SNMP Manubulon Plugin Check Commands` provide example configuration for plugin check
2441 commands provided by the [SNMP Manubulon project](http://nagios.manubulon.com/index_snmp.html).
2443 The SNMP manubulon plugin check commands assume that the global constant named `ManubulonPluginDir`
2444 is set to the path where the Manubublon SNMP plugins are installed.
2446 You can enable these plugin check commands by adding the following the include directive in your
2447 configuration [icinga2.conf](#icinga2-conf) file:
2451 ### Checks by Host Type
2453 **N/A** : Not available for this type.
2455 **SNMP** : Available for simple SNMP query.
2459 **Specific** : Script name for platform specific checks.
2462 Host type | Interface | storage | load/cpu | mem | process | env | specific
2463 ------------------------|------------|----------|-----------|-----|----------|-----|-------------------------
2464 Linux | Yes | Yes | Yes | Yes | Yes | No |
2465 Windows | Yes | Yes | Yes | Yes | Yes | No | check_snmp_win.pl
2466 Cisco router/switch | Yes | N/A | Yes | Yes | N/A | Yes |
2467 HP router/switch | Yes | N/A | Yes | Yes | N/A | No |
2468 Bluecoat proxy | Yes | SNMP | Yes | SNMP| No | Yes |
2469 CheckPoint on SPLAT | Yes | Yes | Yes | Yes | Yes | No | check_snmp_cpfw.pl
2470 CheckPoint on Nokia IP | Yes | Yes | Yes | No | ?? | No | check_snmp_vrrp.pl
2471 Boostedge | Yes | Yes | Yes | Yes | ?? | No | check_snmp_boostedge.pl
2472 AS400 | Yes | Yes | Yes | Yes | No | No |
2473 NetsecureOne Netbox | Yes | Yes | Yes | ?? | Yes | No |
2474 Radware Linkproof | Yes | N/A | SNMP | SNMP| No | No | check_snmp_linkproof_nhr <br> check_snmp_vrrp.pl
2475 IronPort | Yes | SNMP | SNMP | SNMP| No | Yes |
2476 Cisco CSS | Yes | ?? | Yes | Yes | No | ?? | check_snmp_css.pl
2479 #### <a id="plugin-check-command-snmp-load"></a> snmp-load
2481 Check command object for the [check_snmp_load.pl](http://nagios.manubulon.com/snmp_load.html) plugin.
2487 ------------------------|--------------
2488 snmp_address | **Optional.** The host's address. Defaults to "$address$".
2489 snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false".
2490 snmp_community | **Optional.** The SNMP community. Defaults to "public".
2491 snmp_port | **Optional.** The SNMP port connection.
2492 snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false".
2493 snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false".
2494 snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser".
2495 snmp_password | **Required.** SNMP version 3 password. No value defined as default.
2496 snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false".
2497 snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des".
2498 snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default.
2499 snmp_warn | **Optional.** The warning threshold. Change the `snmp_load_type` var to "netsl" for using 3 values.
2500 snmp_crit | **Optional.** The critical threshold. Change the `snmp_load_type` var to "netsl" for using 3 values.
2501 snmp_load_type | **Optional.** Load type. Defaults to "stand". Check all available types in the [snmp load](http://nagios.manubulon.com/snmp_load.html) documentation.
2502 snmp_perf | **Optional.** Enable perfdata values. Defaults to "true".
2504 #### <a id="plugin-check-command-snmp-memory"></a> snmp-memory
2506 Check command object for the [check_snmp_mem.pl](http://nagios.manubulon.com/snmp_mem.html) plugin.
2511 ------------------------|--------------
2512 snmp_address | **Optional.** The host's address. Defaults to "$address$".
2513 snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false".
2514 snmp_community | **Optional.** The SNMP community. Defaults to "public".
2515 snmp_port | **Optional.** The SNMP port connection.
2516 snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false".
2517 snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false".
2518 snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser".
2519 snmp_password | **Required.** SNMP version 3 password. No value defined as default.
2520 snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false".
2521 snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des".
2522 snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default.
2523 snmp_warn | **Optional.** The warning threshold.
2524 snmp_crit | **Optional.** The critical threshold.
2525 snmp_perf | **Optional.** Enable perfdata values. Defaults to "true".
2527 #### <a id="plugin-check-command-snmp-storage"></a> snmp-storage
2529 Check command object for the [check_snmp_storage.pl](http://nagios.manubulon.com/snmp_storage.html) plugin.
2534 ------------------------|--------------
2535 snmp_address | **Optional.** The host's address. Defaults to "$address$".
2536 snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false".
2537 snmp_community | **Optional.** The SNMP community. Defaults to "public".
2538 snmp_port | **Optional.** The SNMP port connection.
2539 snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false".
2540 snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false".
2541 snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser".
2542 snmp_password | **Required.** SNMP version 3 password. No value defined as default.
2543 snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false".
2544 snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des".
2545 snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default.
2546 snmp_warn | **Optional.** The warning threshold.
2547 snmp_crit | **Optional.** The critical threshold.
2548 snmp_storage_name | **Optional.** Storage name. Default to regex "^/$$". More options available in the [snmp storage](http://nagios.manubulon.com/snmp_storage.html) documentation.
2549 snmp_perf | **Optional.** Enable perfdata values. Defaults to "true".
2551 #### <a id="plugin-check-command-snmp-interface"></a> snmp-interface
2553 Check command object for the [check_snmp_int.pl](http://nagios.manubulon.com/snmp_int.html) plugin.
2558 ------------------------|--------------
2559 snmp_address | **Optional.** The host's address. Defaults to "$address$".
2560 snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false".
2561 snmp_community | **Optional.** The SNMP community. Defaults to "public".
2562 snmp_port | **Optional.** The SNMP port connection.
2563 snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false".
2564 snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false".
2565 snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser".
2566 snmp_password | **Required.** SNMP version 3 password. No value defined as default.
2567 snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false".
2568 snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des".
2569 snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default..
2570 snmp_warn | **Optional.** The warning threshold.
2571 snmp_crit | **Optional.** The critical threshold.
2572 snmp_interface | **Optional.** Network interface name. Default to regex "eth0".
2573 snmp_interface_perf | **Optional.** Check the input/ouput bandwidth of the interface. Defaults to "true".
2574 snmp_interface_bits | **Optional.** Make the warning and critical levels in KBits/s. Defaults to "true".
2575 snmp_interface_64bit | **Optional.** Use 64 bits counters instead of the standard counters when checking bandwidth & performance data for interface >= 1Gbps. Defaults to "false".
2576 snmp_perf | **Optional.** Enable perfdata values. Defaults to "true".
2578 #### <a id="plugin-check-command-snmp-process"></a> snmp-process
2580 Check command object for the [check_snmp_process.pl](http://nagios.manubulon.com/snmp_process.html) plugin.
2585 ------------------------|--------------
2586 snmp_address | **Optional.** The host's address. Defaults to "$address$".
2587 snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false".
2588 snmp_community | **Optional.** The SNMP community. Defaults to "public".
2589 snmp_port | **Optional.** The SNMP port connection.
2590 snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false".
2591 snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false".
2592 snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser".
2593 snmp_password | **Required.** SNMP version 3 password. No value defined as default.
2594 snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false".
2595 snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des".
2596 snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default..
2597 snmp_warn | **Optional.** The warning threshold.
2598 snmp_crit | **Optional.** The critical threshold.
2599 snmp_process_name | **Optional.** Name of the process (regexp). No trailing slash!. Defaults to ".*".
2600 snmp_perf | **Optional.** Enable perfdata values. Defaults to "true".