1 # <a id="getting-started"></a> Getting Started
3 This tutorial is a step-by-step introduction to installing Icinga 2 and
4 available Icinga web interfaces. It assumes that you are familiar with
5 the system you're installing Icinga 2 on.
7 Details on troubleshooting problems can be found [here](#troubleshooting).
9 ## <a id="setting-up-icinga2"></a> Setting up Icinga 2
11 First off you will have to install Icinga 2. The preferred way of doing this
12 is to use the official package repositories depending on which operating system
13 and distribution you are running.
15 Distribution | Repository
16 ------------------------|---------------------------
17 Debian | [Upstream](https://packages.debian.org/sid/icinga2), [DebMon](http://debmon.org/packages/debmon-wheezy/icinga2), [Icinga Repository](http://packages.icinga.org/debian/)
18 Ubuntu | [Upstream](https://launchpad.net/ubuntu/+source/icinga2), [Icinga PPA](https://launchpad.net/~formorer/+archive/ubuntu/icinga), [Icinga Repository](http://packages.icinga.org/ubuntu/)
19 RHEL/CentOS | [Icinga Repository](http://packages.icinga.org/epel/)
20 OpenSUSE | [Icinga Repository](http://packages.icinga.org/openSUSE/), [Server Monitoring Repository](https://build.opensuse.org/package/show/server:monitoring/icinga2)
21 SLES | [Icinga Repository](http://packages.icinga.org/SUSE/)
22 Gentoo | [Upstream](http://packages.gentoo.org/package/net-analyzer/icinga2)
23 FreeBSD | [Upstream](http://www.freshports.org/net-mgmt/icinga2)
24 ArchLinux | [Upstream](https://aur.archlinux.org/packages/icinga2)
26 Packages for distributions other than the ones listed above may also be
27 available. Please contact your distribution packagers.
29 ### <a id="installing-requirements"></a> Installing Requirements for Icinga 2
31 You need to add the Icinga repository to your package management configuration.
32 Below is a list with examples for the various distributions.
36 # wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add -
37 # cat >/etc/apt/sources.list.d/debmon.list<<EOF
38 deb http://debmon.org/debmon debmon-wheezy main
44 # add-apt-repository ppa:formorer/icinga
49 # rpm --import http://packages.icinga.org/icinga.key
50 # wget http://packages.icinga.org/epel/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo
55 # wget http://packages.icinga.org/fedora/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo
60 # zypper ar http://packages.icinga.org/SUSE/ICINGA-release.repo
65 # zypper ar http://packages.icinga.org/openSUSE/ICINGA-release.repo
68 The packages for RHEL/CentOS depend on other packages which are distributed
69 as part of the [EPEL repository](http://fedoraproject.org/wiki/EPEL). Please
70 make sure to enable this repository by following
71 [these instructions](#http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
73 ### <a id="installing-icinga2"></a> Installing Icinga 2
75 You can install Icinga 2 by using your distribution's package manager
76 to install the `icinga2` package.
80 # apt-get install icinga2
88 # zypper install icinga2
90 On RHEL/CentOS and SLES you will need to use `chkconfig` to enable the
91 `icinga2` service. You can manually start Icinga 2 using `service icinga2 start`.
93 # chkconfig icinga2 on
94 # service icinga2 start
96 RHEL/CentOS 7 use [Systemd](#systemd-service) with `systemctl {enable,start} icinga2`.
98 # systemctl enable icinga2
99 # systemctl start icinga2
101 Some parts of Icinga 2's functionality are available as separate packages:
104 ------------------------|--------------------------------
105 icinga2-ido-mysql | [DB IDO](#configuring-db-ido) provider module for MySQL
106 icinga2-ido-pgsql | [DB IDO](#configuring-db-ido) provider module for PostgreSQL
108 If you're running a distribution for which Icinga 2 packages are
109 not yet available you will need to use the release tarball which you
110 can download from the [Icinga website](https://www.icinga.org/). The
111 release tarballs contain an `INSTALL` file with further instructions.
113 ### <a id="installation-enabled-features"></a> Enabled Features during Installation
115 The default installation will enable three features required for a basic
116 Icinga 2 installation:
118 * `checker` for executing checks
119 * `notification` for sending notifications
120 * `mainlog` for writing the `icinga2.log` file
122 You can verify that by calling `icinga2 feature list` [cli command](#cli-command-feature)
123 to see which features are enabled and disabled.
125 # icinga2 feature list
126 Disabled features: api command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus notification perfdata statusdata syslog
127 Enabled features: checker mainlog notification
130 ### <a id="installation-paths"></a> Installation Paths
132 By default Icinga 2 uses the following files and directories:
135 ------------------------------------|------------------------------------
136 /etc/icinga2 | Contains Icinga 2 configuration files.
137 /etc/init.d/icinga2 | The Icinga 2 init script.
138 /usr/sbin/icinga2* | The Icinga 2 binary.
139 /usr/share/doc/icinga2 | Documentation files that come with Icinga 2.
140 /usr/share/icinga2/include | The Icinga Template Library and plugin command configuration.
141 /var/run/icinga2 | PID file.
142 /var/run/icinga2/cmd | Command pipe and Livestatus socket.
143 /var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files
144 /var/spool/icinga2 | Used for performance data spool files.
145 /var/lib/icinga2 | Icinga 2 state file, cluster log, local CA and configuration files.
146 /var/log/icinga2 | Log file location and compat/ directory for the CompatLogger feature.
148 ## <a id="setting-up-check-plugins"></a> Setting up Check Plugins
150 Without plugins Icinga 2 does not know how to check external services. The
151 [Monitoring Plugins Project](https://www.monitoring-plugins.org/) provides
152 an extensive set of plugins which can be used with Icinga 2 to check whether
153 services are working properly.
155 The recommended way of installing these standard plugins is to use your
156 distribution's package manager.
160 > The `Nagios Plugins` project was renamed to `Monitoring Plugins`
161 > in January 2014. At the time of this writing some packages are still
162 > using the old name while some distributions have adopted the new package
163 > name `monitoring-plugins` already.
167 > EPEL for RHEL/CentOS 7 is still in beta mode at the time of writing and does
168 > not provide a `monitoring-plugins` package. You are required to manually install
171 For your convenience here is a list of package names for some of the more
172 popular operating systems/distributions:
174 OS/Distribution | Package Name | Installation Path
175 -----------------------|--------------------|---------------------------
176 RHEL/CentOS (EPEL) | nagios-plugins-all | /usr/lib/nagios/plugins or /usr/lib64/nagios/plugins
177 Debian | nagios-plugins | /usr/lib/nagios/plugins
178 FreeBSD | nagios-plugins | /usr/local/libexec/nagios
179 OS X (MacPorts) | nagios-plugins | /opt/local/libexec
181 Depending on which directory your plugins are installed into you may need to
182 update the global `PluginDir` constant in your Icinga 2 configuration. This macro is used
183 by the service templates contained in the Icinga Template Library to determine
184 where to find the plugin binaries.
186 ### <a id="integrate-additional-plugins"></a> Integrate Additional Plugins
188 For some services you may need additional 'check plugins' which are not provided
189 by the official Monitoring Plugins project.
191 All existing Nagios or Icinga 1.x plugins work with Icinga 2. Here's a
192 list of popular community sites which host check plugins:
194 * [Icinga Exchange](https://exchange.icinga.org)
195 * [Icinga Wiki](https://wiki.icinga.org)
197 The recommended way of setting up these plugins is to copy them to a common directory
198 and create an extra global constant, e.g. `CustomPluginDir` in your [constants.conf](#constants-conf)
201 # cp check_snmp_int.pl /opt/plugins
202 # chmod +x /opt/plugins/check_snmp_int.pl
204 # cat /etc/icinga2/constants.conf
206 * This file defines global constants which can be used in
207 * the other configuration files. At a minimum the
208 * PluginDir constant should be defined.
211 const PluginDir = "/usr/lib/nagios/plugins"
212 const CustomPluginDir = "/opt/monitoring"
214 Prior to using the check plugin with Icinga 2 you should ensure that it is working properly
215 by trying to run it on the console using whichever user Icinga 2 is running as:
217 # su - icinga -s /bin/bash
218 $ /opt/plugins/check_snmp_int.pl --help
220 Additional libraries may be required for some plugins. Please consult the plugin
221 documentation and/or plugin provided README for installation instructions.
222 Sometimes plugins contain hard-coded paths to other components. Instead of changing
223 the plugin it might be easier to create logical links which is (more) update-safe.
225 Each plugin requires a [CheckCommand](#objecttype-checkcommand) object in your
226 configuration which can be used in the [Service](#objecttype-service) or
227 [Host](#objecttype-host) object definition.
229 There are the following conventions to follow when adding a new command object definition:
231 * Always import the `plugin-check-command` template
232 * Use [command-arguments](#) whenever possible. The `command` attribute must be an array
233 in `[ ... ]` then for shell escaping.
234 * Define a unique `prefix` for the command's specific command arguments. That way you can safely
235 set them on host/service level and you'll always know which command they control.
236 * Use command argument default values, e.g. for thresholds
237 * Use [advanced conditions](#objecttype-checkcommand) like `set_if` definitions.
239 Example for a custom `my-snmp-int` check command:
241 object CheckCommand "my-snmp-int" {
242 import "plugin-check-command"
244 command = [ PluginDir + "/check_snmp_int.pl" ]
247 "-H" = "$snmp_address$"
248 "-C" = "$snmp_community$"
253 "-n" = "$snmp_interface$"
255 set_if = "$snmp_perf$"
262 vars.snmp_perf = true
263 vars.snmp_warn = "300,400"
264 vars.snmp_crit = "0,600"
267 You can find an existing `CheckCommand` definition for the `check_snmp_int.pl` plugin
268 shipped with the optional [Manubulon Plugin Check Command](#snmp-manubulon-plugin-check-commands)
272 For further information on your monitoring configuration read the
273 [monitoring basics](#monitoring-basics).
276 ## <a id="configuring-icinga2-first-steps"></a> Configuring Icinga 2: First Steps
278 ### <a id="icinga2-conf"></a> icinga2.conf
280 An example configuration file is installed for you in `/etc/icinga2/icinga2.conf`.
282 Here's a brief description of the example configuration:
285 * Icinga 2 configuration file
286 * - this is where you define settings for the Icinga application including
287 * which hosts/services to check.
289 * For an overview of all available configuration options please refer
290 * to the documentation that is distributed as part of Icinga 2.
293 Icinga 2 supports [C/C++-style comments](#comments).
296 * The constants.conf defines global constants.
298 include "constants.conf"
300 The `include` directive can be used to include other files.
303 * The zones.conf defines zones for a cluster setup.
304 * Not required for single instance setups.
309 * The Icinga Template Library (ITL) provides a number of useful templates
310 * and command definitions.
311 * Common monitoring plugin command definitions are included separately.
317 * The features-available directory contains a number of configuration
318 * files for features which can be enabled and disabled using the
319 * icinga2 feature enable / icinga2 feature disable CLI commands.
320 * These commands work by creating and removing symbolic links in
321 * the features-enabled directory.
323 include "features-enabled/*.conf"
325 This `include` directive takes care of including the configuration files for all
326 the features which have been enabled with `icinga2 feature enable`. See
327 [Enabling/Disabling Features](#features) for more details.
330 * The repository.d directory contains all configuration objects
331 * managed by the 'icinga2 repository' CLI commands.
333 include_recursive "repository.d"
335 This `include_recursive` directive is used for discovery of services on remote clients
336 and their generated configuration described in
337 [this chapter](#icinga2-remote-monitoring-master-discovery-generate-config).
341 * Although in theory you could define all your objects in this file
342 * the preferred way is to create separate directories and files in the conf.d
343 * directory. Each of these files must have the file extension ".conf".
345 include_recursive "conf.d"
347 You can put your own configuration files in the [conf.d](#conf-d) directory. This
348 directive makes sure that all of your own configuration files are included.
352 > The example configuration is shipped in this directory too. You can either
353 > remove it entirely, or adapt the existing configuration structure with your
354 > own object configuration.
357 ### <a id="constants-conf"></a> constants.conf
359 The `constants.conf` configuration file can be used to define global constants.
361 By default, you need to make sure to set these constants:
363 * The `PluginDir` constant must be pointed to your [check plugins](#setting-up-check-plugins) path.
364 This constant is required by the shipped
365 [plugin check command configuration](#plugin-check-commands).
366 * The `NodeName` constant defines your local node name. Should be set to FQDN which is the default
367 if not set. This constant is required for local host configuration, monitoring remote clients and
372 /* The directory which contains the plugins from the Monitoring Plugins project. */
373 const PluginDir = "/usr/lib64/nagios/plugins"
376 /* The directory which contains the Manubulon plugins.
377 * Check the documentation, chapter "SNMP Manubulon Plugin Check Commands", for details.
379 const ManubulonPluginDir = "/usr/lib64/nagios/plugins"
381 /* Our local instance name. By default this is the server's hostname as returned by `hostname --fqdn`.
382 * This should be the common name from the API certificate.
384 //const NodeName = "localhost"
386 /* Our local zone name. */
387 const ZoneName = NodeName
389 /* Secret key for remote node tickets */
390 const TicketSalt = ""
392 The `ZoneName` and `TicketSalt` constants are required for remote client
393 and distributed setups only.
396 ### <a id="zones-conf"></a> zones.conf
398 The `zones.conf` configuration file can be used to configure `Endpoint` and `Zone` objects
399 required for a [distributed zone setup](#distributed-monitoring-high-availability). By default
400 a local dummy zone is defined based on the `NodeName` constant defined in
401 [constants.conf](#constants-conf).
405 > Not required for single instance installations.
408 ### <a id="conf-d"></a> Configuration in conf.d Directory
410 This directory contains example configuration getting your started with monitoring
411 the local host and its services. It is included in [icinga2.conf](#icinga2-conf)
412 in the default installation.
414 It can be used as reference example for your own configuration strategy.
415 Just keep in mind to include the main directories in the
416 [icinga2.conf](#icinga2-conf) file.
418 You are certainly not bound to it. Remove it, if you prefer your own
419 way of deploying Icinga 2 configuration.
421 Further details on configuration best practice and how to build your
422 own strategy is described in [this chapter](#configuration-best-practice).
424 Available configuration files shipped by default:
426 * [hosts.conf](#hosts-conf)
427 * [services.conf](#services-conf)
428 * [users.conf](#users-conf)
429 * [notifications.conf](#notifications-conf)
430 * [commands.conf](#commands-conf)
431 * [groups.conf](#groups-conf)
432 * [templates.conf](#templates-conf)
433 * [downtimes.conf](#downtimes-conf)
434 * [timeperiods.conf](#timeperiods-conf)
435 * [satellite.conf](#satellite-conf)
437 #### <a id="hosts-conf"></a> hosts.conf
439 The `conf.d/hosts.conf` file contains an example host based on your
440 `NodeName` setting in [constants.conf](#constants-conf).
442 The `import` keyword is used to import the `generic-host` template which
443 takes care of setting up the host check command to `hostalive`. If you
444 require a different check command, you can override it in the object definition.
446 The `vars` attribute can be used to define custom attributes which are available
447 for check and notification commands. Most of the [Plugin Check Commands](#plugin-check-commands)
448 in the Icinga Template Library require an `address` attribute.
450 The custom attribute `os` is evaluated by the `linux-servers` group in
451 [groups.conf](#groups-conf) making the local host a member.
453 The example host will show you how to
455 * define http vhost attributes for the `http` service apply rule defined
456 in [services.conf](#services.conf).
457 * define disks (all, specific `/`) and their attributes for the `disk`
458 service apply rule defined in [services.conf](#services.conf).
459 * define notification types (`mail`) and set the groups attribute. This
460 will be used by notification apply rules in [notifications.conf](notifications-conf).
462 If you've installed [Icinga Web 2](#setting-up-icingaweb2) you can
463 uncomment the http vhost attributes and relaod Icinga 2. The apply
464 rules in [services.conf](#services.conf) will automatically
465 generate a new service checking the `/icingaweb` URI using the `http`
469 * Host definitions with object attributes
470 * used for apply rules for Service, Notification,
471 * Dependency and ScheduledDowntime objects.
473 * Tip: Use `icinga2 object list --type Host` to
474 * list all host objects after running
475 * configuration validation (`icinga2 daemon -C`).
479 * This is an example host based on your
480 * local host's FQDN. Specify the NodeName
481 * constant in `constants.conf` or use your
482 * own description, e.g. "db-host-1".
485 object Host NodeName {
486 /* Import the default host template defined in `templates.conf`. */
487 import "generic-host"
489 /* Specify the address attributes for checks e.g. `ssh` or `http`. */
490 address = "127.0.0.1"
493 /* Set custom attribute `os` for hostgroup assignment in `groups.conf`. */
496 /* Define http vhost attributes for service apply rules in `services.conf`. */
497 vars.http_vhosts["http"] = {
500 /* Uncomment if you've sucessfully installed Icinga Web 2. */
501 //vars.http_vhosts["Icinga Web 2"] = {
502 // http_uri = "/icingaweb"
505 /* Define disks and attributes for service apply rules in `services.conf`. */
506 vars.disks["disk"] = {
509 vars.disks["disk /"] = {
513 /* Define notification mail attributes for notification apply rules in `notifications.conf`. */
514 vars.notification["mail"] = {
515 /* The UserGroup `icingaadmins` is defined in `users.conf`. */
516 groups = [ "icingaadmins" ]
520 This is only the host object definition. Now we'll need to make sure that this
521 host and your additional hosts are getting [services](#services-conf) applied.
525 > If you don't understand all the attributes and how to use [apply rules](#apply)
526 > don't worry - the [monitoring basics](#monitoring-basics) chapter will explain
529 #### <a id="services-conf"></a> services.conf
531 These service [apply rules](#apply) will show you how to monitor
532 the local host, but also allow you to re-use or modify them for
533 your own requirements.
535 You should define all your service apply rules in `services.conf`
536 or any other central location keeping them organized.
538 By default, the local host will be monitored by the following services
540 Service(s) | Applied on host(s)
541 --------------------------------------------|------------------------
542 `load`, `procs`, `swap`, `users`, `icinga` | The `NodeName` host only
543 `ping4`, `ping6` | All hosts with `address` resp. `address6` attribute
544 `ssh` | All hosts with `address` and `vars.os` set to `Linux`
545 `http`, optional: `Icinga Web 2` | All hosts with custom attribute `http_vhosts` defined as dictionary
546 `disk`, `disk /` | All hosts with custom attribute `disks` defined as dictionary
548 The Debian packages also ship an additional `apt` service check applied to the local host.
550 The command object `icinga` for the embedded health check is provided by the
551 [Icinga Template Library (ITL)](#itl) while `http_ip`, `ssh`, `load`, `processes`,
552 `users` and `disk` are all provided by the [Plugin Check Commands](#plugin-check-commands)
553 which we enabled earlier by including the `itl` and `plugins` configuration file.
556 Example `load` service apply rule:
558 apply Service "load" {
559 import "generic-service"
561 check_command = "load"
563 /* Used by the ScheduledDowntime apply rule in `downtimes.conf`. */
564 vars.backup_downtime = "02:00-03:00"
566 assign where host.name == NodeName
569 The `apply` keyword can be used to create new objects which are associated with
570 another group of objects. You can `import` existing templates, define (custom)
573 The custom attribe `backup_downtime` is defined to a specific timerange string.
574 This variable value will be used for applying a `ScheduledDowntime` object to
575 these services in [downtimes.conf](#downtimes-conf).
577 In this example the `assign where` condition is a boolean expression which is
578 evaluated for all objects of type `Host` and a new service with name "load"
579 is created for each matching host. [Expression operators](#expression-operators)
580 may be used in `assign where` conditions.
582 Multiple `assign where` condition can be combined with `AND` using the `&&` operator
583 as shown in the `ssh` example:
585 apply Service "ssh" {
586 import "generic-service"
588 check_command = "ssh"
590 assign where host.address && host.vars.os == "Linux"
593 In this example, the service `ssh` is applied to all hosts having the `address`
594 attribute defined `AND` having the custom attribute `os` set to the string
596 You can modify this condition to match multiple expressions by combinding `AND`
597 and `OR` using `&&` and `||` [operators](#expression-operators), for example
598 `assign where host.address && (vars.os == "Linux" || vars.os == "Windows")`.
601 A more advanced example is shown by the `http` and `disk` service apply
602 rules. While one `apply` rule for `ssh` will only create a service for matching
603 hosts, you can go one step further: Generate apply rules based on array items
604 or dictionary key-value pairs.
606 The idea is simple: Your host in [hosts.conf](#hosts-conf) defines the
607 `disks` dictionary as custom attribute in `vars`.
609 Remember the example from [hosts.conf](#hosts-conf):
613 /* Define disks and attributes for service apply rules in `services.conf`. */
614 vars.disks["disk"] = {
617 vars.disks["disk /"] = {
623 This dictionary contains multiple service names we want to monitor. `disk`
624 should just check all available disks, while `disk /` will pass an additional
625 parameter `disk_partition` to the check command.
627 You'll recognize that the naming is important - that's the very same name
628 as it is passed from a service to a check command argument. Read about services
629 and passing check commands in [this chapter](#command-passing-parameters).
631 Using `apply Service for` omits the service name, it will take the key stored in
632 the `disk` variable in `key => config` as new service object name.
634 The `for` keyword expects a loop definition, for example `key => value in dictionary`
635 as known from Perl and other scripting languages.
637 Once defined like this, the `apply` rule defined below will do the following:
639 * only match hosts with `host.vars.disks` defined through the `assign where` condition
640 * loop through all entries in the `host.vars.disks` dictionary. That's `disk` and `disk /` as keys.
641 * call `apply` on each, and set the service object name from the provided key
642 * inside apply, the `generic-service` template is imported
643 * defining the [disk](#plugin-check-command-disk) check command requiring command arguments like `disk_partition`
644 * adding the `config` dictionary items to `vars`. Simply said, there's now `vars.disk_partition` defined for the
648 apply Service for (disk => config in host.vars.disks) {
649 import "generic-service"
651 check_command = "disk"
655 assign where host.vars.disks
658 A similar example is used for the `http` services. That way you can make your
659 host the information provider for all apply rules. Define them once, and only
662 Look into [notifications.conf](#notifications-conf) how this technique is used
663 for applying notifications to hosts and services using their type and user
666 Don't forget to install the [check plugins](#setting-up-check-plugins) required by
667 the hosts and services and their check commands.
669 Further details on the monitoring configuration can be found in the
670 [monitoring basics](#monitoring-basics) chapter.
672 #### <a id="users-conf"></a> users.conf
674 Defines the `icingaadmin` User and the `icingaadmins` UserGroup. The latter is used in
675 [hosts.conf](#hostss-conf) for defining a custom host attribute later used in
676 [notifications.conf](#notifications-conf) for notification apply rules.
678 object User "icingaadmin" {
679 import "generic-user"
681 display_name = "Icinga 2 Admin"
682 groups = [ "icingaadmins" ]
684 email = "icinga@localhost"
687 object UserGroup "icingaadmins" {
688 display_name = "Icinga 2 Admin Group"
692 #### <a id="notifications-conf"></a> notifications.conf
694 Notifications for check alerts are an integral part or your
695 Icinga 2 monitoring stack.
697 The shipped example defines two notification apply rules for hosts and services.
698 Both `apply` rules match on the same condition: They are only applied if the
699 nested dictionary attribute `notification.mail` is set.
701 Please note that the `to` keyword is important in [notification apply rules](#using-apply-notifications)
702 defining whether these notifications are applies to hosts or services.
703 The `import` keyword imports the specific mail templates defined in [templates.conf](templates-conf)
705 By setting the `user_groups` to the value provided by the
706 respective [host.vars.notification.mail](#hosts-conf) attribute we'll
707 implicitely use the`icingaadmins` UserGroup defined in [users.conf](#users.conf).
709 apply Notification "mail-icingaadmin" to Host {
710 import "mail-host-notification"
712 user_groups = host.vars.notification.mail.groups
714 assign where host.vars.notification.mail
717 apply Notification "mail-icingaadmin" to Service {
718 import "mail-service-notification"
720 user_groups = host.vars.notification.mail.groups
722 assign where host.vars.notification.mail
725 More details on defining notifications and their additional attributes such as
726 filters can be read in [this chapter](#notifications).
728 #### <a id="commands-conf"></a> commands.conf
730 This is the place where your own command configuration can be defined. By default
731 only the notification commands used by the notification templates defined in [templates.conf](#templates-conf).
735 > Icinga 2 ships the most common command definitions already in the
736 > [Plugin Check Commands](#plugin-check-commands) definitions. More details on
737 > that topic in the [troubleshooting section](#check-command-definitions).
739 You can freely customize these notification commands, and adapt them for your needs.
740 Read more on that topic [here](#notification-commands).
742 #### <a id="groups-conf"></a> groups.conf
744 The example host defined in [hosts.conf](hosts-conf) already has the
745 custom attribute `os` set to `Linux` and is therefore automatically
746 a member of the host group `linux-servers`.
748 This is done by using the [group assign](#group-assign) expressions similar
749 to previously seen [apply rules](#using-apply).
751 object HostGroup "linux-servers" {
752 display_name = "Linux Servers"
754 assign where host.vars.os == "Linux"
757 object HostGroup "windows-servers" {
758 display_name = "Windows Servers"
760 assign where host.vars.os == "Windows"
763 Service groups can be grouped together by similar pattern matches.
764 The [match() function](#function-calls) expects a wildcard match string
765 and the attribute string to match with.
767 object ServiceGroup "ping" {
768 display_name = "Ping Checks"
770 assign where match("ping*", service.name)
773 object ServiceGroup "http" {
774 display_name = "HTTP Checks"
776 assign where match("http*", service.check_command)
779 object ServiceGroup "disk" {
780 display_name = "Disk Checks"
782 assign where match("disk*", service.check_command)
786 #### <a id="templates-conf"></a> templates.conf
788 All shipped example configuration objects use generic global templates by
789 default. Be it setting a default `check_command` attribute in the `generic-host`
790 templates for your hosts defined in [hosts.conf](#hosts-conf), or defining
791 the default `states` and `types` filters for notification apply rules defined in
792 [notifications.conf](#notifications-conf).
795 template Host "generic-host" {
796 max_check_attempts = 5
800 check_command = "hostalive"
803 template Service "generic-service" {
804 max_check_attempts = 3
809 The `hostalive` check command is shipped with Icinga 2 in the
810 [Plugin Check Commands](#plugin-check-commands).
813 template Notification "mail-host-notification" {
814 command = "mail-host-notification"
816 states = [ Up, Down ]
817 types = [ Problem, Acknowledgement, Recovery, Custom,
818 FlappingStart, FlappingEnd,
819 DowntimeStart, DowntimeEnd, DowntimeRemoved ]
824 template Notification "mail-service-notification" {
825 command = "mail-service-notification"
827 states = [ OK, Warning, Critical, Unknown ]
828 types = [ Problem, Acknowledgement, Recovery, Custom,
829 FlappingStart, FlappingEnd,
830 DowntimeStart, DowntimeEnd, DowntimeRemoved ]
835 More details on `Notification` object attributes can be found [here](#objecttype-notification).
838 #### <a id="downtimes-conf"></a> downtimes.conf
840 The `load` service apply rule defined in [services.conf](#services-conf) defines
841 the `backup_downtime` custom attribute.
843 The [ScheduledDowntime](#objecttype-scheduleddowntime) apply rule uses this attribute
844 to define the default value for the time ranges required for recurring downtime slots.
846 apply ScheduledDowntime "backup-downtime" to Service {
847 author = "icingaadmin"
848 comment = "Scheduled downtime for backup"
851 monday = service.vars.backup_downtime
852 tuesday = service.vars.backup_downtime
853 wednesday = service.vars.backup_downtime
854 thursday = service.vars.backup_downtime
855 friday = service.vars.backup_downtime
856 saturday = service.vars.backup_downtime
857 sunday = service.vars.backup_downtime
860 assign where service.vars.backup_downtime != ""
864 #### <a id="timeperiods-conf"></a> timeperiods.conf
866 This file ships the default timeperiod definitions for `24x7`, `9to5`
867 and `never`. Timeperiod objects are referenced by `*period`
868 objects such as hosts, services or notifications.
871 #### <a id="satellite-conf"></a> satellite.conf
873 Ships default templates and dependencies for [monitoring remote clients](#icinga2-remote-client-monitoring)
874 using service discovery and [config generation](#icinga2-remote-monitoring-master-discovery-generate-config)
875 on the master. Can be ignored/removed on setups not using this features.
878 Further details on the monitoring configuration can be found in the
879 [monitoring basics](#monitoring-basics) chapter.
883 ## <a id="configuring-db-ido"></a> Configuring DB IDO
885 The DB IDO (Database Icinga Data Output) modules for Icinga 2 take care of exporting
886 all configuration and status information into a database. The IDO database is used
887 by a number of projects including Icinga Web 1.x, Reporting or Icinga Web 2.
889 There is a separate module for each database back-end. At present support for
890 both MySQL and PostgreSQL is implemented.
892 Icinga 2 uses the Icinga 1.x IDOUtils database schema. Icinga 2 requires additional
893 features not yet released with older Icinga 1.x versions.
897 > Please check the [what's new](#whats-new) section for the required schema version.
901 > Only install the IDO feature if your web interface or reporting tool requires
902 > you to do so (for example, [Icinga Web](#setting-up-icinga-web) or [Icinga Web 2](#setting-up-icingaweb2)).
903 > [Icinga Classic UI](#setting-up-icinga-classic-ui) does not use IDO as backend.
905 ### <a id="installing-database"></a> Installing the Database Server
907 In order to use DB IDO you need to setup either [MySQL](#installing-database-mysql-server)
908 or [PostgreSQL](#installing-database-postgresql-server) as supported database server.
912 > It's up to you whether you choose to install it on the same server where Icinga 2 is running on,
913 > or on a dedicated database host (or cluster).
915 #### <a id="installing-database-mysql-server"></a> Installing MySQL database server
919 # apt-get install mysql-server mysql-client
923 # yum install mysql-server mysql
924 # chkconfig mysqld on
925 # service mysqld start
927 RHEL/CentOS 7 and Fedora 20 prefer MariaDB over MySQL:
929 # yum install mariadb-server mariadb
930 # systemctl enable mariadb.service
931 # systemctl start mariadb.service
935 # zypper install mysql mysql-client
936 # chkconfig mysqld on
937 # service mysqld start
939 RHEL based distributions do not automatically set a secure root password. Do that **now**:
941 # /usr/bin/mysql_secure_installation
944 #### <a id="installing-database-postgresql-server"></a> Installing PostgreSQL database server
948 # apt-get install postgresql
952 # yum install postgresql-server postgresql
953 # chkconfig postgresql on
954 # service postgresql start
956 RHEL/CentOS 7 and Fedora 20 use [systemd](#systemd-service):
958 # yum install postgresql-server postgresql
959 # systemctl enable postgresql.service
960 # systemctl start postgresql.service
964 # zypper install postgresql postgresql-server
965 # chkconfig postgresql on
966 # service postgresql start
968 ### <a id="configuring-db-ido-mysql"></a> Configuring DB IDO MySQL
970 First of all you have to install the `icinga2-ido-mysql` package using your
971 distribution's package manager.
975 # apt-get install icinga2-ido-mysql
979 # yum install icinga2-ido-mysql
983 # zypper install icinga2-ido-mysql
989 > Upstream Debian packages provide a database configuration wizard by default.
990 > You can skip the automated setup and install/upgrade the database manually
991 > if you prefer that.
993 #### <a id="setting-up-mysql-db"></a> Setting up the MySQL database
995 Set up a MySQL database for Icinga 2:
999 mysql> CREATE DATABASE icinga;
1000 GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';
1003 After creating the database you can import the Icinga 2 IDO schema using the
1006 # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql
1009 #### <a id="upgrading-mysql-db"></a> Upgrading the MySQL database
1011 Check the `/usr/share/icinga2-ido-mysql/schema/upgrade` directory for an
1012 incremental schema upgrade file.
1016 > If there isn't an upgrade file for your current version available there's nothing to do.
1018 Apply all database schema upgrade files incrementially.
1020 # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/upgrade/<version>.sql
1022 The Icinga 2 DB IDO module will check for the required database schema version on startup
1023 and generate an error message if not satisfied.
1026 **Example:** You are upgrading Icinga 2 from version `2.0.2` to `2.1.0`. Look into
1027 the *upgrade* directory:
1029 $ ls /usr/share/icinga2-ido-mysql/schema/upgrade/
1032 There is a new upgrade file called `2.1.0.sql` which must be applied to your IDO database.
1035 #### <a id="installing-ido-mysql"></a> Installing the IDO MySQL module
1037 The package provides a new configuration file that is installed in
1038 `/etc/icinga2/features-available/ido-mysql.conf`. You will need to update the
1039 database credentials in this file.
1041 You can enable the `ido-mysql` feature configuration file using `icinga2 feature enable`:
1043 # icinga2 feature enable ido-mysql
1044 Module 'ido-mysql' was enabled.
1045 Make sure to restart Icinga 2 for these changes to take effect.
1047 After enabling the ido-mysql feature you have to restart Icinga 2:
1049 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
1051 # service icinga2 restart
1053 RHEL/CentOS 7 and Fedora 20:
1055 # systemctl restart icinga2.service
1057 ### <a id="configuring-db-ido-postgresql"></a> Configuring DB IDO PostgreSQL
1059 First of all you have to install the `icinga2-ido-pgsql` package using your
1060 distribution's package manager.
1064 # apt-get install icinga2-ido-pgsql
1068 # yum install icinga2-ido-pgsql
1072 # zypper install icinga2-ido-pgsql
1076 > Upstream Debian packages provide a database configuration wizard by default.
1077 > You can skip the automated setup and install/upgrade the database manually
1078 > if you prefer that.
1080 #### Setting up the PostgreSQL database
1082 Set up a PostgreSQL database for Icinga 2:
1085 # sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD 'icinga'";
1086 # sudo -u postgres createdb -O icinga -E UTF8 icinga
1087 # sudo -u postgres createlang plpgsql icinga
1091 > Using PostgreSQL 9.x you can omit the `createlang` command.
1093 Locate your pg_hba.conf (Debian: `/etc/postgresql/*/main/pg_hba.conf`,
1094 RHEL/SUSE: `/var/lib/pgsql/data/pg_hba.conf`), add the icinga user with md5
1095 authentication method and restart the postgresql server.
1097 # vim /var/lib/pgsql/data/pg_hba.conf
1100 local icinga icinga md5
1101 host icinga icinga 127.0.0.1/32 md5
1102 host icinga icinga ::1/128 md5
1104 # "local" is for Unix domain socket connections only
1106 # IPv4 local connections:
1107 host all all 127.0.0.1/32 ident
1108 # IPv6 local connections:
1109 host all all ::1/128 ident
1111 # /etc/init.d/postgresql restart
1114 After creating the database and permissions you can import the Icinga 2 IDO schema
1115 using the following command:
1117 # export PGPASSWORD=icinga
1118 # psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql
1120 #### <a id="upgrading-postgresql-db"></a> Upgrading the PostgreSQL database
1122 Check the `/usr/share/icinga2-ido-pgsql/schema/upgrade` directory for an
1123 incremental schema upgrade file.
1127 > If there isn't an upgrade file for your current version available there's nothing to do.
1129 Apply all database schema upgrade files incrementially.
1131 # export PGPASSWORD=icinga
1132 # psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/upgrade/<version>.sql
1134 The Icinga 2 DB IDO module will check for the required database schema version on startup
1135 and generate an error message if not satisfied.
1137 **Example:** You are upgrading Icinga 2 from version `2.0.2` to `2.1.0`. Look into
1138 the *upgrade* directory:
1140 $ ls /usr/share/icinga2-ido-pgsql/schema/upgrade/
1143 There is a new upgrade file called `2.1.0.sql` which must be applied to your IDO database.
1146 #### <a id="installing-ido-postgresql"></a> Installing the IDO PostgreSQL module
1148 The package provides a new configuration file that is installed in
1149 `/etc/icinga2/features-available/ido-pgsql.conf`. You will need to update the
1150 database credentials in this file.
1152 You can enable the `ido-pgsql` feature configuration file using `icinga2 feature enable`:
1154 # icinga2 feature enable ido-pgsql
1155 Module 'ido-pgsql' was enabled.
1156 Make sure to restart Icinga 2 for these changes to take effect.
1158 After enabling the ido-pgsql feature you have to restart Icinga 2:
1160 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
1162 # service icinga2 restart
1164 RHEL/CentOS 7 and Fedora 20:
1166 # systemctl restart icinga2.service
1169 ### <a id="setting-up-external-command-pipe"></a> Setting Up External Command Pipe
1171 Web interfaces and other Icinga addons are able to send commands to
1172 Icinga 2 through the external command pipe.
1174 You can enable the External Command Pipe using icinga2 feature enable:
1176 # icinga2 feature enable command
1178 After that you will have to restart Icinga 2:
1180 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
1182 # service icinga2 restart
1184 RHEL/CentOS 7 and Fedora 20:
1186 # systemctl restart icinga2.service
1188 By default the command pipe file is owned by the group `icingacmd` with read/write
1189 permissions. Add your webserver's user to the group `icingacmd` to
1190 enable sending commands to Icinga 2 through your web interface:
1192 # usermod -a -G icingacmd www-data
1194 Debian packages use `nagios` as the default user and group name. Therefore change `icingacmd` to
1196 The webserver's user is different between distributions so you might have to change `www-data` to
1197 `wwwrun`, `www`, or `apache`.
1199 Change "www-data" to the user you're using to run queries.
1203 > Packages will do that automatically. Verify that by running `id <your-webserver-user>` and skip this
1206 ## <a id="setting-up-livestatus"></a> Setting up Livestatus
1208 The [MK Livestatus](http://mathias-kettner.de/checkmk_livestatus.html) project
1209 implements a query protocol that lets users query their Icinga instance for
1210 status information. It can also be used to send commands.
1214 > Only install the Livestatus feature if your web interface or addon requires
1215 > you to do so (for example, [Icinga Web 2](#setting-up-icingaweb2)).
1216 > [Icinga Classic UI](#setting-up-icinga-classic-ui) and [Icinga Web](#setting-up-icinga-web)
1217 > do not use Livestatus as backend.
1219 The Livestatus component that is distributed as part of Icinga 2 is a
1220 re-implementation of the Livestatus protocol which is compatible with MK
1223 Details on the available tables and attributes with Icinga 2 can be found
1224 in the [Livestatus](#livestatus) section.
1226 You can enable Livestatus using icinga2 feature enable:
1228 # icinga2 feature enable livestatus
1230 After that you will have to restart Icinga 2:
1232 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
1234 # service icinga2 restart
1236 RHEL/CentOS 7 and Fedora 20:
1238 # systemctl restart icinga2.service
1240 By default the Livestatus socket is available in `/var/run/icinga2/cmd/livestatus`.
1242 In order for queries and commands to work you will need to add your query user
1243 (e.g. your web server) to the `icingacmd` group:
1245 # usermod -a -G icingacmd www-data
1247 The Debian packages use `nagios` as the user and group name. Make sure to change `icingacmd` to
1248 `nagios` if you're using Debian.
1250 Change "www-data" to the user you're using to run queries.
1252 In order to use the historical tables provided by the livestatus feature (for example, the
1253 `log` table) you need to have the `CompatLogger` feature enabled. By default these logs
1254 are expected to be in `/var/log/icinga2/compat`. A different path can be set using the
1255 `compat_log_path` configuration attribute.
1257 # icinga2 feature enable compatlog
1259 ## <a id="setting-up-icinga2-user-interfaces"></a> Setting up Icinga 2 User Interfaces
1261 Icinga 2 is compatible with Icinga 1.x user interfaces by providing additional
1262 features required as backends.
1264 Furthermore these interfaces can be used for the newly created `Icinga Web 2`
1267 Some interface features will only work in a limited manner due to
1268 [compatibility reasons](#differences-1x-2), other features like the
1269 statusmap parents are available by dumping the host dependencies as parents.
1270 Special restrictions are noted specifically in the sections below.
1274 > Choose your preferred interface. There's no need to install [Classic UI](#setting-up-icinga-classic-ui)
1275 > if you prefer [Icinga Web](#setting-up-icinga-web) or [Icinga Web 2](#setting-up-icingaweb2) for example.
1277 ### <a id="icinga2-user-interface-requirements"></a> Requirements
1279 * Web server (Apache2/Httpd, Nginx, Lighttp, etc)
1281 * Firewall ports (tcp/80)
1283 The Debian, RHEL and SUSE packages for Icinga [Classic UI](#setting-up-icinga-classic-ui),
1284 [Web](#setting-up-icinga-web) and [Icingaweb 2](#setting-up-icingaweb2) depend on Apache2
1287 #### <a id="icinga2-user-interface-webserver"></a> Webserver
1289 Debian/Ubuntu packages will automatically fetch and install the required packages.
1294 # chkconfig httpd on && service httpd start
1296 # systemctl enable httpd && systemctl start httpd
1300 # zypper install apache2
1301 # chkconfig on && service apache2 start
1303 #### <a id="icinga2-user-interface-firewall-rules"></a> Firewall Rules
1307 # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
1308 # service iptables save
1310 RHEL/CentOS 7 specific:
1312 # firewall-cmd --add-service=http
1313 # firewall-cmd --permanent --add-service=http
1315 ### <a id="setting-up-icinga-classic-ui"></a> Setting up Icinga Classic UI
1317 Icinga 2 can write `status.dat` and `objects.cache` files in the format that
1318 is supported by the Icinga 1.x Classic UI. [External commands](#external-commands)
1319 (a.k.a. the "command pipe") are also supported. It also supports writing Icinga 1.x
1320 log files which are required for the reporting functionality in the Classic UI.
1322 #### <a id="installing-icinga-classic-ui"></a> Installing Icinga Classic UI
1324 The Icinga package repository has both Debian and RPM packages. You can install
1325 the Classic UI using the following packages:
1327 Distribution | Packages
1328 --------------|---------------------
1329 Debian | icinga2-classicui
1330 RHEL/SUSE | icinga2-classicui-config icinga-gui
1332 The Debian packages require additional packages which are provided by the
1333 [Debian Monitoring Project](http://www.debmon.org) (`DebMon`) repository.
1335 `libjs-jquery-ui` requires at least version `1.10.*` which is not available
1336 in Debian 7 (Wheezy) and Ubuntu 12.04 LTS (Precise). Add the following repositories
1337 to satisfy this dependency:
1339 Distribution | Package Repositories
1340 ------------------------------|------------------------------
1341 Debian Wheezy | [wheezy-backports](http://backports.debian.org/Instructions/) or [DebMon](http://www.debmon.org)
1342 Ubuntu 12.04 LTS (Precise) | [Icinga PPA](https://launchpad.net/~formorer/+archive/icinga)
1344 On all distributions other than Debian you may have to restart both your web
1345 server as well as Icinga 2 after installing the Classic UI package.
1347 Icinga Classic UI requires the [StatusDataWriter](#status-data), [CompatLogger](#compat-logging)
1348 and [ExternalCommandListener](#external-commands) features.
1349 Enable these features and restart Icinga 2.
1351 # icinga2 feature enable statusdata compatlog command
1353 In order for commands to work you will need to [setup the external command pipe](#setting-up-external-command-pipe).
1355 #### <a id="setting-up-icinga-classic-ui-summary"></a> Setting Up Icinga Classic UI Summary
1357 Verify that your Icinga 1.x Classic UI works by browsing to your Classic
1358 UI installation URL:
1360 Distribution | URL | Default Login
1361 --------------|--------------------------------------------------------------------------|--------------------------
1362 Debian | [http://localhost/icinga2-classicui](http://localhost/icinga2-classicui) | asked during installation
1363 all others | [http://localhost/icinga](http://localhost/icinga) | icingaadmin/icingaadmin
1365 For further information on configuration, troubleshooting and interface documentation
1366 please check the official [Icinga 1.x user interface documentation](http://docs.icinga.org/latest/en/ch06.html).
1368 ### <a id="setting-up-icinga-web"></a> Setting up Icinga Web
1370 Icinga 2 can write to the same schema supplied by `Icinga IDOUtils 1.x` which
1371 is an explicit requirement to run `Icinga Web` next to the external command pipe.
1372 Therefore you need to setup the [DB IDO feature](#configuring-ido) remarked in the previous sections.
1374 #### <a id="installing-icinga-web"></a> Installing Icinga Web
1376 The Icinga package repository has both Debian and RPM packages. You can install
1377 Icinga Web using the following packages (RPMs ship an additional configuration package):
1379 Distribution | Packages
1380 --------------|-------------------------------------------------------
1381 RHEL/SUSE | icinga-web icinga-web-{mysql,pgsql}
1382 Debian | icinga-web icinga-web-config-icinga2-ido-{mysql,pgsql}
1384 #### <a id="icinga-web-rpm-notes"></a> Icinga Web on RPM based systems
1386 Additionally you need to setup the `icinga_web` database and import the database schema.
1387 Details can be found in the package `README` files, for example [README.RHEL](https://github.com/Icinga/icinga-web/blob/master/doc/README.RHEL)
1389 The Icinga Web RPM packages install the schema files into
1390 `/usr/share/doc/icinga-web-*/schema` (`*` means package version).
1391 The Icinga Web dist tarball ships the schema files in `etc/schema`.
1393 On SuSE-based distributions the schema files are installed in
1394 `/usr/share/doc/packages/icinga-web/schema`.
1396 Example for RHEL and MySQL:
1400 mysql> CREATE DATABASE icinga_web;
1401 GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga_web.* TO 'icinga_web'@'localhost' IDENTIFIED BY 'icinga_web';
1404 # mysql -u root -p icinga_web < /usr/share/doc/icinga-web-<version>/schema/mysql.sql
1406 Icinga Web requires the IDO feature as database backend using MySQL or PostgreSQL.
1407 Enable that feature, e.g. for MySQL.
1409 # icinga2 feature enable ido-mysql
1411 If you've changed your default credentials you may either create a read-only user
1412 or use the credentials defined in the IDO feature for Icinga Web backend configuration.
1413 Edit `databases.xml` accordingly and clear the cache afterwards. Further details can be
1414 found in the [Icinga Web documentation](http://docs.icinga.org/latest/en/icinga-web-config.html).
1416 # vim /etc/icinga-web/conf.d/databases.xml
1418 # icinga-web-clearcache
1420 Additionally you need to enable the `command` feature for sending [external commands](#external-commands):
1422 # icinga2 feature enable command
1424 In order for commands to work you will need to [setup the external command pipe](#setting-up-external-command-pipe).
1426 Then edit the Icinga Web configuration for sending commands in `/etc/icinga-web/conf.d/access.xml`
1427 (RHEL) or `/etc/icinga-web/access.xml` (SUSE) setting the command pipe path
1428 to the default used in Icinga 2. Make sure to clear the cache afterwards.
1430 # vim /etc/icinga-web/conf.d/access.xml
1434 <resource name="icinga_pipe">/var/run/icinga2/cmd/icinga2.cmd</resource>
1438 # icinga-web-clearcache
1442 > The path to the Icinga Web `clearcache` script may differ. Please check the
1443 > [Icinga Web documentation](https://docs.icinga.org) for details.
1445 #### <a id="icinga-web-debian-notes"></a> Icinga Web on Debian systems
1447 Since Icinga Web `1.11.1-2` the IDO auto-configuration has been moved into
1448 additional packages on Debian and Ubuntu.
1450 The package `icinga-web` no longer configures the IDO connection. You must now
1451 use one of the config packages:
1453 - `icinga-web-config-icinga2-ido-mysql`
1454 - `icinga-web-config-icinga2-ido-pgsql`
1456 These packages take care of setting up the [DB IDO](#configuring-db-ido) configuration,
1457 enabling the external command pipe for Icinga Web and depend on
1458 the corresponding packages of Icinga 2.
1460 Please read the `README.Debian` files for details and advanced configuration:
1462 - `/usr/share/doc/icinga-web/README.Debian`
1463 - `/usr/share/doc/icinga-web-config-icinga2-ido-mysql/README.Debian`
1464 - `/usr/share/doc/icinga-web-config-icinga2-ido-pgsql/README.Debian`
1466 When changing Icinga Web configuration files make sure to clear the config cache:
1468 # /usr/lib/icinga-web/bin/clearcache.sh
1472 > If you are using an older version of Icinga Web, install it like this and adapt
1473 > the configuration manually as shown in [the RPM notes](#icinga-web-rpm-notes):
1475 > `apt-get install --no-install-recommends icinga-web`
1477 #### <a id="setting-up-icinga-web-summary"></a> Setting Up Icinga Web Summary
1479 Verify that your Icinga 1.x Web works by browsing to your Web installation URL:
1481 Distribution | URL | Default Login
1482 --------------|-------------------------------------------------------------|--------------------------
1483 Debian | [http://localhost/icinga-web](http://localhost/icinga-web) | asked during installation
1484 all others | [http://localhost/icinga-web](http://localhost/icinga-web) | root/password
1486 For further information on configuration, troubleshooting and interface documentation
1487 please check the official [Icinga 1.x user interface documentation](http://docs.icinga.org/latest/en/ch06.html).
1490 ### <a id="setting-up-icingaweb2"></a> Setting up Icinga Web 2
1492 Icinga Web 2 will support `DB IDO` or `Livestatus` as backends.
1494 Using DB IDO as backend, you need to install and configure the [DB IDO backend](#configuring-db-ido).
1495 Once finished, you can enable the feature for DB IDO MySQL:
1497 # icinga2 feature enable ido-mysql
1499 Furthermore [external commands](#external-commands) are supported through the external
1502 # icinga2 feature enable command
1504 In order for commands to work you will need to [setup the external command pipe](#setting-up-external-command-pipe).
1506 Please consult the INSTALL documentation shipped with `Icinga Web 2` for
1507 further instructions on how to install Icinga Web 2 and to configure
1508 backends, resources and instances.
1512 > Icinga Web 2 is still under heavy development. Rather than installing it
1513 > yourself you should consider testing it using the available
1514 > [Vagrant demo VM](https://github.com/icinga/icinga-vagrant).
1516 Check the [Icinga website](https://www.icinga.org) for release schedules,
1517 blog updates and more.
1520 ### <a id="additional-visualization"></a> Additional visualization
1522 There are many visualization addons which can be used with Icinga 2.
1524 Some of the more popular ones are [PNP](#addons-graphing-pnp), [inGraph](#addons-graphing-pnp)
1525 (graphing performance data), [Graphite](#addons-graphing-pnp), and
1526 [NagVis](#addons-visualization-nagvis) (network maps).
1529 ## <a id="configuration-tools"></a> Configuration Tools
1531 If you require your favourite configuration tool to export Icinga 2 configuration, please get in
1532 touch with their developers. The Icinga project does not provide a configuration web interface
1537 > Get to know the new configuration format and the advanced [apply](#using-apply) rules and
1538 > use [syntax highlighting](#configuration-syntax-highlighting) in vim/nano.
1540 If you're looking for puppet manifests, chef cookbooks, ansible recipes, etc - we're happy
1541 to integrate them upstream, so please get in touch at [https://support.icinga.org](https://support.icinga.org).
1543 These tools are in development and require feedback and tests:
1545 * [Ansible Roles](https://github.com/Icinga/icinga2-ansible)
1546 * [Puppet Module](https://github.com/Icinga/puppet-icinga2)
1548 ## <a id="configuration-syntax-highlighting"></a> Configuration Syntax Highlighting
1550 Icinga 2 ships configuration examples for syntax highlighting using the `vim` and `nano` editors.
1551 The RHEL, SUSE and Debian package `icinga2-common` install these files into
1552 `/usr/share/*/icinga2-common/syntax`. Sources provide these files in `tools/syntax`.
1554 ### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
1556 Create a new local vim configuration storage, if not already existing.
1557 Edit `vim/ftdetect/icinga2.vim` if your paths to the Icinga 2 configuration
1561 $ mkdir -p $PREFIX/{syntax,ftdetect}
1562 $ cp vim/syntax/icinga2.vim $PREFIX/syntax/
1563 $ cp vim/ftdetect/icinga2.vim $PREFIX/ftdetect/
1567 $ vim /etc/icinga2/conf.d/templates.conf
1569 ### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
1571 Copy the `/etc/nanorc` sample file to your home directory. Create the `/etc/nano` directory
1572 and copy the provided `icinga2.nanorc` into it.
1574 $ cp /etc/nanorc ~/.nanorc
1576 # mkdir -p /etc/nano
1577 # cp icinga2.nanorc /etc/nano/
1579 Then include the icinga2.nanorc file in your ~/.nanorc by adding the following line:
1584 include "/etc/nano/icinga2.nanorc"
1588 $ nano /etc/icinga2/conf.d/templates.conf
1591 ## <a id="running-icinga2"></a> Running Icinga 2
1593 ### <a id="init-script"></a> Init Script
1595 Icinga 2's init script is installed in `/etc/init.d/icinga2` by default:
1597 # /etc/init.d/icinga2
1598 Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
1600 Command | Description
1601 --------------------|------------------------
1602 start | The `start` action starts the Icinga 2 daemon.
1603 stop | The `stop` action stops the Icinga 2 daemon.
1604 restart | The `restart` action is a shortcut for running the `stop` action followed by `start`.
1605 reload | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted.
1606 checkconfig | The `checkconfig` action checks if the `/etc/icinga2/icinga2.conf` configuration file contains any errors.
1607 status | The `status` action checks if Icinga 2 is running.
1609 By default the Icinga 2 daemon is running as `icinga` user and group
1610 using the init script. Using Debian packages the user and group are set to `nagios`
1611 for historical reasons.
1613 ### <a id="systemd-service"></a> Systemd Service
1615 Modern distributions (Fedora, OpenSUSE, etc.) already use `Systemd` natively. Enterprise-grade
1616 distributions such as RHEL7 changed to `Systemd` recently. Icinga 2 Packages will install the
1617 service automatically.
1619 The Icinga 2 `Systemd` service can be (re)started, reloaded, stopped and also queried for its current status.
1621 # systemctl status icinga2
1622 icinga2.service - Icinga host/service/network monitoring system
1623 Loaded: loaded (/usr/lib/systemd/system/icinga2.service; disabled)
1624 Active: active (running) since Mi 2014-07-23 13:39:38 CEST; 15s ago
1625 Process: 21692 ExecStart=/usr/sbin/icinga2 -c ${ICINGA2_CONFIG_FILE} -d -e ${ICINGA2_ERROR_LOG} -u ${ICINGA2_USER} -g ${ICINGA2_GROUP} (code=exited, status=0/SUCCESS)
1626 Process: 21674 ExecStartPre=/usr/sbin/icinga2-prepare-dirs /etc/sysconfig/icinga2 (code=exited, status=0/SUCCESS)
1627 Main PID: 21727 (icinga2)
1628 CGroup: /system.slice/icinga2.service
1629 └─21727 /usr/sbin/icinga2 -c /etc/icinga2/icinga2.conf -d -e /var/log/icinga2/error.log -u icinga -g icinga --no-stack-rlimit
1631 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 309 Service(s).
1632 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 User(s).
1633 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 15 Notification(s).
1634 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 4 ScheduledDowntime(s).
1635 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 UserGroup(s).
1636 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 IcingaApplication(s).
1637 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 8 Dependency(s).
1638 Jul 23 13:39:38 nbmif systemd[1]: Started Icinga host/service/network monitoring system.
1640 `Systemd` supports the following command actions:
1642 Command | Description
1643 --------------------|------------------------
1644 start | The `start` action starts the Icinga 2 daemon.
1645 stop | The `stop` action stops the Icinga 2 daemon.
1646 restart | The `restart` action is a shortcut for running the `stop` action followed by `start`.
1647 reload | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted.
1648 status | The `status` action checks if Icinga 2 is running.
1649 enable | The `enable` action enables the service being started at system boot time (similar to `chkconfig`)
1651 If you're stuck with configuration errors, you can manually invoke the [configuration validation](#config-validation).
1653 # systemctl enable icinga2
1655 # systemctl restart icinga2
1656 Job for icinga2.service failed. See 'systemctl status icinga2.service' and 'journalctl -xn' for details.
1660 ### <a id="cli-commands"></a> Icinga 2 CLI Commands
1662 Icinga 2 ships its own integrated cli commands supporting bash-autocompletion.
1664 These cli commands will allow you to use certain functionality
1665 provided by and around the Icinga 2 daemon.
1669 > The cli commands are available in Icinga 2 starting with *2.2*.
1671 Each cli command provides its own help and usage information, so please
1672 make sure to always run them withthe `--help` parameter.
1674 Run `icinga2` without any arguments (or using `--help`) to get a list of
1675 all available global options.
1679 icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
1682 icinga2 <command> [<arguments>]
1685 * daemon (starts Icinga 2)
1686 * feature disable (disables specified feature)
1687 * feature enable (enables specified feature)
1688 * feature list (lists all enabled features)
1689 * node add (add node)
1690 * node blacklist add (adds a new blacklist filter)
1691 * node blacklist list (lists all blacklist filters)
1692 * node blacklist remove (removes a blacklist filter)
1693 * node list (lists all nodes)
1694 * node remove (removes node)
1695 * node set (set node attributes)
1696 * node setup (set up node)
1697 * node update-config (update node config)
1698 * node whitelist add (adds a new whitelist filter)
1699 * node whitelist list (lists all whitelist filters)
1700 * node whitelist remove (removes a whitelist filter)
1701 * node wizard (wizard for node setup)
1702 * object list (lists all objects)
1703 * pki new-ca (sets up a new CA)
1704 * pki new-cert (creates a new CSR)
1705 * pki request (requests a certificate)
1706 * pki save-cert (saves another Icinga 2 instance's certificate)
1707 * pki sign-csr (signs a CSR)
1708 * pki ticket (generates a ticket)
1709 * repository clear-changes (clear uncommitted repository changes)
1710 * repository commit (commit repository changes)
1711 * repository endpoint add (adds a new Endpoint object)
1712 * repository endpoint list (lists all Endpoint objects)
1713 * repository endpoint remove (removes a Endpoint object)
1714 * repository host add (adds a new Host object)
1715 * repository host list (lists all Host objects)
1716 * repository host remove (removes a Host object)
1717 * repository service add (adds a new Service object)
1718 * repository service list (lists all Service objects)
1719 * repository service remove (removes a Service object)
1720 * repository zone add (adds a new Zone object)
1721 * repository zone list (lists all Zone objects)
1722 * repository zone remove (removes a Zone object)
1723 * variable get (gets a variable)
1724 * variable list (lists all variables)
1727 -h [ --help ] show this help message
1728 -V [ --version ] show version information
1729 --color use VT100 color codes even when stdout is not a
1731 -D [ --define ] arg define a constant
1732 -l [ --library ] arg load a library
1733 -I [ --include ] arg add include search directory
1734 -x [ --log-level ] arg specify the log level for the console log
1738 Report bugs at <https://dev.icinga.org/>
1739 Icinga home page: <http://www.icinga.org/>
1742 #### <a id="cli-commands-autocompletion"></a> Icinga 2 CLI Bash Autocompletion
1744 Bash Auto-Completion (pressing `<TAB>`) is provided only for the corresponding context.
1746 While `--config` will suggest and auto-complete files and directories on disk,
1747 `feature enable` will only suggest disabled features. `repository` will know
1748 about object specific attributes, and so on. Try it yourself.
1750 RPM and Debian packages install the bash completion files into
1751 `/etc/bash_completion.d/icinga2`.
1753 You will need to install the `bash-completion` package if not already installed.
1756 # yum install bash-completion
1759 # zypper install bash-completion
1762 # apt-get install bash-completion
1764 #### <a id="cli-commands-global-options"></a> Icinga 2 CLI Global Options
1768 Instead of loading libraries using the [`library` config directive](#library)
1769 you can also use the `--library` command-line option.
1773 [Global constants](#global-constants) can be set using the `--define` command-line option.
1775 ##### Config Include Path
1777 When including files you can specify that the include search path should be
1778 checked. You can do this by putting your configuration file name in angle
1783 This would cause Icinga 2 to search its include path for the configuration file
1784 `test.conf`. By default the installation path for the Icinga Template Library
1785 is the only search directory.
1787 Using the `--include` command-line option additional search directories can be
1792 #### <a id="cli-command-daemon"></a> Cli command: Daemon
1794 The cli command `daemon` provides the functionality to start/stop Icinga 2.
1795 Furthermore it provides the [configuration validation](#config-validation).
1797 # icinga2 daemon --help
1798 icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
1801 icinga2 daemon [<arguments>]
1806 -h [ --help ] show this help message
1807 -V [ --version ] show version information
1808 --color use VT100 color codes even when stdout is not a
1810 -D [ --define ] arg define a constant
1811 -l [ --library ] arg load a library
1812 -I [ --include ] arg add include search directory
1813 -x [ --log-level ] arg specify the log level for the console log
1816 -c [ --config ] arg parse a configuration file
1817 -z [ --no-config ] start without a configuration file
1818 -C [ --validate ] exit after validating the configuration
1819 -e [ --errorlog ] arg log fatal errors to the specified log file (only works
1820 in combination with --daemonize)
1821 -d [ --daemonize ] detach from the controlling terminal
1823 Report bugs at <https://dev.icinga.org/>
1824 Icinga home page: <http://www.icinga.org/>
1828 Using the `--config` option you can specify one or more configuration files.
1829 Config files are processed in the order they're specified on the command-line.
1831 When no configuration file is specified and the `--no-config` is not used
1832 Icinga 2 automatically falls back to using the configuration file
1833 `SysconfDir + "/icinga2/icinga2.conf"` (where SysconfDir is usually `/etc`).
1835 ##### Config Validation
1837 The `--validate` option can be used to check if your configuration files
1838 contain errors. If any errors are found the exit status is 1, otherwise 0
1839 is returned. More details in the [configuration validation](#config-validation) chapter.
1842 #### <a id="cli-command-feature"></a> Cli command: Feature
1844 The cli commands for `enable` and `disable` feature support bash auto-completion
1845 and will only suggest features for the corresponding context. Like disabling a
1846 feature will only bring up all enabled features.
1848 # icinga2 feature disable <tab>
1849 checker --color --define --help --include --library --log-level mainlog notification --version
1851 # icinga2 feature enable <tab>
1852 api command debuglog graphite icingastatus ido-pgsql --library --log-level statusdata --version
1853 --color compatlog --define --help ido-mysql --include livestatus perfdata syslog
1855 #### <a id="cli-command-node"></a> Cli command: Node
1857 Provides the functionality to install and manage master and client
1858 nodes in a [remote monitoring ](#icinga2-remote-client-monitoring) or
1859 [distributed cluster](#distributed-monitoring-high-availability) scenario.
1862 # icinga2 node --help
1863 icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
1866 icinga2 <command> [<arguments>]
1869 * node add (add node)
1870 * node blacklist add (adds a new blacklist filter)
1871 * node blacklist list (lists all blacklist filters)
1872 * node blacklist remove (removes a blacklist filter)
1873 * node list (lists all nodes)
1874 * node remove (removes node)
1875 * node set (set node attributes)
1876 * node setup (set up node)
1877 * node update-config (update node config)
1878 * node whitelist add (adds a new whitelist filter)
1879 * node whitelist list (lists all whitelist filters)
1880 * node whitelist remove (removes a whitelist filter)
1881 * node wizard (wizard for node setup)
1884 -h [ --help ] show this help message
1885 -V [ --version ] show version information
1886 --color use VT100 color codes even when stdout is not a
1888 -D [ --define ] arg define a constant
1889 -l [ --library ] arg load a library
1890 -I [ --include ] arg add include search directory
1891 -x [ --log-level ] arg specify the log level for the console log
1895 Report bugs at <https://dev.icinga.org/>
1896 Icinga home page: <http://www.icinga.org/>
1899 #### <a id="cli-command-object"></a> Cli command: Object
1901 The `object` cli command can be used to list all configuration objects and their
1902 attributes. The command also shows where each of the attributes was modified.
1903 That way you can also identify which objects have been created from your [apply rules](#apply).
1905 More information can be found in the [troubleshooting](#list-configuration-objects) section.
1907 # icinga2 object --help
1908 icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
1911 icinga2 <command> [<arguments>]
1914 * object list (lists all objects)
1917 -h [ --help ] show this help message
1918 -V [ --version ] show version information
1919 --color use VT100 color codes even when stdout is not a
1921 -D [ --define ] arg define a constant
1922 -l [ --library ] arg load a library
1923 -I [ --include ] arg add include search directory
1924 -x [ --log-level ] arg specify the log level for the console log
1928 Report bugs at <https://dev.icinga.org/>
1929 Icinga home page: <http://www.icinga.org/>
1933 #### <a id="cli-command-pki"></a> Cli command: Pki
1935 Provides the cli commands to
1937 * generate a new local CA
1938 * generate a new CSR or self-signed certificate
1939 * sign a CSR and return a certificate
1940 * save a master certificate manually
1941 * request a signed certificate from the master
1942 * generate a new ticket for the client setup
1944 This functionality is used by the [node setup/wizard](#cli-command-pki) cli commands too.
1946 # icinga2 pki --help
1947 icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
1950 icinga2 <command> [<arguments>]
1953 * pki new-ca (sets up a new CA)
1954 * pki new-cert (creates a new CSR)
1955 * pki request (requests a certificate)
1956 * pki save-cert (saves another Icinga 2 instance's certificate)
1957 * pki sign-csr (signs a CSR)
1958 * pki ticket (generates a ticket)
1961 -h [ --help ] show this help message
1962 -V [ --version ] show version information
1963 --color use VT100 color codes even when stdout is not a
1965 -D [ --define ] arg define a constant
1966 -l [ --library ] arg load a library
1967 -I [ --include ] arg add include search directory
1968 -x [ --log-level ] arg specify the log level for the console log
1972 Report bugs at <https://dev.icinga.org/>
1973 Icinga home page: <http://www.icinga.org/>
1976 #### <a id="cli-command-repository"></a> Cli command: Repository
1978 Provides the functionality to manage the Icinga 2 configuration repository in
1979 `/etc/icinga2/repository.d`. All changes are logged and must be committed or
1980 cleared after review.
1985 > The cli command `repository` only supports basic configuration manipulation (add, remove)
1986 > and a limited set of objects required for the [remote client] integration. Future
1987 > versions will support more options (set, etc.).
1989 > Please check the Icinga 2 development roadmap for updates.
1992 # icinga2 repository --help
1993 icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
1996 icinga2 <command> [<arguments>]
1999 * repository clear-changes (clear uncommitted repository changes)
2000 * repository commit (commit repository changes)
2001 * repository endpoint add (adds a new Endpoint object)
2002 * repository endpoint list (lists all Endpoint objects)
2003 * repository endpoint remove (removes a Endpoint object)
2004 * repository host add (adds a new Host object)
2005 * repository host list (lists all Host objects)
2006 * repository host remove (removes a Host object)
2007 * repository service add (adds a new Service object)
2008 * repository service list (lists all Service objects)
2009 * repository service remove (removes a Service object)
2010 * repository zone add (adds a new Zone object)
2011 * repository zone list (lists all Zone objects)
2012 * repository zone remove (removes a Zone object)
2015 -h [ --help ] show this help message
2016 -V [ --version ] show version information
2017 --color use VT100 color codes even when stdout is not a
2019 -D [ --define ] arg define a constant
2020 -l [ --library ] arg load a library
2021 -I [ --include ] arg add include search directory
2022 -x [ --log-level ] arg specify the log level for the console log
2026 Report bugs at <https://dev.icinga.org/>
2027 Icinga home page: <http://www.icinga.org/>
2031 #### <a id="cli-command-variable"></a> Cli command: Variable
2033 Lists all configured variables (constants) in a similar fasion like [object list](#cli-command-object).
2035 # icinga2 variable --help
2036 icinga2 - The Icinga 2 network monitoring daemon (version: v2.1.1-299-gf695275)
2039 icinga2 <command> [<arguments>]
2042 * variable get (gets a variable)
2043 * variable list (lists all variables)
2046 -h [ --help ] show this help message
2047 -V [ --version ] show version information
2048 --color use VT100 color codes even when stdout is not a
2050 -D [ --define ] arg define a constant
2051 -l [ --library ] arg load a library
2052 -I [ --include ] arg add include search directory
2053 -x [ --log-level ] arg specify the log level for the console log
2057 Report bugs at <https://dev.icinga.org/>
2058 Icinga home page: <http://www.icinga.org/>
2064 ### <a id="features"></a> Enabling/Disabling Features
2066 Icinga 2 provides configuration files for some commonly used features. These
2067 are installed in the `/etc/icinga2/features-available` directory and can be
2068 enabled and disabled using the `icinga2 feature enable` and `icinga2 feature disable`
2069 [cli commands](#cli-command-feature), respectively.
2071 The `icinga2 feature enable` cli command creates symlinks in the
2072 `/etc/icinga2/features-enabled` directory which is included by default
2073 in the example configuration file.
2075 You can view a list of enabled and disabled features:
2077 # icinga2 feature list
2078 Disabled features: api command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus notification perfdata statusdata syslog
2079 Enabled features: checker mainlog notification
2081 Using the `icinga2 feature enable` command you can enable features:
2083 # icinga2 feature enable graphite
2084 Enabling feature graphite. Make sure to restart Icinga 2 for these changes to take effect.
2087 You can disable features using the `icinga2 feature disable` command:
2089 # icinga2 feature disable ido-mysql livestatus
2090 Disabling feature ido-mysql. Make sure to restart Icinga 2 for these changes to take effect.
2091 Disabling feature livestatus. Make sure to restart Icinga 2 for these changes to take effect.
2094 The `icinga2 feature enable` and `icinga2 feature disable` commands do not
2095 restart Icinga 2. You will need to restart Icinga 2 using the init script
2096 after enabling or disabling features.
2100 ### <a id="config-validation"></a> Configuration Validation
2102 Once you've edited the configuration files make sure to tell Icinga 2 to validate
2103 the configuration changes. Icinga 2 will log any configuration error including
2104 a hint on the file, the line number and the affected configuration line itself.
2106 The following example creates an apply rule without any `assign` condition.
2108 apply Service "5872-ping4" {
2109 import "generic-service"
2110 check_command = "ping4"
2111 //assign where match("5872-*", host.name)
2114 Validate the configuration with the init script option `checkconfig`:
2116 # /etc/init.d/icinga2 checkconfig
2120 > Using [Systemd](#systemd-service) you need to manually validate the configuration using
2121 > the cli command below.
2123 Or manually passing the `-C` argument:
2125 # /usr/sbin/icinga2 daemon -c /etc/icinga2/icinga2.conf -C
2127 [2014-05-22 17:07:25 +0200] critical/ConfigItem: Location:
2128 /etc/icinga2/conf.d/tests/5872.conf(5): }
2129 /etc/icinga2/conf.d/tests/5872.conf(6):
2130 /etc/icinga2/conf.d/tests/5872.conf(7): apply Service "5872-ping4" {
2132 /etc/icinga2/conf.d/tests/5872.conf(8): import "test-generic-service"
2133 /etc/icinga2/conf.d/tests/5872.conf(9): check_command = "ping4"
2135 Config error: 'apply' is missing 'assign'
2136 [2014-05-22 17:07:25 +0200] critical/ConfigItem: 1 errors, 0 warnings.
2137 Icinga 2 detected configuration errors.
2141 > Icinga 2 will automatically detect the default path for `icinga2.conf`
2142 > in `SysconfDir + /icinga2/icinga2.conf` and you can safely omit this parameter.
2144 > `# icinga2 daemon -C`
2146 If you encouter errors during configuration validation, please make sure
2147 to read the [troubleshooting](#troubleshooting) chapter.
2149 You can also use the [cli command](#cli-command-object) `icinga2 object list`
2150 after validation passes to analyze object attributes, inheritance or created
2151 objects by apply rules.
2152 Find more on troubleshooting with `object list` in [this chapter](#list-configuration-objects).
2154 Example filtered by `Service` objects with the name `ping*`:
2156 # icinga2 object list --type Service --name *ping*
2157 Object 'nbmif.int.netways.de!ping4' of type 'Service':
2158 * __name = 'nbmif.int.netways.de!ping4'
2159 * check_command = 'ping4'
2160 % = modified in '/etc/icinga2/conf.d/services.conf', lines 17:3-17:25
2161 * check_interval = 60
2162 % = modified in '/etc/icinga2/conf.d/templates.conf', lines 28:3-28:21
2163 * host_name = 'nbmif.int.netways.de'
2164 % = modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21
2165 * max_check_attempts = 3
2166 % = modified in '/etc/icinga2/conf.d/templates.conf', lines 27:3-27:24
2168 % = modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21
2169 * retry_interval = 30
2170 % = modified in '/etc/icinga2/conf.d/templates.conf', lines 29:3-29:22
2171 * templates = [ 'ping4', 'generic-service' ]
2172 % += modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21
2173 % += modified in '/etc/icinga2/conf.d/templates.conf', lines 26:1-30:1
2176 % += modified in '/etc/icinga2/conf.d/services.conf', lines 18:3-18:19
2178 % = modified in '/etc/icinga2/conf.d/services.conf', lines 18:3-18:19
2182 ### <a id="config-change-reload"></a> Reload on Configuration Changes
2184 Everytime you have changed your configuration you should first tell Icinga 2
2185 to [validate](#config-validation). If there are no validation errors you can
2186 safely reload the Icinga 2 daemon.
2188 # /etc/init.d/icinga2 reload
2192 > The `reload` action will send the `SIGHUP` signal to the Icinga 2 daemon
2193 > which will validate the configuration in a separate process and not stop
2194 > the other events like check execution, notifications, etc.
2196 > Details can be found [here](#differences-1x-2-real-reload).
2199 ## <a id="vagrant"></a> Vagrant Demo VM
2201 The Icinga Vagrant Git repository contains support for [Vagrant](http://docs.vagrantup.com/v2/)
2202 with VirtualBox. Please note that Vagrant version `1.0.x` is not supported. At least
2203 version `1.2.x` is required.
2205 In order to build the Vagrant VM first you will have to check out
2208 $ git clone git://git.icinga.org/icinga-vagrant.git
2210 For Icinga 2 there are currently two scenarios available:
2212 * `icinga2x` bringing up a standalone box with Icinga 2
2213 * `icinga2x-cluster` setting up two virtual machines in a master/slave cluster
2217 > Please consult the `README.md` file for each project for further installation
2218 > details at [https://github.com/Icinga/icinga-vagrant]
2220 Once you have checked out the Git repository navigate to your required
2221 vagrant box and build the VM using the following command:
2225 The Vagrant VMs are based on CentOS 6.x and are using the official
2226 Icinga 2 RPM snapshot packages from `packages.icinga.org`. The check
2227 plugins are installed from EPEL providing RPMs with sources from the
2228 Monitoring Plugins project.