* [Register](https://exchange.icinga.org/authentication/register) an Icinga account.
* Create a new issue at the [Icinga 2 Development Tracker](https://dev.icinga.org/projects/i2).
-* When reporting a bug, please include the details described in the [Troubleshooting](10-troubleshooting.md#troubleshooting-information-required) chapter (version, configs, logs, etc).
+* When reporting a bug, please include the details described in the [Troubleshooting](12-troubleshooting.md#troubleshooting-information-required) chapter (version, configs, logs, etc).
## <a id="whats-new"></a> What's new
> **Note**
>
> If you are using an older version of Icinga Web, install it like this and adapt
-> the configuration manually as shown in [the RPM notes](8-alternative-frontends.md#icinga-web-rpm-notes):
+> the configuration manually as shown in [the RPM notes](10-alternative-frontends.md#icinga-web-rpm-notes):
>
> `apt-get install --no-install-recommends icinga-web`
>
> Only install the Livestatus feature if your web interface or addon requires
> you to do so (for example, [Icinga Web 2](2-getting-started.md#setting-up-icingaweb2)).
-> [Icinga Classic UI](8-alternative-frontends.md#setting-up-icinga-classic-ui) and [Icinga Web](8-alternative-frontends.md#setting-up-icinga-web)
+> [Icinga Classic UI](10-alternative-frontends.md#setting-up-icinga-classic-ui) and [Icinga Web](10-alternative-frontends.md#setting-up-icinga-web)
> do not use Livestatus as backend.
The Livestatus component that is distributed as part of Icinga 2 is a
* Unix socket (default)
* TCP socket
-Details on the configuration can be found in the [LivestatusListener](15-object-types.md#objecttype-livestatuslistener)
+Details on the configuration can be found in the [LivestatusListener](5-object-types.md#objecttype-livestatuslistener)
object configuration.
### <a id="livestatus-get-queries"></a> Livestatus GET Queries
downtimes | services | status attributes
timeperiods | | name and is inside flag
endpoints | | config and status attributes
- log | services, hosts, contacts, commands | parses [compatlog](15-object-types.md#objecttype-compatlogger) and shows log attributes
- statehist | hosts, services | parses [compatlog](15-object-types.md#objecttype-compatlogger) and aggregates state change attributes
+ log | services, hosts, contacts, commands | parses [compatlog](5-object-types.md#objecttype-compatlogger) and shows log attributes
+ statehist | hosts, services | parses [compatlog](5-object-types.md#objecttype-compatlogger) and aggregates state change attributes
The `commands` table is populated with `CheckCommand`, `EventCommand` and `NotificationCommand` objects.
* Provide complete configuration snippets explaining your problem in detail
* Provide complete logs targetting your problem
* If the check command failed - what's the output of your manual plugin tests?
-* In case of [debugging](10-troubleshooting.md#debug) Icinga 2, the full back traces and outputs
+* In case of [debugging](12-troubleshooting.md#debug) Icinga 2, the full back traces and outputs
## <a id="troubleshooting-enable-debug-output"></a> Enable Debug Output
The `icinga2 object list` CLI command can be used to list all configuration objects and their
attributes. The tool also shows where each of the attributes was modified.
-That way you can also identify which objects have been created from your [apply rules](13-language-reference.md#apply).
+That way you can also identify which objects have been created from your [apply rules](15-language-reference.md#apply).
# icinga2 object list
## <a id="check-command-definitions"></a> Where are the check command definitions?
-Icinga 2 ships additional [plugin check command definitions](16-icinga-template-library.md#plugin-check-commands) which are
+Icinga 2 ships additional [plugin check command definitions](6-icinga-template-library.md#plugin-check-commands) which are
included using
include <itl>
* Check the debug log to see if the check command gets executed
* Verify that failed depedencies do not prevent command execution
* Make sure that the plugin is executable by the Icinga 2 user (run a manual test)
-* Make sure the [checker](6-cli-commands.md#features) feature is enabled.
+* Make sure the [checker](8-cli-commands.md#features) feature is enabled.
Examples:
* Do the notification attributes `states`, `types`, `period` match the notification conditions?
* Do the user attributes `states`, `types`, `period` match the notification conditions?
* Are there any notification `begin` and `end` times configured?
-* Make sure the [notification](6-cli-commands.md#features) feature is enabled.
+* Make sure the [notification](8-cli-commands.md#features) feature is enabled.
* Does the referenced NotificationCommand work when executed as Icinga user on the shell?
If notifications are to be sent via mail make sure that the mail program specified exists.
## <a id="configuration-ignored"></a> Configuration is ignored
-* Make sure that the line(s) are not [commented out](13-language-reference.md#comments) (starting with `//` or `#`, or
+* Make sure that the line(s) are not [commented out](15-language-reference.md#comments) (starting with `//` or `#`, or
encapsulated by `/* ... */`).
* Is the configuration file included in [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf)?
## <a id="configuration-attribute-inheritance"></a> Configuration attributes are inherited from
-Icinga 2 allows you to import templates using the [import](13-language-reference.md#template-imports) keyword. If these templates
+Icinga 2 allows you to import templates using the [import](15-language-reference.md#template-imports) keyword. If these templates
contain additional attributes, your objects will automatically inherit them. You can override
or modify these attributes in the current object.
## <a id="troubleshooting-cluster"></a> Cluster Troubleshooting
-You should configure the [cluster health checks](5-monitoring-remote-systems.md#cluster-health-check) if you haven't
+You should configure the [cluster health checks](7-monitoring-remote-systems.md#cluster-health-check) if you haven't
done so already.
> **Note**
* Within a config master zone, only one configuration master is allowed to have its config in `/etc/icinga2/zones.d`.
** The master syncs the configuration to `/var/lib/icinga2/api/zones/` during startup and only syncs valid configuration to the other nodes
** The other nodes receive the configuration into `/var/lib/icinga2/api/zones/`
-* The `icinga2.log` log file will indicate whether this ApiListener [accepts config](5-monitoring-remote-systems.md#zone-config-sync-permissions), or not
+* The `icinga2.log` log file will indicate whether this ApiListener [accepts config](7-monitoring-remote-systems.md#zone-config-sync-permissions), or not
## <a id="debug"></a> Debug Icinga 2
For a long-term migration of your configuration you should consider re-creating
your configuration based on the proposed Icinga 2 configuration paradigm.
-Please read the [next chapter](12-migrating-from-icinga-1x.md#differences-1x-2) to find out more about the differences
+Please read the [next chapter](14-migrating-from-icinga-1x.md#differences-1x-2) to find out more about the differences
between 1.x and 2.
### <a id="manual-config-migration-hints"></a> Manual Config Migration Hints
The examples are taken from Icinga 1.x test and production environments and converted
straight into a possible Icinga 2 format. If you found a different strategy, send a patch!
-If you require in-depth explanations, please check the [next chapter](12-migrating-from-icinga-1x.md#differences-1x-2).
+If you require in-depth explanations, please check the [next chapter](14-migrating-from-icinga-1x.md#differences-1x-2).
#### <a id="manual-config-migration-hints-Intervals"></a> Manual Config Migration Hints for Intervals
hostgroup_members hg1
}
-This can be migrated to Icinga 2 and [using group assign](13-language-reference.md#group-assign). The additional nested hostgroup
+This can be migrated to Icinga 2 and [using group assign](15-language-reference.md#group-assign). The additional nested hostgroup
`hg1` is included into `hg2` with the `groups` attribute.
For the check command it is required to
* Escape all double quotes with an additional `\`.
-* Replace all [runtime macros](12-migrating-from-icinga-1x.md#manual-config-migration-hints-runtime-macros), e.g. `$HOSTADDRESS$` with `$address$`.
-* Replace [custom variable macros](12-migrating-from-icinga-1x.md#manual-config-migration-hints-runtime-custom-attributes) if any.
+* Replace all [runtime macros](14-migrating-from-icinga-1x.md#manual-config-migration-hints-runtime-macros), e.g. `$HOSTADDRESS$` with `$address$`.
+* Replace [custom variable macros](14-migrating-from-icinga-1x.md#manual-config-migration-hints-runtime-custom-attributes) if any.
* Keep `$ARGn$` macros.
The final check command looks like this in Icinga2:
#### <a id="manual-config-migration-hints-runtime-macros"></a> Manual Config Migration Hints for Runtime Macros
-Runtime macros have been renamed. A detailed comparison table can be found [here](12-migrating-from-icinga-1x.md#differences-1x-2-runtime-macros).
+Runtime macros have been renamed. A detailed comparison table can be found [here](14-migrating-from-icinga-1x.md#differences-1x-2-runtime-macros).
For example, accessing the service check output looks like the following in Icinga 1.x:
#### <a id="manual-config-migration-hints-contacts-users"></a> Manual Config Migration Hints for Contacts (Users)
Contacts in Icinga 1.x act as users in Icinga 2, but do not have any notification commands specified.
-This migration part is explained in the [next chapter](12-migrating-from-icinga-1x.md#manual-config-migration-hints-notifications).
+This migration part is explained in the [next chapter](14-migrating-from-icinga-1x.md#manual-config-migration-hints-notifications).
define contact{
contact_name testconfig-user
email icinga@localhost
}
-The `service_notification_options` can be [mapped](12-migrating-from-icinga-1x.md#manual-config-migration-hints-notification-filters)
+The `service_notification_options` can be [mapped](14-migrating-from-icinga-1x.md#manual-config-migration-hints-notification-filters)
into generic `state` and `type` filters, if additional notification filtering is required. `alias` gets
renamed to `display_name`.
Convert the `notification_options` attribute from Icinga 1.x to Icinga 2 `states` and `types`. Details
-[here](12-migrating-from-icinga-1x.md#manual-config-migration-hints-notification-filters). Add the notification period.
+[here](14-migrating-from-icinga-1x.md#manual-config-migration-hints-notification-filters). Add the notification period.
states = [ OK, Warning, Critical ]
types = [ Recovery, Problem, Custom ]
assign where "hg_svcdep2" in host.groups
}
-Host dependencies are explained in the [next chapter](12-migrating-from-icinga-1x.md#manual-config-migration-hints-host-parents).
+Host dependencies are explained in the [next chapter](14-migrating-from-icinga-1x.md#manual-config-migration-hints-host-parents).
* Icinga 2 does not support any 1.x NEB addons for check load distribution
* If your current setup consists of instances distributing the check load, you should consider
-building a [load distribution](5-monitoring-remote-systems.md#cluster-scenarios-load-distribution) setup with Icinga 2.
+building a [load distribution](7-monitoring-remote-systems.md#cluster-scenarios-load-distribution) setup with Icinga 2.
* If your current setup includes active/passive clustering with external tools like Pacemaker/DRBD
-consider the [High Availability](5-monitoring-remote-systems.md#cluster-scenarios-high-availability) setup.
+consider the [High Availability](7-monitoring-remote-systems.md#cluster-scenarios-high-availability) setup.
* If you have build your own custom configuration deployment and check result collecting mechanism
you should re-design your setup and re-evaluate your requirements, and how they may be fulfilled
using the Icinga 2 cluster capabilities.
### <a id="differences-1x-2-main-config"></a> Main Config File
In Icinga 1.x there are many global configuration settings available in `icinga.cfg`.
-Icinga 2 only uses a small set of [global constants](13-language-reference.md#constants) allowing
+Icinga 2 only uses a small set of [global constants](15-language-reference.md#constants) allowing
you to specify certain different setting such as the `NodeName` in a cluster scenario.
Aside from that, the [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf) should take care of including
-global constants, enabled [features](6-cli-commands.md#features) and the object configuration.
+global constants, enabled [features](8-cli-commands.md#features) and the object configuration.
### <a id="differences-1x-2-include-files-dirs"></a> Include Files and Directories
const PluginDir = "/usr/lib/nagios/plugins"
-[Global macros](13-language-reference.md#constants) can only be defined once. Trying to modify a
+[Global macros](15-language-reference.md#constants) can only be defined once. Trying to modify a
global constant will result in an error.
### <a id="differences-1x-2-configuration-comments"></a> Configuration Comments
requiring some command timeouts to be extended.
Icinga 2 allows you to specify the command timeout directly on the command. So
-if your VMVware check plugin takes 15 minutes, [increase the timeout](15-object-types.md#objecttype-checkcommand)
+if your VMVware check plugin takes 15 minutes, [increase the timeout](5-object-types.md#objecttype-checkcommand)
accordingly.
For detailed examples on how to use the dependencies please check the [dependencies](3-monitoring-basics.md#dependencies)
chapter.
-Dependencies can be applied to hosts or services using the [apply rules](13-language-reference.md#apply).
+Dependencies can be applied to hosts or services using the [apply rules](15-language-reference.md#apply).
The `StatusDataWriter`, `IdoMysqlConnection` and `LivestatusListener` types
support the Icinga 1.x schema with dependencies and parent attributes for
* parent process continues with old configuration objects and the event scheduling
(doing checks, replicating cluster events, triggering alert notifications, etc.)
* validation NOT ok: child process terminates, parent process continues with old configuration state
-(this is ESSENTIAL for the [cluster config synchronisation](5-monitoring-remote-systems.md#cluster-zone-config-sync))
+(this is ESSENTIAL for the [cluster config synchronisation](7-monitoring-remote-systems.md#cluster-zone-config-sync))
* validation ok: child process signals parent process to terminate and save its current state
(all events until now) into the icinga2 state file
* parent process shuts down writing icinga2.state file
not synced between the master and slave nodes. There are addons available solving the check
and configuration distribution problems Icinga 1.x distributed monitoring currently suffers from.
-Icinga 2 implements a new built-in [distributed monitoring architecture](5-monitoring-remote-systems.md#distributed-monitoring-high-availability),
+Icinga 2 implements a new built-in [distributed monitoring architecture](7-monitoring-remote-systems.md#distributed-monitoring-high-availability),
including config and check distribution, IPv4/IPv6 support, SSL certificates and zone support for DMZ.
High Availability and load balancing are also part of the Icinga 2 Cluster setup.
check_interval = len(MyGroups) * 1m
}
-A list of available functions is available in the [Library Reference](14-library-reference.md#library-reference) chapter.
+A list of available functions is available in the [Library Reference](16-library-reference.md#library-reference) chapter.
## <a id="dictionary-operators"></a> Assignments
In this example the `assign where` condition is a boolean expression which is
evaluated for all objects of type `Host` and a new service with name "ping"
-is created for each matching host. [Expression operators](13-language-reference.md#expression-operators)
+is created for each matching host. [Expression operators](15-language-reference.md#expression-operators)
may be used in `assign where` conditions.
The `to` keyword and the target type may be omitted if there is only one target
In this example the `assign where` condition is a boolean expression which is evaluated
for all objects of the type `Host`. Each matching host is added as member to the host group
with the name "linux-servers". Membership exclusion can be controlled using the `ignore where`
-condition. [Expression operators](13-language-reference.md#expression-operators) may be used in `assign where` and
+condition. [Expression operators](15-language-reference.md#expression-operators) may be used in `assign where` and
`ignore where` conditions.
Source Type | Variables
Non-empty dictionary | { key = "value" } | true
For a list of supported expression operators for `assign where` and `ignore where`
-statements, see [expression operators](13-language-reference.md#expression-operators).
+statements, see [expression operators](15-language-reference.md#expression-operators).
## <a id="comments"></a> Comments
config compiler to search the include search paths for the specified
file. By default $PREFIX/share/icinga2/include is included in the list of search
paths. Additional include search paths can be added using
-[command-line options](6-cli-commands.md#config-include-path).
+[command-line options](8-cli-commands.md#config-include-path).
Wildcards are not permitted when using angle brackets.
available Icinga web interfaces. It assumes that you are familiar with
the system you're installing Icinga 2 on.
-Details on troubleshooting problems can be found [here](10-troubleshooting.md#troubleshooting).
+Details on troubleshooting problems can be found [here](12-troubleshooting.md#troubleshooting).
## <a id="setting-up-icinga2"></a> Setting up Icinga 2
* `notification` for sending notifications
* `mainlog` for writing the `icinga2.log` file
-You can verify that by calling `icinga2 feature list` [CLI command](6-cli-commands.md#cli-command-feature)
+You can verify that by calling `icinga2 feature list` [CLI command](8-cli-commands.md#cli-command-feature)
to see which features are enabled and disabled.
# icinga2 feature list
This macro is used by the check command definitions contained in the Icinga Template Library
to determine where to find the plugin binaries.
-Please refer to the [plugins](7-addons-plugins.md#plugins) chapter for details about how to integrate
+Please refer to the [plugins](9-addons-plugins.md#plugins) chapter for details about how to integrate
additional check plugins into your Icinga 2 setup.
## <a id="configuring-db-ido"></a> Configuring DB IDO
`/etc/icinga2/features-available/ido-mysql.conf`. You will need to update the
database credentials in this file.
All available attributes are listed in the
-[IdoMysqlConnection object](15-object-types.md#objecttype-idomysqlconnection) configuration details.
+[IdoMysqlConnection object](5-object-types.md#objecttype-idomysqlconnection) configuration details.
You can enable the `ido-mysql` feature configuration file using `icinga2 feature enable`:
`/etc/icinga2/features-available/ido-pgsql.conf`. You will need to update the
database credentials in this file.
All available attributes are listed in the
-[IdoPgsqlConnection object](15-object-types.md#objecttype-idopgsqlconnection) configuration details.
+[IdoPgsqlConnection object](5-object-types.md#objecttype-idopgsqlconnection) configuration details.
You can enable the `ido-pgsql` feature configuration file using `icinga2 feature enable`:
status | The `status` action checks if Icinga 2 is running.
enable | The `enable` action enables the service being started at system boot time (similar to `chkconfig`)
-If you're stuck with configuration errors, you can manually invoke the [configuration validation](6-cli-commands.md#config-validation).
+If you're stuck with configuration errors, you can manually invoke the [configuration validation](8-cli-commands.md#config-validation).
# systemctl enable icinga2
## <a id="setting-up-the-user-interface"></a> Setting up the User Interface
Icinga 2 can be used with Icinga Web 2 and a number of other web interfaces. This chapter explains how
-to set up Icinga Web 2. The [Alternative Frontends](8-alternative-frontends.md#alternative-frontends) chapter can be used as a
+to set up Icinga Web 2. The [Alternative Frontends](10-alternative-frontends.md#alternative-frontends) chapter can be used as a
starting point for installing some of the other web interfaces which are also available.
### <a id="install-addons"></a> Addons
A number of additional features are available in the form of plugins. A list of popular
-addons is available in the [Addons and Plugins](7-addons-plugins.md#addons-plugins) chapter.
+addons is available in the [Addons and Plugins](9-addons-plugins.md#addons-plugins) chapter.
The `address` attribute is used by check commands to determine which network
address is associated with the host object.
-Details on troubleshooting check problems can be found [here](10-troubleshooting.md#troubleshooting).
+Details on troubleshooting check problems can be found [here](12-troubleshooting.md#troubleshooting).
### <a id="host-states"></a> Host States
Service checks could also use a `dummy` check, but the common strategy is to
[integrate an existing plugin](3-monitoring-basics.md#command-plugin-integration) as
[check command](3-monitoring-basics.md#check-commands) and [reference](3-monitoring-basics.md#command-passing-parameters)
-that in your [Service](15-object-types.md#objecttype-service) object definition.
+that in your [Service](5-object-types.md#objecttype-service) object definition.
## <a id="configuration-best-practice"></a> Configuration Best Practice
There are many ways of creating Icinga 2 configuration objects:
* Manually with your preferred editor, for example vi(m), nano, notepad, etc.
-* Generated by a [configuration management too](7-addons-plugins.md#configuration-tools) such as Puppet, Chef, Ansible, etc.
+* Generated by a [configuration management too](9-addons-plugins.md#configuration-tools) such as Puppet, Chef, Ansible, etc.
* A configuration addon for Icinga 2
* A custom exporter script from your CMDB or inventory tool
* your own.
### <a id="using-apply"></a> Apply objects based on rules
-Instead of assigning each object ([Service](15-object-types.md#objecttype-service),
-[Notification](15-object-types.md#objecttype-notification), [Dependency](15-object-types.md#objecttype-dependency),
-[ScheduledDowntime](15-object-types.md#objecttype-scheduleddowntime))
-based on attribute identifiers for example `host_name` objects can be [applied](13-language-reference.md#apply).
+Instead of assigning each object ([Service](5-object-types.md#objecttype-service),
+[Notification](5-object-types.md#objecttype-notification), [Dependency](5-object-types.md#objecttype-dependency),
+[ScheduledDowntime](5-object-types.md#objecttype-scheduleddowntime))
+based on attribute identifiers for example `host_name` objects can be [applied](15-language-reference.md#apply).
Before you start using the apply rules keep the following in mind:
* Define the best match.
* A set of unique [custom attributes](3-monitoring-basics.md#custom-attributes-apply) for these hosts/services?
* Or [group](3-monitoring-basics.md#groups) memberships, e.g. a host being a member of a hostgroup, applying services to it?
- * A generic pattern [match](13-language-reference.md#function-calls) on the host/service name?
- * [Multiple expressions combined](3-monitoring-basics.md#using-apply-expressions) with `&&` or `||` [operators](13-language-reference.md#expression-operators)
+ * A generic pattern [match](15-language-reference.md#function-calls) on the host/service name?
+ * [Multiple expressions combined](3-monitoring-basics.md#using-apply-expressions) with `&&` or `||` [operators](15-language-reference.md#expression-operators)
* All expressions must return a boolean value (an empty string is equal to `false` e.g.)
> **Note**
> **Tip**
>
> Building configuration in that dynamic way requires detailed information
-> of the generated objects. Use the `object list` [CLI command](6-cli-commands.md#cli-command-object)
-> after successful [configuration validation](6-cli-commands.md#config-validation).
+> of the generated objects. Use the `object list` [CLI command](8-cli-commands.md#cli-command-object)
+> after successful [configuration validation](8-cli-commands.md#config-validation).
#### <a id="using-apply-expressions"></a> Apply Rules Expressions
`OR` the host custom attribute `always_notify` is set to `true`.
The notification is ignored for services whose host name ends with `*internal`
-`OR` the `priority` custom attribute is [less than](13-language-reference.md#expression-operators) `2`.
+`OR` the `priority` custom attribute is [less than](15-language-reference.md#expression-operators) `2`.
template Notification "cust-xy-notification" {
users = [ "noc-xy", "mgmt-xy" ]
}
Note that numbers must be explicitely casted to string when adding to strings.
-This can be achieved by wrapping them into the [string()](13-language-reference.md#function-calls) function.
+This can be achieved by wrapping them into the [string()](15-language-reference.md#function-calls) function.
> **Tip**
>
> Building configuration in that dynamic way requires detailed information
-> of the generated objects. Use the `object list` [CLI command](6-cli-commands.md#cli-command-object)
-> after successful [configuration validation](6-cli-commands.md#config-validation).
+> of the generated objects. Use the `object list` [CLI command](8-cli-commands.md#cli-command-object)
+> after successful [configuration validation](8-cli-commands.md#config-validation).
#### <a id="using-apply-object attributes"></a> Use Object Attributes in Apply Rules
If there is a certain number of hosts, services, or users matching a pattern
it's reasonable to assign the group object to these members.
-Details on the `assign where` syntax can be found [here](13-language-reference.md#apply)
+Details on the `assign where` syntax can be found [here](15-language-reference.md#apply)
object HostGroup "prod-mssql" {
display_name = "Production MSSQL Servers"
If you don't set the `states` and `types` configuration attributes for the `User`
object, notifications for all states and types will be sent.
-Details on troubleshooting notification problems can be found [here](10-troubleshooting.md#troubleshooting).
+Details on troubleshooting notification problems can be found [here](12-troubleshooting.md#troubleshooting).
> **Note**
>
-> Make sure that the [notification](6-cli-commands.md#features) feature is enabled on your master instance
+> Make sure that the [notification](8-cli-commands.md#features) feature is enabled on your master instance
> in order to execute notification commands.
You should choose which information you (and your notified users) are interested in
### <a id="check-commands"></a> Check Commands
-[CheckCommand](15-object-types.md#objecttype-checkcommand) objects define the command line how
+[CheckCommand](5-object-types.md#objecttype-checkcommand) objects define the command line how
a check is called.
-[CheckCommand](15-object-types.md#objecttype-checkcommand) objects are referenced by
-[Host](15-object-types.md#objecttype-host) and [Service](15-object-types.md#objecttype-service) objects
+[CheckCommand](5-object-types.md#objecttype-checkcommand) objects are referenced by
+[Host](5-object-types.md#objecttype-host) and [Service](5-object-types.md#objecttype-service) objects
using the `check_command` attribute.
> **Note**
>
-> Make sure that the [checker](6-cli-commands.md#features) feature is enabled in order to
+> Make sure that the [checker](8-cli-commands.md#features) feature is enabled in order to
> execute checks.
#### <a id="command-plugin-integration"></a> Integrate the Plugin with a CheckCommand Definition
-[CheckCommand](15-object-types.md#objecttype-checkcommand) objects require the [ITL template](16-icinga-template-library.md#itl-plugin-check-command)
+[CheckCommand](5-object-types.md#objecttype-checkcommand) objects require the [ITL template](6-icinga-template-library.md#itl-plugin-check-command)
`plugin-check-command` to support native plugin based check methods.
Unless you have done so already, download your check plugin and put it
> Don't execute plugins as `root` and always use the absolute path to the plugin! Trust us.
Next step is to understand how command parameters are being passed from
-a host or service object, and add a [CheckCommand](15-object-types.md#objecttype-checkcommand)
+a host or service object, and add a [CheckCommand](5-object-types.md#objecttype-checkcommand)
definition based on these required parameters and/or default values.
#### <a id="command-passing-parameters"></a> Passing Check Command Parameters from Host or Service
> **Note**
>
> A proper example for the `check_disk` plugin is already shipped with Icinga 2
-> ready to use with the [plugin check commands](16-icinga-template-library.md#plugin-check-command-disk).
+> ready to use with the [plugin check commands](6-icinga-template-library.md#plugin-check-command-disk).
The host `localhost` with the applied service `basic-partitions` checks a basic set of disk partitions
with modified custom attributes (warning thresholds at `10%`, critical thresholds at `5%`
without SSL enabled checks saving you duplicated command definitions.
Details on all available options can be found in the
-[CheckCommand object definition](15-object-types.md#objecttype-checkcommand).
+[CheckCommand object definition](5-object-types.md#objecttype-checkcommand).
### <a id="using-apply-services-command-arguments"></a> Apply Services with Custom Command Arguments
}
All hosts in the `my-linux-servers` hostgroup should get the `my-ssh` service applied based on an
-[apply rule](13-language-reference.md#apply). The optional `ssh_port` command argument should be inherited from the host
+[apply rule](15-language-reference.md#apply). The optional `ssh_port` command argument should be inherited from the host
the service is applied to. If not set, the check command `my-ssh` will omit the argument.
The `host` argument is special: `skip_key` tells Icinga 2 to ignore the key, and directly put the
value onto the command line. The `order` attribute specifies that this argument is the first one
### <a id="notification-commands"></a> Notification Commands
-[NotificationCommand](15-object-types.md#objecttype-notificationcommand) objects define how notifications are delivered to external
+[NotificationCommand](5-object-types.md#objecttype-notificationcommand) objects define how notifications are delivered to external
interfaces (E-Mail, XMPP, IRC, Twitter, etc).
-[NotificationCommand](15-object-types.md#objecttype-notificationcommand) objects are referenced by
-[Notification](15-object-types.md#objecttype-notification) objects using the `command` attribute.
+[NotificationCommand](5-object-types.md#objecttype-notificationcommand) objects are referenced by
+[Notification](5-object-types.md#objecttype-notification) objects using the `command` attribute.
-`NotificationCommand` objects require the [ITL template](16-icinga-template-library.md#itl-plugin-notification-command)
+`NotificationCommand` objects require the [ITL template](6-icinga-template-library.md#itl-plugin-notification-command)
`plugin-notification-command` to support native plugin-based notifications.
> **Note**
>
-> Make sure that the [notification](6-cli-commands.md#features) feature is enabled on your master instance
+> Make sure that the [notification](8-cli-commands.md#features) feature is enabled on your master instance
> in order to execute notification commands.
Below is an example using runtime macros from Icinga 2 (such as `$service.output$` for
* The host/service state changes into a [hard state](3-monitoring-basics.md#hard-soft-states)
* The host/service state recovers from a [soft or hard state](3-monitoring-basics.md#hard-soft-states) to [OK](3-monitoring-basics.md#service-states)/[Up](3-monitoring-basics.md#host-states)
-[EventCommand](15-object-types.md#objecttype-eventcommand) objects are referenced by
-[Host](15-object-types.md#objecttype-host) and [Service](15-object-types.md#objecttype-service) objects
+[EventCommand](5-object-types.md#objecttype-eventcommand) objects are referenced by
+[Host](5-object-types.md#objecttype-host) and [Service](5-object-types.md#objecttype-service) objects
using the `event_command` attribute.
Therefore the `EventCommand` object should define a command line
icinga ALL=(ALL) NOPASSWD: /etc/init.d/apache2 restart
-Define a generic [EventCommand](15-object-types.md#objecttype-eventcommand) object `event_by_ssh`
+Define a generic [EventCommand](5-object-types.md#objecttype-eventcommand) object `event_by_ssh`
which can be used for all event commands triggered using ssh:
/* pass event commands through ssh */
## <a id="dependencies"></a> Dependencies
-Icinga 2 uses host and service [Dependency](15-object-types.md#objecttype-dependency) objects
+Icinga 2 uses host and service [Dependency](5-object-types.md#objecttype-dependency) objects
for determing their network reachability.
A service can depend on a host, and vice versa. A service has an implicit
### <a id="recurring-downtimes"></a> Recurring Downtimes
-[ScheduledDowntime objects](15-object-types.md#objecttype-scheduleddowntime) can be used to set up
+[ScheduledDowntime objects](5-object-types.md#objecttype-scheduleddowntime) can be used to set up
recurring downtimes for services.
Example:
There are several ways of using custom attributes with [apply rules](3-monitoring-basics.md#using-apply):
-* As simple attribute literal ([number](13-language-reference.md#numeric-literals), [string](13-language-reference.md#string-literals),
-[boolean](13-language-reference.md#boolean-literals)) for expression conditions (`assign where`, `ignore where`)
-* As [array](13-language-reference.md#array) or [dictionary](13-language-reference.md#dictionary) attribute with nested values
+* As simple attribute literal ([number](15-language-reference.md#numeric-literals), [string](15-language-reference.md#string-literals),
+[boolean](15-language-reference.md#boolean-literals)) for expression conditions (`assign where`, `ignore where`)
+* As [array](15-language-reference.md#array) or [dictionary](15-language-reference.md#dictionary) attribute with nested values
(e.g. dictionaries in dictionaries) in [apply for](3-monitoring-basics.md#using-apply-for) rules.
Features like [DB IDO](3-monitoring-basics.md#db-ido), Livestatus(#setting-up-livestatus) or StatusData(#status-data)
> **Tip**
>
> Custom attributes are identified by the `vars` dictionary attribute as short name.
-> Accessing the different attribute keys is possible using the [index accessor](13-language-reference.md#indexer) `.`.
+> Accessing the different attribute keys is possible using the [index accessor](15-language-reference.md#indexer) `.`.
Custom attributes in command definitions or performance data templates are evaluated at
runtime when executing a command. These custom attributes cannot be used somewhere else
This helps passing multiple parameters to check plugins requiring them. Prominent
plugin examples are:
-* [check_disk -p](16-icinga-template-library.md#plugin-check-command-disk)
-* [check_nrpe -a](16-icinga-template-library.md#plugin-check-command-nrpe)
-* [check_nscp -l](16-icinga-template-library.md#plugin-check-command-nscp)
-* [check_dns -a](16-icinga-template-library.md#plugin-check-command-dns)
+* [check_disk -p](6-icinga-template-library.md#plugin-check-command-disk)
+* [check_nrpe -a](6-icinga-template-library.md#plugin-check-command-nrpe)
+* [check_nscp -l](6-icinga-template-library.md#plugin-check-command-nscp)
+* [check_dns -a](6-icinga-template-library.md#plugin-check-command-dns)
More details on how to use `repeat_key` and other command argument options can be
-found in [this section](15-object-types.md#objecttype-checkcommand-arguments).
+found in [this section](5-object-types.md#objecttype-checkcommand-arguments).
> **Note**
>
`service_name_template` configuration attributes.
The example below uses [runtime macros](3-monitoring-basics.md#runtime-macros) and a
-[global constant](13-language-reference.md#constants) named `GraphiteEnv`. The constant name
+[global constant](15-language-reference.md#constants) named `GraphiteEnv`. The constant name
is freely definable and should be put in the [constants.conf](4-configuring-icinga-2.md#constants-conf) file.
const GraphiteEnv = "icinga.env1"
These logs are not only used for informational representation in
external web interfaces parsing the logs, but also to generate
SLA reports and trends in Icinga 1.x Classic UI. Furthermore the
-[Livestatus](9-livestatus.md#setting-up-livestatus) feature uses these logs for answering queries to
+[Livestatus](11-livestatus.md#setting-up-livestatus) feature uses these logs for answering queries to
historical tables.
The `CompatLogger` object can be enabled with
Details on the installation can be found in the [Configuring DB IDO](2-getting-started.md#configuring-db-ido)
chapter. Details on the configuration can be found in the
-[IdoMysqlConnection](15-object-types.md#objecttype-idomysqlconnection) and
-[IdoPgsqlConnection](15-object-types.md#objecttype-idopgsqlconnection)
+[IdoMysqlConnection](5-object-types.md#objecttype-idomysqlconnection) and
+[IdoPgsqlConnection](5-object-types.md#objecttype-idopgsqlconnection)
object configuration documentation.
-The DB IDO feature supports [High Availability](5-monitoring-remote-systems.md#high-availability-db-ido) in
+The DB IDO feature supports [High Availability](7-monitoring-remote-systems.md#high-availability-db-ido) in
the Icinga 2 cluster.
The following example query checks the health of the current Icinga 2 instance
> **Tip**
>
-> Use [check plugins](7-addons-plugins.md#plugins) to monitor the backend.
+> Use [check plugins](9-addons-plugins.md#plugins) to monitor the backend.
Replace the `default` string with your instance name, if different.
* to the documentation that is distributed as part of Icinga 2.
*/
-Icinga 2 supports [C/C++-style comments](13-language-reference.md#comments).
+Icinga 2 supports [C/C++-style comments](15-language-reference.md#comments).
/**
* The constants.conf defines global constants.
This `include` directive takes care of including the configuration files for all
the features which have been enabled with `icinga2 feature enable`. See
-[Enabling/Disabling Features](6-cli-commands.md#features) for more details.
+[Enabling/Disabling Features](8-cli-commands.md#features) for more details.
/**
* The repository.d directory contains all configuration objects
This `include_recursive` directive is used for discovery of services on remote clients
and their generated configuration described in
-[this chapter](5-monitoring-remote-systems.md#icinga2-remote-monitoring-master-discovery-generate-config).
+[this chapter](7-monitoring-remote-systems.md#icinga2-remote-monitoring-master-discovery-generate-config).
/**
* The `PluginDir` constant must be pointed to your [check plugins](2-getting-started.md#setting-up-check-plugins) path.
This constant is required by the shipped
-[plugin check command configuration](16-icinga-template-library.md#plugin-check-commands).
+[plugin check command configuration](6-icinga-template-library.md#plugin-check-commands).
* The `NodeName` constant defines your local node name. Should be set to FQDN which is the default
if not set. This constant is required for local host configuration, monitoring remote clients and
cluster setup.
require a different check command, you can override it in the object definition.
The `vars` attribute can be used to define custom attributes which are available
-for check and notification commands. Most of the [Plugin Check Commands](16-icinga-template-library.md#plugin-check-commands)
+for check and notification commands. Most of the [Plugin Check Commands](6-icinga-template-library.md#plugin-check-commands)
in the Icinga Template Library require an `address` attribute.
The custom attribute `os` is evaluated by the `linux-servers` group in
> **Tip**
>
-> If you don't understand all the attributes and how to use [apply rules](13-language-reference.md#apply)
+> If you don't understand all the attributes and how to use [apply rules](15-language-reference.md#apply)
> don't worry - the [monitoring basics](3-monitoring-basics.md#monitoring-basics) chapter will explain
> that in detail.
### <a id="services-conf"></a> services.conf
-These service [apply rules](13-language-reference.md#apply) will show you how to monitor
+These service [apply rules](15-language-reference.md#apply) will show you how to monitor
the local host, but also allow you to re-use or modify them for
your own requirements.
The Debian packages also ship an additional `apt` service check applied to the local host.
The command object `icinga` for the embedded health check is provided by the
-[Icinga Template Library (ITL)](16-icinga-template-library.md#icinga-template-library) while `http_ip`, `ssh`, `load`, `processes`,
-`users` and `disk` are all provided by the [Plugin Check Commands](16-icinga-template-library.md#plugin-check-commands)
+[Icinga Template Library (ITL)](6-icinga-template-library.md#icinga-template-library) while `http_ip`, `ssh`, `load`, `processes`,
+`users` and `disk` are all provided by the [Plugin Check Commands](6-icinga-template-library.md#plugin-check-commands)
which we enabled earlier by including the `itl` and `plugins` configuration file.
In this example the `assign where` condition is a boolean expression which is
evaluated for all objects of type `Host` and a new service with name "load"
-is created for each matching host. [Expression operators](13-language-reference.md#expression-operators)
+is created for each matching host. [Expression operators](15-language-reference.md#expression-operators)
may be used in `assign where` conditions.
Multiple `assign where` condition can be combined with `AND` using the `&&` operator
attribute defined `AND` having the custom attribute `os` set to the string
`Linux`.
You can modify this condition to match multiple expressions by combinding `AND`
-and `OR` using `&&` and `||` [operators](13-language-reference.md#expression-operators), for example
+and `OR` using `&&` and `||` [operators](15-language-reference.md#expression-operators), for example
`assign where host.address && (vars.os == "Linux" || vars.os == "Windows")`.
* loop through all entries in the `host.vars.disks` dictionary. That's `disk` and `disk /` as keys.
* call `apply` on each, and set the service object name from the provided key
* inside apply, the `generic-service` template is imported
-* defining the [disk](16-icinga-template-library.md#plugin-check-command-disk) check command requiring command arguments like `disk_partition`
+* defining the [disk](6-icinga-template-library.md#plugin-check-command-disk) check command requiring command arguments like `disk_partition`
* adding the `config` dictionary items to `vars`. Simply said, there's now `vars.disk_partition` defined for the
generated service
defining whether these notifications are applies to hosts or services.
The `import` keyword imports the specific mail templates defined in [templates.conf](4-configuring-icinga-2.md#templates-conf).
-The `interval` attribute is not explicitly set - it [defaults to 30 minutes](15-object-types.md#objecttype-notification).
+The `interval` attribute is not explicitly set - it [defaults to 30 minutes](5-object-types.md#objecttype-notification).
By setting the `user_groups` to the value provided by the
respective [host.vars.notification.mail](4-configuring-icinga-2.md#hosts-conf) attribute we'll
> **Tip**
>
> Icinga 2 ships the most common command definitions already in the
-> [Plugin Check Commands](16-icinga-template-library.md#plugin-check-commands) definitions. More details on
-> that topic in the [troubleshooting section](10-troubleshooting.md#check-command-definitions).
+> [Plugin Check Commands](6-icinga-template-library.md#plugin-check-commands) definitions. More details on
+> that topic in the [troubleshooting section](12-troubleshooting.md#check-command-definitions).
You can freely customize these notification commands, and adapt them for your needs.
Read more on that topic [here](3-monitoring-basics.md#notification-commands).
custom attribute `os` set to `Linux` and is therefore automatically
a member of the host group `linux-servers`.
-This is done by using the [group assign](13-language-reference.md#group-assign) expressions similar
+This is done by using the [group assign](15-language-reference.md#group-assign) expressions similar
to previously seen [apply rules](3-monitoring-basics.md#using-apply).
object HostGroup "linux-servers" {
}
Service groups can be grouped together by similar pattern matches.
-The [match() function](13-language-reference.md#function-calls) expects a wildcard match string
+The [match() function](15-language-reference.md#function-calls) expects a wildcard match string
and the attribute string to match with.
object ServiceGroup "ping" {
}
The `hostalive` check command is shipped with Icinga 2 in the
-[Plugin Check Commands](16-icinga-template-library.md#plugin-check-commands).
+[Plugin Check Commands](6-icinga-template-library.md#plugin-check-commands).
template Notification "mail-host-notification" {
period = "24x7"
}
-More details on `Notification` object attributes can be found [here](15-object-types.md#objecttype-notification).
+More details on `Notification` object attributes can be found [here](5-object-types.md#objecttype-notification).
### <a id="downtimes-conf"></a> downtimes.conf
The `load` service apply rule defined in [services.conf](4-configuring-icinga-2.md#services-conf) defines
the `backup_downtime` custom attribute.
-The [ScheduledDowntime](15-object-types.md#objecttype-scheduleddowntime) apply rule uses this attribute
+The [ScheduledDowntime](5-object-types.md#objecttype-scheduleddowntime) apply rule uses this attribute
to define the default value for the time ranges required for recurring downtime slots.
apply ScheduledDowntime "backup-downtime" to Service {
### <a id="satellite-conf"></a> satellite.conf
-Ships default templates and dependencies for [monitoring remote clients](5-monitoring-remote-systems.md#icinga2-remote-client-monitoring)
-using service discovery and [config generation](5-monitoring-remote-systems.md#icinga2-remote-monitoring-master-discovery-generate-config)
+Ships default templates and dependencies for [monitoring remote clients](7-monitoring-remote-systems.md#icinga2-remote-client-monitoring)
+using service discovery and [config generation](7-monitoring-remote-systems.md#icinga2-remote-monitoring-master-discovery-generate-config)
on the master. Can be ignored/removed on setups not using this features.
> **Best Practice**
>
-> Assign host group members using the [group assign](13-language-reference.md#group-assign) rules.
+> Assign host group members using the [group assign](15-language-reference.md#group-assign) rules.
Example:
> **Best Practice**
>
-> Assign service group members using the [group assign](13-language-reference.md#group-assign) rules.
+> Assign service group members using the [group assign](15-language-reference.md#group-assign) rules.
Example:
> **Best Practice**
>
-> Assign user group members using the [group assign](13-language-reference.md#group-assign) rules.
+> Assign user group members using the [group assign](15-language-reference.md#group-assign) rules.
Example:
zone |**Optional.** The zone this object is a member of.
arguments |**Optional.** A dictionary of command arguments.
-Command arguments can be used the same way as for [CheckCommand objects](15-object-types.md#objecttype-checkcommand-arguments).
+Command arguments can be used the same way as for [CheckCommand objects](5-object-types.md#objecttype-checkcommand-arguments).
## <a id="objecttype-eventcommand"></a> EventCommand
timeout |**Optional.** The command timeout in seconds. Defaults to 60 seconds.
arguments |**Optional.** A dictionary of command arguments.
-Command arguments can be used the same way as for [CheckCommand objects](15-object-types.md#objecttype-checkcommand-arguments).
+Command arguments can be used the same way as for [CheckCommand objects](5-object-types.md#objecttype-checkcommand-arguments).
## <a id="objecttype-notification"></a> Notification
Metric prefix names can be modified using [runtime macros](3-monitoring-basics.md#runtime-macros).
-Example with your custom [global constant](13-language-reference.md#constants) `GraphiteEnv`:
+Example with your custom [global constant](15-language-reference.md#constants) `GraphiteEnv`:
const GraphiteEnv = "icinga.env1"
table\_prefix |**Optional.** MySQL database table prefix. Defaults to "icinga\_".
instance\_name |**Optional.** Unique identifier for the local Icinga 2 instance. Defaults to "default".
instance\_description|**Optional.** Description for the Icinga 2 instance.
- enable_ha |**Optional.** Enable the high availability functionality. Only valid in a [cluster setup](5-monitoring-remote-systems.md#high-availability-db-ido). Defaults to "true".
- failover_timeout | **Optional.** Set the failover timeout in a [HA cluster](5-monitoring-remote-systems.md#high-availability-db-ido). Must not be lower than 60s. Defaults to "60s".
+ enable_ha |**Optional.** Enable the high availability functionality. Only valid in a [cluster setup](7-monitoring-remote-systems.md#high-availability-db-ido). Defaults to "true".
+ failover_timeout | **Optional.** Set the failover timeout in a [HA cluster](7-monitoring-remote-systems.md#high-availability-db-ido). Must not be lower than 60s. Defaults to "60s".
cleanup |**Optional.** Dictionary with items for historical table cleanup.
categories |**Optional.** The types of information that should be written to the database.
table\_prefix |**Optional.** PostgreSQL database table prefix. Defaults to "icinga\_".
instance\_name |**Optional.** Unique identifier for the local Icinga 2 instance. Defaults to "default".
instance\_description|**Optional.** Description for the Icinga 2 instance.
- enable_ha |**Optional.** Enable the high availability functionality. Only valid in a [cluster setup](5-monitoring-remote-systems.md#high-availability-db-ido). Defaults to "true".
- failover_timeout | **Optional.** Set the failover timeout in a [HA cluster](5-monitoring-remote-systems.md#high-availability-db-ido). Must not be lower than 60s. Defaults to "60s".
+ enable_ha |**Optional.** Enable the high availability functionality. Only valid in a [cluster setup](7-monitoring-remote-systems.md#high-availability-db-ido). Defaults to "true".
+ failover_timeout | **Optional.** Set the failover timeout in a [HA cluster](7-monitoring-remote-systems.md#high-availability-db-ido). Must not be lower than 60s. Defaults to "60s".
cleanup |**Optional.** Dictionary with items for historical table cleanup.
categories |**Optional.** The types of information that should be written to the database.
# <a id="monitoring-remote-systems"></a> Monitoring Remote Systems
-There are multiple ways you can monitor remote clients. Be it using [agent-less](5-monitoring-remote-systems.md#agent-less-checks)
+There are multiple ways you can monitor remote clients. Be it using [agent-less](7-monitoring-remote-systems.md#agent-less-checks)
or [agent-based](agent-based-checks-addons) using additional addons & tools.
Icinga 2 uses its own unique and secure communitication protol amongst instances.
Be it an High-Availability cluster setup, distributed load-balanced setup or just a single
-agent [monitoring a remote client](5-monitoring-remote-systems.md#icinga2-remote-client-monitoring).
+agent [monitoring a remote client](7-monitoring-remote-systems.md#icinga2-remote-client-monitoring).
All communication is secured by TLS with certificates, and fully supports IPv4 and IPv6.
If you are planning to use the native Icinga 2 cluster feature for distributed
monitoring and high-availability, please continue reading in
-[this chapter](5-monitoring-remote-systems.md#distributed-monitoring-high-availability).
+[this chapter](7-monitoring-remote-systems.md#distributed-monitoring-high-availability).
> **Tip**
>
If the remote service is available using a network protocol and port,
and a [check plugin](2-getting-started.md#setting-up-check-plugins) is available, you don't
necessarily need a local client installed. Rather choose a plugin and
-configure all parameters and thresholds. The [Icinga 2 Template Library](16-icinga-template-library.md#icinga-template-library)
+configure all parameters and thresholds. The [Icinga 2 Template Library](6-icinga-template-library.md#icinga-template-library)
already ships various examples like
-* [ping4](16-icinga-template-library.md#plugin-check-command-ping4), [ping6](16-icinga-template-library.md#plugin-check-command-ping6),
-[fping4](16-icinga-template-library.md#plugin-check-command-fping4), [fping6](16-icinga-template-library.md#plugin-check-command-fping6), [hostalive](16-icinga-template-library.md#plugin-check-command-hostalive)
-* [tcp](16-icinga-template-library.md#plugin-check-command-tcp), [udp](16-icinga-template-library.md#plugin-check-command-udp), [ssl](16-icinga-template-library.md#plugin-check-command-ssl)
-* [http](16-icinga-template-library.md#plugin-check-command-http), [ftp](16-icinga-template-library.md#plugin-check-command-ftp)
-* [smtp](16-icinga-template-library.md#plugin-check-command-smtp), [ssmtp](16-icinga-template-library.md#plugin-check-command-ssmtp),
-[imap](16-icinga-template-library.md#plugin-check-command-imap), [simap](16-icinga-template-library.md#plugin-check-command-simap),
-[pop](16-icinga-template-library.md#plugin-check-command-pop), [spop](16-icinga-template-library.md#plugin-check-command-spop)
-* [ntp_time](16-icinga-template-library.md#plugin-check-command-ntp-time)
-* [ssh](16-icinga-template-library.md#plugin-check-command-ssh)
-* [dns](16-icinga-template-library.md#plugin-check-command-dns), [dig](16-icinga-template-library.md#plugin-check-command-dig), [dhcp](16-icinga-template-library.md#plugin-check-command-dhcp)
+* [ping4](6-icinga-template-library.md#plugin-check-command-ping4), [ping6](6-icinga-template-library.md#plugin-check-command-ping6),
+[fping4](6-icinga-template-library.md#plugin-check-command-fping4), [fping6](6-icinga-template-library.md#plugin-check-command-fping6), [hostalive](6-icinga-template-library.md#plugin-check-command-hostalive)
+* [tcp](6-icinga-template-library.md#plugin-check-command-tcp), [udp](6-icinga-template-library.md#plugin-check-command-udp), [ssl](6-icinga-template-library.md#plugin-check-command-ssl)
+* [http](6-icinga-template-library.md#plugin-check-command-http), [ftp](6-icinga-template-library.md#plugin-check-command-ftp)
+* [smtp](6-icinga-template-library.md#plugin-check-command-smtp), [ssmtp](6-icinga-template-library.md#plugin-check-command-ssmtp),
+[imap](6-icinga-template-library.md#plugin-check-command-imap), [simap](6-icinga-template-library.md#plugin-check-command-simap),
+[pop](6-icinga-template-library.md#plugin-check-command-pop), [spop](6-icinga-template-library.md#plugin-check-command-spop)
+* [ntp_time](6-icinga-template-library.md#plugin-check-command-ntp-time)
+* [ssh](6-icinga-template-library.md#plugin-check-command-ssh)
+* [dns](6-icinga-template-library.md#plugin-check-command-dns), [dig](6-icinga-template-library.md#plugin-check-command-dig), [dhcp](6-icinga-template-library.md#plugin-check-command-dhcp)
There are numerous check plugins contributed by community members available
on the internet. If you found one for your requirements, [integrate them into Icinga 2](3-monitoring-basics.md#command-plugin-integration).
* a remote command execution client (similar to NRPE, NSClient++, etc)
Later on, you will be asked again and told how to proceed with these
-different [roles](5-monitoring-remote-systems.md#icinga2-remote-monitoring-client-roles).
+different [roles](7-monitoring-remote-systems.md#icinga2-remote-monitoring-client-roles).
> **Note**
>
> If you are planning to build an Icinga 2 distributed setup using the cluster feature, please skip
> the following instructions and jump directly to the
-> [cluster setup instructions](5-monitoring-remote-systems.md#distributed-monitoring-high-availability).
+> [cluster setup instructions](7-monitoring-remote-systems.md#distributed-monitoring-high-availability).
> **Note**
>
## <a id="icinga2-remote-monitoring-master"></a> Master Setup for Remote Monitoring
-If you are planning to use the [remote Icinga 2 clients](5-monitoring-remote-systems.md#icinga2-remote-monitoring-client)
+If you are planning to use the [remote Icinga 2 clients](7-monitoring-remote-systems.md#icinga2-remote-monitoring-client)
you'll first need to update your master setup.
Your master setup requires the following
* Enabled API feature, and a local Endpoint and Zone object configuration
* Firewall ACLs for the communication port (default 5665)
-You can use the [CLI command](6-cli-commands.md#cli-command-node) `node wizard` for setting up a new node
+You can use the [CLI command](8-cli-commands.md#cli-command-node) `node wizard` for setting up a new node
on the master. The command must be run as root, all Icinga 2 specific files
will be updated to the icinga user the daemon is running as (certificate files
for example).
## <a id="icinga2-remote-monitoring-client"></a> Client Setup for Remote Monitoring
Icinga 2 can be installed on Linux/Unix and Windows. While
-[Linux/Unix](5-monitoring-remote-systems.md#icinga2-remote-monitoring-client-linux) will be using the [CLI command](6-cli-commands.md#cli-command-node)
+[Linux/Unix](7-monitoring-remote-systems.md#icinga2-remote-monitoring-client-linux) will be using the [CLI command](8-cli-commands.md#cli-command-node)
`node wizard` for a guided setup, you will need to use the
graphical installer for Windows based client setup.
Your client setup requires the following
-* A ready configured and installed [master node](5-monitoring-remote-systems.md#icinga2-remote-monitoring-master)
+* A ready configured and installed [master node](7-monitoring-remote-systems.md#icinga2-remote-monitoring-master)
* SSL signed certificate for communication with the master (Use [CSR auto-signing](certifiates-csr-autosigning)).
* Enabled API feature, and a local Endpoint and Zone object configuration
* Firewall ACLs for the communication port (default 5665)
supports CSR auto-signing.
First you'll need to define a secure ticket salt in the [constants.conf](4-configuring-icinga-2.md#constants-conf).
-The [setup wizard for the master setup](5-monitoring-remote-systems.md#icinga2-remote-monitoring-master) will create
+The [setup wizard for the master setup](7-monitoring-remote-systems.md#icinga2-remote-monitoring-master) will create
one for you already.
# grep TicketSalt /etc/icinga2/constants.conf
#### <a id="certificates-manual-creation"></a> Manual SSL Certificate Generation
-This is described separately in the [cluster setup chapter](5-monitoring-remote-systems.md#manual-certificate-generation).
+This is described separately in the [cluster setup chapter](7-monitoring-remote-systems.md#manual-certificate-generation).
> **Note**
>
-> If you're using [CSR Auto-Signing](5-monitoring-remote-systems.md#csr-autosigning-requirements), skip this step.
+> If you're using [CSR Auto-Signing](7-monitoring-remote-systems.md#csr-autosigning-requirements), skip this step.
#### <a id="icinga2-remote-monitoring-client-linux-setup"></a> Linux Client Setup Wizard for Remote Monitoring
Install Icinga 2 from your distribution's package repository as described in the
general [installation instructions](2-getting-started.md#setting-up-icinga2).
-Please make sure that either [CSR Auto-Signing](5-monitoring-remote-systems.md#csr-autosigning-requirements) requirements
-are fulfilled, or that you're using [manual SSL certificate generation](5-monitoring-remote-systems.md#manual-certificate-generation).
+Please make sure that either [CSR Auto-Signing](7-monitoring-remote-systems.md#csr-autosigning-requirements) requirements
+are fulfilled, or that you're using [manual SSL certificate generation](7-monitoring-remote-systems.md#manual-certificate-generation).
> **Note**
>
* The client's local zone name. Defaults to FQDN.
* The master endpoint name. Look into your master setup `zones.conf` file for the proper name.
* The master endpoint connection information. Your master's IP address and port (defaults to 5665)
-* The [request ticket number](5-monitoring-remote-systems.md#csr-autosigning-requirements) generated on your master
+* The [request ticket number](7-monitoring-remote-systems.md#csr-autosigning-requirements) generated on your master
for CSR Auto-Signing
* Bind host/port for the Api feature (optional)
* The client's local zone name. Defaults to FQDN.
* The master endpoint name. Look into your master setup `zones.conf` file for the proper name.
* The master endpoint connection information. Your master's IP address and port (defaults to 5665)
-* The [request ticket number](5-monitoring-remote-systems.md#csr-autosigning-requirements) generated on your master
+* The [request ticket number](7-monitoring-remote-systems.md#csr-autosigning-requirements) generated on your master
for CSR Auto-Signing
* Bind host/port for the Api feature (optional)
your Icinga 2 master or satellite, and only send commands remotely.
Requirements:
-* Exact same [CheckCommand](15-object-types.md#objecttype-checkcommand) (and
-[EventCommand](15-object-types.md#objecttype-eventcommand)) configuration objects
+* Exact same [CheckCommand](5-object-types.md#objecttype-checkcommand) (and
+[EventCommand](5-object-types.md#objecttype-eventcommand)) configuration objects
on the master and the remote client(s).
* Installed plugin scripts on the remote client (`PluginDir` constant can be locally modified)
* `Zone` and `Endpoint` configuration for the client on the master
endpoint
`CheckCommand` objects are already shipped with the Icinga 2 ITL
-as [plugin check commands](16-icinga-template-library.md#plugin-check-commands). If you are
+as [plugin check commands](6-icinga-template-library.md#plugin-check-commands). If you are
using your own configuration definitions for example in
[commands.conf](4-configuring-icinga-2.md#commands-conf) make sure to copy/sync it
on your remote client.
}
More details here:
-* [configure endpoints](5-monitoring-remote-systems.md#configure-cluster-endpoints)
-* [configure zones](5-monitoring-remote-systems.md#configure-cluster-zones)
+* [configure endpoints](7-monitoring-remote-systems.md#configure-cluster-endpoints)
+* [configure zones](7-monitoring-remote-systems.md#configure-cluster-zones)
Configuration example for host and service objects running commands on the remote endpoint `remote-client1`:
> clients. There are no local configured objects available.
>
> If you require this, please install a full-featured
-> [local client](5-monitoring-remote-systems.md#icinga2-remote-monitoring-client-local-config).
+> [local client](7-monitoring-remote-systems.md#icinga2-remote-monitoring-client-local-config).
### <a id="icinga2-remote-monitoring-client-local-config"></a> Remote Client with Local Configuration
> **Note**
>
-> Better use [blacklists and/or whitelists](5-monitoring-remote-systems.md#icinga2-remote-monitoring-master-discovery-blacklist-whitelist)
+> Better use [blacklists and/or whitelists](7-monitoring-remote-systems.md#icinga2-remote-monitoring-master-discovery-blacklist-whitelist)
> to control which clients and hosts/services are integrated into your master configuration repository.
### <a id="icinga2-remote-monitoring-master-discovery-generate-config"></a> Generate Icinga 2 Configuration for Client Services on the Master
### <a id="icinga2-remote-monitoring-master-manual-add-endpoint-zone"></a> Manually add Client Endpoint and Zone Objects on the Master
-Define a [Zone](15-object-types.md#objecttype-zone) with a new [Endpoint](15-object-types.md#objecttype-endpoint) similar to the cluster setup.
+Define a [Zone](5-object-types.md#objecttype-zone) with a new [Endpoint](5-object-types.md#objecttype-endpoint) similar to the cluster setup.
-* [configure the node name](5-monitoring-remote-systems.md#configure-nodename)
-* [configure the ApiListener object](5-monitoring-remote-systems.md#configure-apilistener-object)
-* [configure cluster endpoints](5-monitoring-remote-systems.md#configure-cluster-endpoints)
-* [configure cluster zones](5-monitoring-remote-systems.md#configure-cluster-zones)
+* [configure the node name](7-monitoring-remote-systems.md#configure-nodename)
+* [configure the ApiListener object](7-monitoring-remote-systems.md#configure-apilistener-object)
+* [configure cluster endpoints](7-monitoring-remote-systems.md#configure-cluster-endpoints)
+* [configure cluster zones](7-monitoring-remote-systems.md#configure-cluster-zones)
on a per remote client basis. If you prefer to synchronize the configuration to remote
-clients, you can also use the cluster provided [configuration sync](5-monitoring-remote-systems.md#cluster-zone-config-sync)
+clients, you can also use the cluster provided [configuration sync](7-monitoring-remote-systems.md#cluster-zone-config-sync)
in `zones.d`.
The SNMP daemon runs on the remote system and answers SNMP queries by plugin
binaries. The [Monitoring Plugins package](2-getting-started.md#setting-up-check-plugins) ships
-the `check_snmp` plugin binary, but there are plenty of [existing plugins](7-addons-plugins.md#plugins)
+the `check_snmp` plugin binary, but there are plenty of [existing plugins](9-addons-plugins.md#plugins)
for specific use cases already around, for example monitoring Cisco routers.
-The following example uses the [SNMP ITL](16-icinga-template-library.md#plugin-check-command-snmp) `CheckCommand` and just
+The following example uses the [SNMP ITL](6-icinga-template-library.md#plugin-check-command-snmp) `CheckCommand` and just
overrides the `snmp_oid` custom attribute. A service is created for all hosts which
have the `snmp-community` custom attribute.
assign where host.vars.snmp_community != ""
}
-Additional SNMP plugins are available using the [Manubulon SNMP Plugins](16-icinga-template-library.md#snmp-manubulon-plugin-check-commands).
+Additional SNMP plugins are available using the [Manubulon SNMP Plugins](6-icinga-template-library.md#snmp-manubulon-plugin-check-commands).
### <a id="agent-based-checks-ssh"></a> SSH
> The NRPE protocol is considered insecure and has multiple flaws in its
> design. Upstream is not willing to fix these issues.
>
-> In order to stay safe, please use the native [Icinga 2 client](5-monitoring-remote-systems.md#icinga2-remote-monitoring-master)
+> In order to stay safe, please use the native [Icinga 2 client](7-monitoring-remote-systems.md#icinga2-remote-monitoring-master)
> instead.
The NRPE daemon uses its own configuration format in nrpe.cfg while `check_nrpe`
can be embedded into the Icinga 2 `CheckCommand` configuration syntax.
You can use the `check_nrpe` plugin from the NRPE project to query the NRPE daemon.
-Icinga 2 provides the [nrpe check command](16-icinga-template-library.md#plugin-check-command-nrpe) for this:
+Icinga 2 provides the [nrpe check command](6-icinga-template-library.md#plugin-check-command-nrpe) for this:
Example:
/usr/local/icinga/libexec/check_disk -w 20% -c 10% -p /
-You can pass arguments in a similar manner to [NSClient++](5-monitoring-remote-systems.md#agent-based-checks-nsclient)
+You can pass arguments in a similar manner to [NSClient++](7-monitoring-remote-systems.md#agent-based-checks-nsclient)
when using its NRPE supported check method.
### <a id="agent-based-checks-nsclient"></a> NSClient++
the required output and performance counters.
You can use the `check_nt` plugin from the Monitoring Plugins project to query NSClient++.
-Icinga 2 provides the [nscp check command](16-icinga-template-library.md#plugin-check-command-nscp) for this:
+Icinga 2 provides the [nscp check command](6-icinga-template-library.md#plugin-check-command-nscp) for this:
Example:
Building distributed environments with high availability included is fairly easy with Icinga 2.
The cluster feature is built-in and allows you to build many scenarios based on your requirements:
-* [High Availability](5-monitoring-remote-systems.md#cluster-scenarios-high-availability). All instances in the `Zone` elect one active master and run as Active/Active cluster.
-* [Distributed Zones](5-monitoring-remote-systems.md#cluster-scenarios-distributed-zones). A master zone and one or more satellites in their zones.
-* [Load Distribution](5-monitoring-remote-systems.md#cluster-scenarios-load-distribution). A configuration master and multiple checker satellites.
+* [High Availability](7-monitoring-remote-systems.md#cluster-scenarios-high-availability). All instances in the `Zone` elect one active master and run as Active/Active cluster.
+* [Distributed Zones](7-monitoring-remote-systems.md#cluster-scenarios-distributed-zones). A master zone and one or more satellites in their zones.
+* [Load Distribution](7-monitoring-remote-systems.md#cluster-scenarios-load-distribution). A configuration master and multiple checker satellites.
You can combine these scenarios into a global setup fitting your requirements.
* cluster zones can be built in a Top-Down-design where the child trusts the parent
* communication between zones happens bi-directional which means that a DMZ-located node can still reach the master node, or vice versa
* Update firewall rules and ACLs
-* Decide whether to use the built-in [configuration syncronization](5-monitoring-remote-systems.md#cluster-zone-config-sync) or use an external tool (Puppet, Ansible, Chef, Salt, etc) to manage the configuration deployment
+* Decide whether to use the built-in [configuration syncronization](7-monitoring-remote-systems.md#cluster-zone-config-sync) or use an external tool (Puppet, Ansible, Chef, Salt, etc) to manage the configuration deployment
> **Tip**
>
> If you're looking for troubleshooting cluster problems, check the general
-> [troubleshooting](10-troubleshooting.md#troubleshooting-cluster) section.
+> [troubleshooting](12-troubleshooting.md#troubleshooting-cluster) section.
### <a id="manual-certificate-generation"></a> Manual SSL Certificate Generation
-Icinga 2 ships [CLI commands](6-cli-commands.md#cli-command-pki) assisting with CA and node certificate creation
+Icinga 2 ships [CLI commands](8-cli-commands.md#cli-command-pki) assisting with CA and node certificate creation
for your Icinga 2 distributed setup.
> **Note**
#### <a id="cluster-naming-convention"></a> Cluster Naming Convention
-The SSL certificate common name (CN) will be used by the [ApiListener](15-object-types.md#objecttype-apilistener)
-object to determine the local authority. This name must match the local [Endpoint](15-object-types.md#objecttype-endpoint)
+The SSL certificate common name (CN) will be used by the [ApiListener](5-object-types.md#objecttype-apilistener)
+object to determine the local authority. This name must match the local [Endpoint](5-object-types.md#objecttype-endpoint)
object name.
Example:
host = "icinga2a.icinga.org"
}
-The [Endpoint](15-object-types.md#objecttype-endpoint) name is further referenced as `endpoints` attribute on the
-[Zone](15-object-types.md#objecttype-zone) object.
+The [Endpoint](5-object-types.md#objecttype-endpoint) name is further referenced as `endpoints` attribute on the
+[Zone](5-object-types.md#objecttype-zone) object.
object Endpoint "icinga2b" {
host = "icinga2b.icinga.org"
endpoints = [ "icinga2a", "icinga2b" ]
}
-Specifying the local node name using the [NodeName](5-monitoring-remote-systems.md#configure-nodename) variable requires
+Specifying the local node name using the [NodeName](7-monitoring-remote-systems.md#configure-nodename) variable requires
the same name as used for the endpoint name and common name above. If not set, the FQDN is used.
const NodeName = "icinga2a"
The following section describe which configuration must be updated/created
in order to get your cluster running with basic functionality.
-* [configure the node name](5-monitoring-remote-systems.md#configure-nodename)
-* [configure the ApiListener object](5-monitoring-remote-systems.md#configure-apilistener-object)
-* [configure cluster endpoints](5-monitoring-remote-systems.md#configure-cluster-endpoints)
-* [configure cluster zones](5-monitoring-remote-systems.md#configure-cluster-zones)
+* [configure the node name](7-monitoring-remote-systems.md#configure-nodename)
+* [configure the ApiListener object](7-monitoring-remote-systems.md#configure-apilistener-object)
+* [configure cluster endpoints](7-monitoring-remote-systems.md#configure-cluster-endpoints)
+* [configure cluster zones](7-monitoring-remote-systems.md#configure-cluster-zones)
Once you're finished with the basic setup the following section will
-describe how to use [zone configuration synchronisation](5-monitoring-remote-systems.md#cluster-zone-config-sync)
-and configure [cluster scenarios](5-monitoring-remote-systems.md#cluster-scenarios).
+describe how to use [zone configuration synchronisation](7-monitoring-remote-systems.md#cluster-zone-config-sync)
+and configure [cluster scenarios](7-monitoring-remote-systems.md#cluster-scenarios).
#### <a id="configure-nodename"></a> Configure the Icinga Node Name
Instead of using the default FQDN as node name you can optionally set
-that value using the [NodeName](13-language-reference.md#constants) constant.
+that value using the [NodeName](15-language-reference.md#constants) constant.
> ** Note **
>
> in `/etc/icinga2/constants.conf`.
This setting must be unique for each node, and must also match
-the name of the local [Endpoint](15-object-types.md#objecttype-endpoint) object and the
+the name of the local [Endpoint](5-object-types.md#objecttype-endpoint) object and the
SSL certificate common name as described in the
-[cluster naming convention](5-monitoring-remote-systems.md#cluster-naming-convention).
+[cluster naming convention](7-monitoring-remote-systems.md#cluster-naming-convention).
vim /etc/icinga2/constants.conf
const NodeName = "icinga2a"
-Read further about additional [naming conventions](5-monitoring-remote-systems.md#cluster-naming-convention).
+Read further about additional [naming conventions](7-monitoring-remote-systems.md#cluster-naming-convention).
Not specifying the node name will make Icinga 2 using the FQDN. Make sure that all
configured endpoint names and common names are in sync.
#### <a id="configure-apilistener-object"></a> Configure the ApiListener Object
-The [ApiListener](15-object-types.md#objecttype-apilistener) object needs to be configured on
+The [ApiListener](5-object-types.md#objecttype-apilistener) object needs to be configured on
every node in the cluster with the following settings:
A sample config looks like:
`Zone` objects specify the endpoints located in a zone. That way your distributed setup can be
seen as zones connected together instead of multiple instances in that specific zone.
-Zones can be used for [high availability](5-monitoring-remote-systems.md#cluster-scenarios-high-availability),
-[distributed setups](5-monitoring-remote-systems.md#cluster-scenarios-distributed-zones) and
-[load distribution](5-monitoring-remote-systems.md#cluster-scenarios-load-distribution).
+Zones can be used for [high availability](7-monitoring-remote-systems.md#cluster-scenarios-high-availability),
+[distributed setups](7-monitoring-remote-systems.md#cluster-scenarios-distributed-zones) and
+[load distribution](7-monitoring-remote-systems.md#cluster-scenarios-load-distribution).
Each Icinga 2 `Endpoint` must be put into its respective `Zone`. In this example, you will
define the zone `config-ha-master` where the `icinga2a` and `icinga2b` endpoints
Your child zones and endpoint members **must not** have their config copied to `zones.d`.
The built-in configuration synchronisation takes care of that if your nodes accept
configuration from the parent zone. You can define that in the
-[ApiListener](5-monitoring-remote-systems.md#configure-apilistener-object) object by configuring the `accept_config`
+[ApiListener](7-monitoring-remote-systems.md#configure-apilistener-object) object by configuring the `accept_config`
attribute accordingly.
You should remove the sample config included in `conf.d` by commenting the `recursive_include`
Better use a dedicated directory name like `cluster` or similar, and include that
one if your nodes require local configuration not being synced to other nodes. That's
-useful for local [health checks](5-monitoring-remote-systems.md#cluster-health-check) for example.
+useful for local [health checks](7-monitoring-remote-systems.md#cluster-health-check) for example.
> **Note**
>
-> In a [high availability](5-monitoring-remote-systems.md#cluster-scenarios-high-availability)
+> In a [high availability](7-monitoring-remote-systems.md#cluster-scenarios-high-availability)
> setup only one assigned node can act as configuration master. All other zone
> member nodes **must not** have the `/etc/icinga2/zones.d` directory populated.
Each configured zone must exist with the same directory name. The parent zone
syncs the configuration to the child zones, if allowed using the `accept_config`
-attribute of the [ApiListener](5-monitoring-remote-systems.md#configure-apilistener-object) object.
+attribute of the [ApiListener](7-monitoring-remote-systems.md#configure-apilistener-object) object.
Config on node `icinga2a`:
>
> `zones.d` must not be included in [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf). Icinga 2 automatically
> determines the required include directory. This can be overridden using the
-> [global constant](13-language-reference.md#constants) `ZonesDir`.
+> [global constant](15-language-reference.md#constants) `ZonesDir`.
#### <a id="zone-global-config-templates"></a> Global Configuration Zone for Templates
#### <a id="zone-config-sync-permissions"></a> Zone Configuration Synchronisation Permissions
-Each [ApiListener](15-object-types.md#objecttype-apilistener) object must have the `accept_config` attribute
+Each [ApiListener](5-object-types.md#objecttype-apilistener) object must have the `accept_config` attribute
set to `true` to receive configuration from the parent `Zone` members. Default value is `false`.
object ApiListener "api" {
> ** Tip **
>
-> Look into the [troubleshooting guides](10-troubleshooting.md#troubleshooting-cluster-config-sync) for debugging
+> Look into the [troubleshooting guides](12-troubleshooting.md#troubleshooting-cluster-config-sync) for debugging
> problems with the configuration synchronisation.
### <a id="cluster-health-check"></a> Cluster Health Check
-The Icinga 2 [ITL](16-icinga-template-library.md#icinga-template-library) ships an internal check command checking all configured
+The Icinga 2 [ITL](6-icinga-template-library.md#icinga-template-library) ships an internal check command checking all configured
`EndPoints` in the cluster setup. The check result will become critical if
one or more configured nodes are not connected.
* Child zones only receive event updates (check results, commands, etc) for their configured updates.
* Zones cannot influence/interfere other zones. Each checked object is assigned to only one zone.
* All nodes in a zone trust each other.
-* [Configuration sync](5-monitoring-remote-systems.md#zone-config-sync-permissions) is disabled by default.
+* [Configuration sync](7-monitoring-remote-systems.md#zone-config-sync-permissions) is disabled by default.
#### <a id="cluster-scenarios-features"></a> Features in Cluster Zones
actual slave checker node.
DB IDO on the left, graphite on the right side - works (if you disable
-[DB IDO HA](5-monitoring-remote-systems.md#high-availability-db-ido)).
+[DB IDO HA](7-monitoring-remote-systems.md#high-availability-db-ido)).
Icinga Web 2 on the left, checker and notifications on the right side - works too.
Everything on the left and on the right side - make sure to deal with
-[load-balanced notifications and checks](5-monitoring-remote-systems.md#high-availability-features) in a
-[HA zone](5-monitoring-remote-systems.md#cluster-scenarios-high-availability).
+[load-balanced notifications and checks](7-monitoring-remote-systems.md#high-availability-features) in a
+[HA zone](7-monitoring-remote-systems.md#cluster-scenarios-high-availability).
configure-cluster-zones
#### <a id="cluster-scenarios-distributed-zones"></a> Distributed Zones
Imagine the following example with a master node in Nuremberg, and two remote DMZ
based instances in Berlin and Vienna. Additonally you'll specify
-[global templates](5-monitoring-remote-systems.md#zone-global-config-templates) available in all zones.
+[global templates](7-monitoring-remote-systems.md#zone-global-config-templates) available in all zones.
The configuration tree on the master instance `nuremberg` could look like this:
> The child zones `berlin` and `vienna` will get their configuration synchronised
> from the configuration master 'nuremberg'. The endpoints in the child
> zones **must not** have their `zones.d` directory populated if this endpoint
-> [accepts synced configuration](5-monitoring-remote-systems.md#zone-config-sync-permissions).
+> [accepts synced configuration](7-monitoring-remote-systems.md#zone-config-sync-permissions).
#### <a id="cluster-scenarios-load-distribution"></a> Load Distribution
> The child zones `checker` will get its configuration synchronised
> from the configuration master 'master'. The endpoints in the child
> zone **must not** have their `zones.d` directory populated if this endpoint
-> [accepts synced configuration](5-monitoring-remote-systems.md#zone-config-sync-permissions).
+> [accepts synced configuration](7-monitoring-remote-systems.md#zone-config-sync-permissions).
#### <a id="cluster-scenarios-high-availability"></a> Cluster High Availability
High availability with Icinga 2 is possible by putting multiple nodes into
-a dedicated [zone](5-monitoring-remote-systems.md#configure-cluster-zones). All nodes will elect one
+a dedicated [zone](7-monitoring-remote-systems.md#configure-cluster-zones). All nodes will elect one
active master, and retry an election once the current active master is down.
-Selected features provide advanced [HA functionality](5-monitoring-remote-systems.md#high-availability-features).
+Selected features provide advanced [HA functionality](7-monitoring-remote-systems.md#high-availability-features).
Checks and notifications are load-balanced between nodes in the high availability
zone.
endpoints = [ "icinga2a", "icinga2b", "icinga2c" ]
}
-Two or more nodes in a high availability setup require an [initial cluster sync](5-monitoring-remote-systems.md#initial-cluster-sync).
+Two or more nodes in a high availability setup require an [initial cluster sync](7-monitoring-remote-systems.md#initial-cluster-sync).
> **Note**
>
> Keep in mind that **only one node acts as configuration master** having the
> configuration files in the `zones.d` directory. All other nodes **must not**
> have that directory populated. Instead they are required to
-> [accept synced configuration](5-monitoring-remote-systems.md#zone-config-sync-permissions).
-> Details in the [Configuration Sync Chapter](5-monitoring-remote-systems.md#cluster-zone-config-sync).
+> [accept synced configuration](7-monitoring-remote-systems.md#zone-config-sync-permissions).
+> Details in the [Configuration Sync Chapter](7-monitoring-remote-systems.md#cluster-zone-config-sync).
#### <a id="cluster-scenarios-multiple-hierachies"></a> Multiple Hierachies
By default the following features provide advanced HA functionality:
-* [Checks](5-monitoring-remote-systems.md#high-availability-checks) (load balanced, automated failover)
-* [Notifications](5-monitoring-remote-systems.md#high-availability-notifications) (load balanced, automated failover)
-* [DB IDO](5-monitoring-remote-systems.md#high-availability-db-ido) (Run-Once, automated failover)
+* [Checks](7-monitoring-remote-systems.md#high-availability-checks) (load balanced, automated failover)
+* [Notifications](7-monitoring-remote-systems.md#high-availability-notifications) (load balanced, automated failover)
+* [DB IDO](7-monitoring-remote-systems.md#high-availability-db-ido) (Run-Once, automated failover)
#### <a id="high-availability-checks"></a> High Availability with Checks
is enabled.
If your nodes should notify independent from any other nodes (this will cause
duplicated notifications if not properly handled!), you can set `enable_ha = false`
-in the [NotificationComponent](15-object-types.md#objecttype-notificationcomponent) feature.
+in the [NotificationComponent](5-object-types.md#objecttype-notificationcomponent) feature.
#### <a id="high-availability-db-ido"></a> High Availability with DB IDO
> **Note**
>
> The DB IDO HA feature can be disabled by setting the `enable_ha` attribute to `false`
-> for the [IdoMysqlConnection](15-object-types.md#objecttype-idomysqlconnection) or
-> [IdoPgsqlConnection](15-object-types.md#objecttype-idopgsqlconnection) object on all nodes in the
+> for the [IdoMysqlConnection](5-object-types.md#objecttype-idomysqlconnection) or
+> [IdoPgsqlConnection](5-object-types.md#objecttype-idopgsqlconnection) object on all nodes in the
> same zone.
>
> All endpoints will enable the DB IDO feature then, connect to the configured
* generate a new [SSL client certificate](#certificate-authority-certificates)
* identify its location in the zones
-* update the `zones.conf` file on each involved node ([endpoint](5-monitoring-remote-systems.md#configure-cluster-endpoints), [zones](5-monitoring-remote-systems.md#configure-cluster-zones))
+* update the `zones.conf` file on each involved node ([endpoint](7-monitoring-remote-systems.md#configure-cluster-endpoints), [zones](7-monitoring-remote-systems.md#configure-cluster-zones))
* a new slave zone node requires updates for the master and slave zones
- * verify if this endpoints requires [configuration synchronisation](5-monitoring-remote-systems.md#cluster-zone-config-sync) enabled
-* if the node requires the existing zone history: [initial cluster sync](5-monitoring-remote-systems.md#initial-cluster-sync)
-* add a [cluster health check](5-monitoring-remote-systems.md#cluster-health-check)
+ * verify if this endpoints requires [configuration synchronisation](7-monitoring-remote-systems.md#cluster-zone-config-sync) enabled
+* if the node requires the existing zone history: [initial cluster sync](7-monitoring-remote-systems.md#initial-cluster-sync)
+* add a [cluster health check](7-monitoring-remote-systems.md#cluster-health-check)
#### <a id="initial-cluster-sync"></a> Initial Cluster Sync
#### Libraries
-Instead of loading libraries using the [`library` config directive](13-language-reference.md#library)
+Instead of loading libraries using the [`library` config directive](15-language-reference.md#library)
you can also use the `--library` command-line option.
#### Constants
-[Global constants](13-language-reference.md#constants) can be set using the `--define` command-line option.
+[Global constants](15-language-reference.md#constants) can be set using the `--define` command-line option.
#### <a id="config-include-path"></a> Config Include Path
### <a id="cli-command-daemon"></a> CLI command: Daemon
The CLI command `daemon` provides the functionality to start/stop Icinga 2.
-Furthermore it provides the [configuration validation](6-cli-commands.md#config-validation).
+Furthermore it provides the [configuration validation](8-cli-commands.md#config-validation).
# icinga2 daemon --help
icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
The `--validate` option can be used to check if your configuration files
contain errors. If any errors are found the exit status is 1, otherwise 0
-is returned. More details in the [configuration validation](6-cli-commands.md#config-validation) chapter.
+is returned. More details in the [configuration validation](8-cli-commands.md#config-validation) chapter.
### <a id="cli-command-feature"></a> CLI command: Feature
### <a id="cli-command-node"></a> CLI command: Node
Provides the functionality to install and manage master and client
-nodes in a [remote monitoring ](5-monitoring-remote-systems.md#icinga2-remote-client-monitoring) or
-[distributed cluster](5-monitoring-remote-systems.md#distributed-monitoring-high-availability) scenario.
+nodes in a [remote monitoring ](7-monitoring-remote-systems.md#icinga2-remote-client-monitoring) or
+[distributed cluster](7-monitoring-remote-systems.md#distributed-monitoring-high-availability) scenario.
# icinga2 node --help
The `object` CLI command can be used to list all configuration objects and their
attributes. The command also shows where each of the attributes was modified.
-That way you can also identify which objects have been created from your [apply rules](13-language-reference.md#apply).
+That way you can also identify which objects have been created from your [apply rules](15-language-reference.md#apply).
-More information can be found in the [troubleshooting](10-troubleshooting.md#list-configuration-objects) section.
+More information can be found in the [troubleshooting](12-troubleshooting.md#list-configuration-objects) section.
# icinga2 object --help
icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
* request a signed certificate from the master
* generate a new ticket for the client setup
-This functionality is used by the [node setup/wizard](6-cli-commands.md#cli-command-pki) CLI commands too.
+This functionality is used by the [node setup/wizard](8-cli-commands.md#cli-command-pki) CLI commands too.
# icinga2 pki --help
icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
### <a id="cli-command-variable"></a> CLI command: Variable
-Lists all configured variables (constants) in a similar fasion like [object list](6-cli-commands.md#cli-command-object).
+Lists all configured variables (constants) in a similar fasion like [object list](8-cli-commands.md#cli-command-object).
# icinga2 variable --help
icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
Icinga 2 provides configuration files for some commonly used features. These
are installed in the `/etc/icinga2/features-available` directory and can be
enabled and disabled using the `icinga2 feature enable` and `icinga2 feature disable`
-[CLI commands](6-cli-commands.md#cli-command-feature), respectively.
+[CLI commands](8-cli-commands.md#cli-command-feature), respectively.
The `icinga2 feature enable` CLI command creates symlinks in the
`/etc/icinga2/features-enabled` directory which is included by default
> `# icinga2 daemon -C`
If you encouter errors during configuration validation, please make sure
-to read the [troubleshooting](10-troubleshooting.md#troubleshooting) chapter.
+to read the [troubleshooting](12-troubleshooting.md#troubleshooting) chapter.
-You can also use the [CLI command](6-cli-commands.md#cli-command-object) `icinga2 object list`
+You can also use the [CLI command](8-cli-commands.md#cli-command-object) `icinga2 object list`
after validation passes to analyze object attributes, inheritance or created
objects by apply rules.
-Find more on troubleshooting with `object list` in [this chapter](10-troubleshooting.md#list-configuration-objects).
+Find more on troubleshooting with `object list` in [this chapter](12-troubleshooting.md#list-configuration-objects).
Example filtered by `Service` objects with the name `ping*`:
## <a id="config-change-reload"></a> Reload on Configuration Changes
Everytime you have changed your configuration you should first tell Icinga 2
-to [validate](6-cli-commands.md#config-validation). If there are no validation errors you can
+to [validate](8-cli-commands.md#config-validation). If there are no validation errors you can
safely reload the Icinga 2 daemon.
# /etc/init.d/icinga2 reload
> which will validate the configuration in a separate process and not stop
> the other events like check execution, notifications, etc.
>
-> Details can be found [here](12-migrating-from-icinga-1x.md#differences-1x-2-real-reload).
+> Details can be found [here](14-migrating-from-icinga-1x.md#differences-1x-2-real-reload).
As well as the Icinga supported web interfaces (Classic UI 1.x, Web 1.x, Web 2) there are a
number of community provided web interfaces too:
-* [Thruk](http://www.thruk.org) based on the [Livestatus](9-livestatus.md#setting-up-livestatus) feature
+* [Thruk](http://www.thruk.org) based on the [Livestatus](11-livestatus.md#setting-up-livestatus) feature
## <a id="plugins"></a> Plugins
Sometimes plugins contain hard-coded paths to other components. Instead of changing
the plugin it might be easier to create logical links which is (more) update-safe.
-Each plugin requires a [CheckCommand](15-object-types.md#objecttype-checkcommand) object in your
-configuration which can be used in the [Service](15-object-types.md#objecttype-service) or
-[Host](15-object-types.md#objecttype-host) object definition.
+Each plugin requires a [CheckCommand](5-object-types.md#objecttype-checkcommand) object in your
+configuration which can be used in the [Service](5-object-types.md#objecttype-service) or
+[Host](5-object-types.md#objecttype-host) object definition.
There are the following conventions to follow when adding a new command object definition:
* Define a unique `prefix` for the command's specific command arguments. That way you can safely
set them on host/service level and you'll always know which command they control.
* Use command argument default values, e.g. for thresholds
-* Use [advanced conditions](15-object-types.md#objecttype-checkcommand) like `set_if` definitions.
+* Use [advanced conditions](5-object-types.md#objecttype-checkcommand) like `set_if` definitions.
Example for a custom `my-snmp-int` check command:
}
You can find an existing `CheckCommand` definition for the `check_snmp_int.pl` plugin
-shipped with the optional [Manubulon Plugin Check Command](16-icinga-template-library.md#snmp-manubulon-plugin-check-commands)
+shipped with the optional [Manubulon Plugin Check Command](6-icinga-template-library.md#snmp-manubulon-plugin-check-commands)
definitions already.
> **Tip**
>
> Get to know the new configuration format and the advanced [apply](3-monitoring-basics.md#using-apply) rules and
-> use [syntax highlighting](7-addons-plugins.md#configuration-syntax-highlighting) in vim/nano.
+> use [syntax highlighting](9-addons-plugins.md#configuration-syntax-highlighting) in vim/nano.
If you're looking for puppet manifests, chef cookbooks, ansible recipes, etc - we're happy
to integrate them upstream, so please get in touch at [https://support.icinga.org](https://support.icinga.org).
- [2-getting-started.md, Getting Started]
- [3-monitoring-basics.md, Monitoring Basics]
- [4-configuring-icinga-2.md, Configuring Icinga 2]
-- [5-monitoring-remote-systems.md, Monitoring Remote Systems]
-- [6-cli-commands.md, CLI Commands]
-- [7-addons-plugins.md, Addons and Plugins]
-- [8-livestatus.md, Livestatus]
-- [9-troubleshooting.md, Troubleshooting]
-- [10-migrating-from-icinga-1x.md, Migrating from Icinga 1.x]
-- [11-language-reference.md, Language Reference]
-- [12-library-reference.md, Library Reference]
-- [13-object-types.md, Object Types]
-- [14-icinga-template-library.md, Icinga Template Library]
-- [15-appendix.md, Appendix]
+- [5-object-types.md, Object Types]
+- [6-icinga-template-library.md, Icinga Template Library]
+- [7-monitoring-remote-systems.md, Monitoring Remote Systems]
+- [8-cli-commands.md, CLI Commands]
+- [9-addons-plugins.md, Addons and Plugins]
+- [10-alternative-frontends.md, Alternative Frontends]
+- [11-livestatus.md, Livestatus]
+- [12-troubleshooting.md, Troubleshooting]
+- [13-upgrading-icinga-2.md, Upgrading Icinga 2]
+- [14-migrating-from-icinga-1x.md, Migrating from Icinga 1.x]
+- [15-language-reference.md, Language Reference]
+- [16-library-reference.md, Library Reference]
+- [17-appendix.md, Appendix]
theme: readthedocs
markdown_extensions: [smarty]
extra_javascript: [scroll.js]