2013-10-18 00:11:35 +02:00
|
|
|
# <a id="differences-1x-2"></a> Differences between Icinga 1.x and 2
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-configuration-format"></a> Configuration Format
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
Icinga 1.x supports two configuration formats: key-value-based settings in the
|
2013-10-18 00:27:04 +02:00
|
|
|
`icinga.cfg` configuration file and object-based in included files (`cfg_dir`,
|
2013-10-10 11:22:32 +02:00
|
|
|
`cfg_file`). The path to the `icinga.cfg` configuration file must be passed to
|
|
|
|
the Icinga daemon at startup.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
enable_notifications=1
|
|
|
|
|
|
|
|
define service {
|
2013-10-11 18:13:28 +02:00
|
|
|
notifications_enabled 0
|
2013-10-10 08:52:58 +02:00
|
|
|
}
|
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
Icinga 2 supports objects and (global) variables, but does not make a difference
|
|
|
|
if it's the main configuration file, or any included file.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-07 21:30:27 +02:00
|
|
|
const EnableNotifications = true
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
object Service "test" {
|
2014-03-31 18:38:15 +02:00
|
|
|
enable_notifications = 0
|
2013-10-10 08:52:58 +02:00
|
|
|
}
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-sample-configuration-itl"></a> Sample Configuration and ITL
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
While Icinga 1.x ships sample configuration and templates spread in various
|
|
|
|
object files Icinga 2 moves all templates into the Icinga Template Library (ITL)
|
|
|
|
and includes that in the sample configuration.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 19:05:49 +02:00
|
|
|
The ITL will be updated on every release and should not be edited by the user.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-03-18 18:10:01 +01:00
|
|
|
There are still generic templates available for your convenience which may or may
|
|
|
|
not be re-used in your configuration. For instance, `generic-service` includes
|
|
|
|
all required attributes except `check_command` for an inline service.
|
|
|
|
|
2014-04-06 21:15:25 +02:00
|
|
|
Sample configuration files are located in the `conf.d/` directory which is
|
|
|
|
included in `icinga2.conf` by default.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-include-files-dirs"></a> Include Files and Directories
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
In Icinga 1.x the `icinga.cfg` file contains `cfg_file` and `cfg_dir`
|
|
|
|
directives. The `cfg_dir` directive recursively includes all files with a `.cfg`
|
2013-10-10 11:22:32 +02:00
|
|
|
suffix in the given directory. Only absolute paths may be used. The `cfg_file`
|
|
|
|
and `cfg_dir` directives can include the same file twice which leads to
|
|
|
|
configuration errors in Icinga 1.x.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
cfg_file=/etc/icinga/objects/commands.cfg
|
|
|
|
cfg_dir=/etc/icinga/objects
|
|
|
|
|
|
|
|
Icinga 2 supports wildcard includes and relative paths, e.g. for including
|
2014-03-18 18:10:01 +01:00
|
|
|
`conf.d/*.conf` in the same directory.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
include "conf.d/*.conf"
|
2014-03-18 18:10:01 +01:00
|
|
|
|
|
|
|
If you want to include files and directories recursively, you need to define
|
2014-03-18 20:52:52 +01:00
|
|
|
a separate option and add the directory and an option pattern.
|
2014-03-18 18:10:01 +01:00
|
|
|
|
|
|
|
include_recursive "conf.d" "*.conf"
|
|
|
|
|
|
|
|
A global search path for includes is available for advanced features like
|
|
|
|
the Icinga Template Library (ITL). The file suffix does not matter as long
|
|
|
|
as it matches the (wildcard) include expression.
|
|
|
|
|
2013-10-10 08:52:58 +02:00
|
|
|
include <itl/itl.conf>
|
|
|
|
|
2014-04-06 21:15:25 +02:00
|
|
|
By convention the `.conf` suffix is used for Icinga 2 configuration files.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-resource-file-global-macros"></a> Resource File and Global Macros
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
Global macros such as for the plugin directory, usernames and passwords can be
|
|
|
|
set in the `resource.cfg` configuration file in Icinga 1.x. By convention the
|
|
|
|
`USER1` macro is used to define the directory for the plugins.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-03-31 13:27:39 +02:00
|
|
|
Icinga 2 uses global constants instead. In the default config these are
|
|
|
|
set in the `constants.conf` configuration file:
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
/**
|
2014-03-31 13:27:39 +02:00
|
|
|
* This file defines global constants which can be used in
|
|
|
|
* the other configuration files. At a minimum the
|
|
|
|
* PluginDir constant should be defined.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const PluginDir = "/usr/lib/nagios/plugins"
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-06 21:15:25 +02:00
|
|
|
[Global macros](#global-constants) can only be defined once. Trying to modify a
|
|
|
|
global constant will result in an error.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-comments"></a> Comments
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
In Icinga 1.x comments are made using a leading hash (`#`) or a semi-colon (`;`)
|
|
|
|
for inline comments.
|
2013-10-10 09:40:50 +02:00
|
|
|
|
2013-10-10 08:52:58 +02:00
|
|
|
In Icinga 2 comments can either be encapsulated by `/*` and `*/` (allowing for
|
|
|
|
multi-line comments) or starting with two slashes (`//`).
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-object-names"></a> Object names
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
Object names must not contain a colon (`!`). Use the `display_name` attribute
|
2013-10-10 08:52:58 +02:00
|
|
|
to specify user-friendly names which should be shown in UIs (supported by
|
|
|
|
Icinga 1.x Classic UI and Web).
|
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
Object names are not specified using attributes (e.g. `service_description` for
|
2013-10-10 19:05:49 +02:00
|
|
|
services) like in Icinga 1.x but directly after their type definition.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
define service {
|
|
|
|
host_name localhost
|
|
|
|
service_description ping4
|
|
|
|
}
|
|
|
|
|
2014-04-05 14:53:12 +02:00
|
|
|
object Service "ping4" {
|
|
|
|
host_name = "localhost"
|
|
|
|
}
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-templates"></a> Templates
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
In Icinga 1.x templates are identified using the `register 0` setting. Icinga 2
|
|
|
|
uses the `template` identifier:
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
template Service "ping4-template" { }
|
|
|
|
|
|
|
|
Icinga 1.x objects inherit from templates using the `use` attribute.
|
2014-03-27 12:30:24 +01:00
|
|
|
Icinga 2 uses the keyword `import` with template names in double quotes.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
define service {
|
|
|
|
service_description testservice
|
|
|
|
use tmpl1,tmpl2,tmpl3
|
|
|
|
}
|
|
|
|
|
2014-03-27 12:30:24 +01:00
|
|
|
object Service "testservice" {
|
2014-03-31 18:38:15 +02:00
|
|
|
import "tmpl1"
|
|
|
|
import "tmpl2"
|
2014-03-27 12:30:24 +01:00
|
|
|
import "tmpl3"
|
2013-10-10 08:52:58 +02:00
|
|
|
}
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-object-attributes"></a> Object attributes
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
Icinga 1.x separates attribute and value with whitespaces/tabs. Icinga 2
|
|
|
|
requires an equal sign (=) between them.
|
|
|
|
|
|
|
|
define service {
|
|
|
|
check_interval 5
|
|
|
|
}
|
|
|
|
|
|
|
|
object Service "test" {
|
2014-03-31 18:38:15 +02:00
|
|
|
check_interval = 5m
|
2013-10-10 08:52:58 +02:00
|
|
|
}
|
|
|
|
|
2014-04-06 21:15:25 +02:00
|
|
|
Please note that the default time value is seconds, if no duration literal
|
|
|
|
is given. `check_interval = 5` behaves the same as `check_interval = 5s`.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
All strings require double quotes in Icinga 2. Therefore a double-quote
|
|
|
|
must be escaped with a backslash (e.g. in command line).
|
|
|
|
If an attribute identifier starts with a number, it must be encapsulated
|
|
|
|
with double quotes as well.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-alias-display-name"></a> Alias vs. Display Name
|
2013-10-10 19:05:49 +02:00
|
|
|
|
|
|
|
In Icinga 1.x a host can have an `alias` and a `display_name` attribute used
|
|
|
|
for a more descriptive name. A service only can have a `display_name` attribute.
|
|
|
|
The `alias` is used for group, timeperiod, etc. objects too.
|
|
|
|
Icinga 2 only supports the `display_name` attribute which is also taken into
|
|
|
|
account by Icinga 1.x Classic UI and Web.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-custom-attributes"></a> Custom Attributes
|
2013-10-10 19:05:49 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
Icinga 2 allows you to define custom attributes in the `vars` dictionary.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-action-url-notes-url-notes"></a> Action Url, Notes Url, Notes
|
2013-10-10 19:05:49 +02:00
|
|
|
|
|
|
|
Icinga 1.x objects support configuration attributes not required as runtime
|
2014-03-09 22:30:56 +01:00
|
|
|
values but for external resources such as Icinga 1.x Classic UI or Web.
|
2013-10-10 19:05:49 +02:00
|
|
|
The `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`
|
|
|
|
attributes for host and service objects, additionally `statusmap_image` and
|
|
|
|
`2d_coords` for the host's representation in status maps.
|
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
These attributes can be set using the `vars` dictionary in Icinga 2 `Host`
|
2013-10-10 19:05:49 +02:00
|
|
|
or `Service` objects:
|
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
vars = {
|
2014-03-31 18:38:15 +02:00
|
|
|
notes = "Icinga 2 is the best!"
|
|
|
|
notes_url = "http://docs.icinga.org"
|
|
|
|
action_url = "http://dev.icinga.org"
|
|
|
|
icon_image = "../../images/logos/Stats2.png"
|
|
|
|
icon_image_alt = "icinga2 alt icon text"
|
|
|
|
"2d_coords" = "1,2"
|
|
|
|
statusmap_image = "../../images/logos/icinga.gif"
|
2013-10-10 19:05:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
External interfaces will recognize and display these attributes accordingly.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-custom-variables"></a> Custom Variables
|
2013-10-10 19:05:49 +02:00
|
|
|
|
|
|
|
Icinga 1.x custom variable attributes must be prefixed using an underscore (`_`).
|
2014-04-04 18:41:54 +02:00
|
|
|
In Icinga 2 these attributes must be added to the `vars` dictionary as custom attributes.
|
2013-10-10 19:05:49 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
vars = {
|
2014-03-31 18:38:15 +02:00
|
|
|
DN = "cn=icinga2-dev-host,ou=icinga,ou=main,ou=IcingaConfig,ou=LConf,dc=icinga,dc=org"
|
|
|
|
CV = "my custom cmdb description"
|
2013-10-10 19:05:49 +02:00
|
|
|
}
|
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
TODO
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-host-service-relation"></a> Host Service Relation
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
In Icinga 1.x a service object is associated with a host by defining the
|
2013-10-10 19:05:49 +02:00
|
|
|
`host_name` attribute in the service definition. Alternate methods refer
|
2013-10-10 14:24:19 +02:00
|
|
|
to `hostgroup_name` or behavior changing regular expression. It's not possible
|
2013-10-10 11:22:32 +02:00
|
|
|
to define a service definition within a host definition.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-03-29 01:13:28 +01:00
|
|
|
The preferred way of associating hosts with services in Icinga 2 is by
|
|
|
|
using the `apply` keyword.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-users"></a> Users
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
Contacts have been renamed to Users (same for groups). A user does not
|
2014-04-04 18:41:54 +02:00
|
|
|
only provide attributes and custom attributes used for notifications, but is also
|
2013-10-10 08:52:58 +02:00
|
|
|
used for authorization checks.
|
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
In Icinga 2 notification commands are not directly associated with users.
|
|
|
|
Instead the notification command is specified using `Notification` objects.
|
2013-10-10 09:40:50 +02:00
|
|
|
|
|
|
|
The `StatusDataWriter`, `IdoMySqlConnection` and `LivestatusListener` types will
|
|
|
|
provide the contact and contactgroups attributes for services for compatibility
|
2013-10-10 08:52:58 +02:00
|
|
|
reasons. These values are calculated from all services, their notifications,
|
|
|
|
and their users.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-macros"></a> Macros
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
TODO
|
2013-10-10 19:05:49 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
Various object attributes and runtime variables can be accessed as macros in
|
|
|
|
commands in Icinga 1.x - Icinga 2 supports all required [custom attributes](#custom-attributes).
|
2013-10-10 19:05:49 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
### <a id="differences-1x-2-command-arguments"></a> Command Arguments
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
If you have previously used Icinga 1.x you may already be familiar with
|
2014-04-04 18:41:54 +02:00
|
|
|
user and argument definitions (e.g., `USER1` or `ARG1`). Unlike in Icinga 1.x
|
|
|
|
the Icinga 2 custom attributes may have arbitrary names and arguments are no
|
|
|
|
longer specified in the `check_command` setting.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
In Icinga 1.x arguments are specified in the `check_command` attribute and
|
2013-10-10 09:40:50 +02:00
|
|
|
are separated from the command name using an exclamation mark (`!`).
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
define command {
|
|
|
|
command_name ping4
|
2014-04-04 21:46:49 +02:00
|
|
|
command_line $USER1$/check_ping -H $address$ -w $ARG1$ -c $ARG2$ -p 5
|
2013-10-10 08:52:58 +02:00
|
|
|
}
|
|
|
|
|
2013-10-10 19:05:49 +02:00
|
|
|
define service {
|
2013-10-10 08:52:58 +02:00
|
|
|
use local-service
|
|
|
|
host_name localhost
|
|
|
|
service_description PING
|
2013-10-10 19:05:49 +02:00
|
|
|
check_command ping4!100.0,20%!500.0,60%
|
2013-10-10 08:52:58 +02:00
|
|
|
}
|
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
With the freely definable custom attributes in Icinga 2 it looks like this:
|
2013-10-10 19:05:49 +02:00
|
|
|
|
|
|
|
object CheckCommand "ping4" {
|
2014-04-04 21:46:49 +02:00
|
|
|
command = PluginDir + "/check_ping -H $address$ -w $wrta$,$wpl%$ -c $crta$,$cpl%$"
|
2013-10-10 19:05:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
object Service "PING" {
|
2014-03-31 18:38:15 +02:00
|
|
|
check_command = "ping4"
|
2014-04-04 18:41:54 +02:00
|
|
|
vars.wrta = 100
|
|
|
|
vars.wpl = 20
|
|
|
|
vars.crta = 500
|
|
|
|
vars.cpl = 60
|
2013-10-10 19:05:49 +02:00
|
|
|
}
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-environment-macros"></a> Environment Macros
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
TODO
|
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
The global configuration setting `enable_environment_macros` does not exist in
|
2013-10-10 08:52:58 +02:00
|
|
|
Icinga 2.
|
2013-10-10 09:40:50 +02:00
|
|
|
|
2014-04-07 14:31:30 +02:00
|
|
|
Macros exported into the environment must be set using the `env`
|
2013-10-10 14:24:19 +02:00
|
|
|
attribute in command objects.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-04 19:35:47 +02:00
|
|
|
### <a id="differences-1x-2-runtime-macros"></a> Runtime Macros
|
|
|
|
|
|
|
|
Icinga 2 requires an object specific namespace when accessing configuration
|
|
|
|
and stateful runtime macros. Custom attributes can be access directly.
|
|
|
|
|
2014-04-04 20:09:23 +02:00
|
|
|
Changes to host runtime macros
|
|
|
|
|
|
|
|
Icinga 1.x | Icinga 2
|
|
|
|
-----------------------|----------------------
|
2014-04-04 21:36:47 +02:00
|
|
|
USERNAME | user.name
|
|
|
|
USERDISPLAYNAME | user.displayname
|
|
|
|
USEREMAIL | email if set as `email` custom attribute.
|
|
|
|
USERPAGER | pager if set as `pager` custom attribute.
|
|
|
|
|
2014-04-04 20:09:23 +02:00
|
|
|
|
|
|
|
Changes to service runtime macros
|
|
|
|
|
|
|
|
Icinga 1.x | Icinga 2
|
|
|
|
-----------------------|----------------------
|
|
|
|
SERVICEDESC | service.description
|
|
|
|
SERVICEDISPLAYNAME | service.displayname
|
|
|
|
SERVICECHECKCOMMAND | service.checkcommand
|
|
|
|
SERVICESTATE | service.state
|
|
|
|
SERVICESTATEID | service.stateid
|
|
|
|
SERVICESTATETYPE | service.statetype
|
|
|
|
SERVICEATTEMPT | service.attempt
|
|
|
|
MAXSERVICEATTEMPT | service.maxattempt
|
|
|
|
LASTSERVICESTATE | service.laststate
|
|
|
|
LASTSERVICESTATEID | service.laststateid
|
|
|
|
LASTSERVICESTATETYPE | service.laststatetype
|
|
|
|
LASTSERVICESTATECHANGE | service.laststatechange
|
|
|
|
SERVICEDURATIONSEC | service.durationsec
|
|
|
|
SERVICELATENCY | service.latency
|
|
|
|
SERVICEEXECUTIONTIME | service.executiontime
|
|
|
|
SERVICEOUTPUT | service.output
|
|
|
|
SERVICEPERFDATA | service.perfdata
|
|
|
|
LASTSERVICECHECK | service.lastcheck
|
|
|
|
|
|
|
|
|
|
|
|
Changes to user (contact) runtime macros
|
|
|
|
|
|
|
|
Icinga 1.x | Icinga 2
|
|
|
|
-----------------------|----------------------
|
|
|
|
HOSTNAME | host.name
|
|
|
|
HOSTDISPLAYNAME | host.displayname
|
|
|
|
HOSTALIAS | ..
|
|
|
|
HOSTSTATE | host.state
|
|
|
|
HOSTSTATEID | host.stateid
|
|
|
|
HOSTSTATETYPE | host.statetype
|
|
|
|
HOSTATTEMPT | host.attempt
|
|
|
|
MAXHOSTATTEMPT | host.maxattempt
|
|
|
|
LASTHOSTSTATE | host.laststate
|
|
|
|
LASTHOSTSTATEID | host.laststateid
|
|
|
|
LASTHOSTSTATETYPE | host.laststatetype
|
|
|
|
LASTHOSTSTATECHANGE | host.laststatechange
|
|
|
|
HOSTDURATIONSEC | host.durationsec
|
|
|
|
HOSTLATENCY | host.latency
|
|
|
|
HOSTEXECUTIONTIME | host.executiontime
|
|
|
|
HOSTOUTPUT | host.output
|
|
|
|
HOSTPERFDATA | host.perfdata
|
|
|
|
LASTHOSTCHECK | host.lastcheck
|
|
|
|
HOSTADDRESS | --
|
|
|
|
HOSTADDRESS6 | --
|
|
|
|
|
2014-04-04 19:35:47 +02:00
|
|
|
Changes to global runtime macros:
|
|
|
|
|
|
|
|
Icinga 1.x | Icinga 2
|
|
|
|
-----------------------|----------------------
|
|
|
|
TIMET | icinga.timet
|
|
|
|
LONGDATETIME | icinga.longdatetime
|
|
|
|
SHORTDATETIME | icinga.shortdatetime
|
|
|
|
DATE | icinga.date
|
|
|
|
TIME | icinga.time
|
|
|
|
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-checks"></a> Checks
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-check-output"></a> Check Output
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
Icinga 2 does not make a difference between `output` (first line) and
|
|
|
|
`long_output` (remaining lines) like in Icinga 1.x. Performance Data is
|
|
|
|
provided separately.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
The `StatusDataWriter`, `IdoMysqlConnection` and `LivestatusListener` types
|
|
|
|
split the raw output into `output` (first line) and `long_output` (remaining
|
|
|
|
lines) for compatibility reasons.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-initial-state"></a> Initial State
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
Icinga 1.x uses the `max_service_check_spread` setting to specify a timerange
|
|
|
|
where the initial state checks must have happened. Icinga 2 will use the
|
|
|
|
`retry_interval` setting instead and `check_interval` divided by 5 if
|
|
|
|
`retry_interval` is not defined.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-commands"></a> Commands
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
Unlike in Icinga 1.x there are 3 different command types in Icinga 2:
|
|
|
|
`CheckCommand`, `NotificationCommand` and EventCommand`.
|
|
|
|
|
|
|
|
For example in Icinga 1.x it is possible to accidently use a notification
|
|
|
|
command as an event handler which might cause problems depending on which
|
2014-04-04 18:41:54 +02:00
|
|
|
runtime macros are used in the notification command.
|
2013-10-10 09:40:50 +02:00
|
|
|
|
|
|
|
In Icinga 2 these command types are separated and will generate an error on
|
|
|
|
configuration validation if used in the wrong context.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
While Icinga 2 still supports the complete command line in command objects, it's
|
2013-10-10 14:24:19 +02:00
|
|
|
also possible to encapsulate all arguments into double quotes and passing them
|
|
|
|
as array to the `command_line` attribute i.e. for better readability.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
It's also possible to define default custom attributes for the command itself which can be
|
2013-10-10 14:24:19 +02:00
|
|
|
overridden by a service macro.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-groups"></a> Groups
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
In Icinga 2 hosts, services and users are added to groups using the `groups`
|
|
|
|
attribute in the object. The old way of listing all group members in the group's
|
|
|
|
`members` attribute is not supported.
|
|
|
|
|
|
|
|
The preferred way of assigning objects to groups is by using a template:
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
template Host "dev-host" {
|
2014-03-31 18:38:15 +02:00
|
|
|
groups += [ "dev-hosts" ]
|
2013-10-10 14:24:19 +02:00
|
|
|
}
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-03-27 12:30:24 +01:00
|
|
|
object Host "web-dev" {
|
|
|
|
import "dev-host"
|
|
|
|
}
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-03-29 01:13:28 +01:00
|
|
|
In order to associate a service with all hosts in a host group the `apply`
|
|
|
|
keyword can be used:
|
|
|
|
|
|
|
|
apply Service "ping" {
|
2014-03-31 18:38:15 +02:00
|
|
|
import "generic-service"
|
2014-03-29 01:13:28 +01:00
|
|
|
|
2014-03-31 18:38:15 +02:00
|
|
|
check_command = "ping4"
|
2014-03-29 01:13:28 +01:00
|
|
|
|
|
|
|
assign where "group" in host.groups
|
|
|
|
}
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-notifications"></a> Notifications
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
Notifications are a new object type in Icinga 2. Imagine the following
|
|
|
|
notification configuration problem in Icinga 1.x:
|
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
* Service A should notify contact X via SMS
|
|
|
|
* Service B should notify contact X via Mail
|
|
|
|
* Service C should notify contact Y via Mail and SMS
|
|
|
|
* Contact X and Y should also be used for authorization (e.g. in Classic UI)
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
The only way achieving a semi-clean solution is to
|
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
* Create contact X-sms, set service_notification_command for sms, assign contact
|
|
|
|
to service A
|
|
|
|
* Create contact X-mail, set service_notification_command for mail, assign
|
|
|
|
contact to service B
|
|
|
|
* Create contact Y, set service_notification_command for sms and mail, assign
|
|
|
|
contact to service C
|
2013-10-10 11:22:32 +02:00
|
|
|
* Create contact X without notification commands, assign to service A and B
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
Basically you are required to create duplicated contacts for either each
|
|
|
|
notification method or used for authorization only.
|
|
|
|
|
|
|
|
Icinga 2 attempts to solve that problem in this way
|
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
* Create user X, set SMS and Mail attributes, used for authorization
|
|
|
|
* Create user Y, set SMS and Mail attributes, used for authorization
|
2014-04-09 10:25:23 +02:00
|
|
|
* Create notification A-SMS, set command for sms, add user X,
|
2013-10-10 14:24:19 +02:00
|
|
|
assign notification A-SMS to service A
|
2014-04-09 10:25:23 +02:00
|
|
|
* Create notification B-Mail, set command for mail, add user X,
|
2013-10-10 14:24:19 +02:00
|
|
|
assign notification Mail to service B
|
2014-04-09 10:25:23 +02:00
|
|
|
* Create notification C-SMS, set command for sms, add user Y,
|
2013-10-10 14:24:19 +02:00
|
|
|
assign notification C-SMS to service C
|
2014-04-09 10:25:23 +02:00
|
|
|
* Create notification C-Mail, set command for mail, add user Y,
|
2013-10-10 14:24:19 +02:00
|
|
|
assign notification C-Mail to service C
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
Previously in Icinga 1.x it looked like this:
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
service -> (contact, contactgroup) -> notification command
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
In Icinga 2 it will look like this:
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 11:22:32 +02:00
|
|
|
Service -> Notification -> NotificationCommand
|
|
|
|
-> User, UserGroup
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-escalations"></a> Escalations
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
Escalations in Icinga 1.x require a separated object matching on existing
|
|
|
|
objects. Escalations happen between a defined start and end time which is
|
|
|
|
calculated from the notification_interval:
|
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
start = notification start + (notification_interval * first_notification)
|
|
|
|
end = notification start + (notification_interval * last_notification)
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
In theory first_notification and last_notification can be set to readable
|
|
|
|
numbers. In practice users are manipulating those attributes in combination
|
|
|
|
with notification_interval in order to get a start and end time.
|
|
|
|
|
|
|
|
In Icinga 2 the notification object can be used as notification escalation
|
|
|
|
if the start and end times are defined within the 'times' attribute using
|
|
|
|
duration literals (e.g. 30m).
|
|
|
|
|
|
|
|
The Icinga 2 escalation does not replace the current running notification.
|
|
|
|
In Icinga 1.x it's required to copy the contacts from the service notification
|
|
|
|
to the escalation to garantuee the normal notifications once an escalation
|
|
|
|
happens.
|
|
|
|
That's not necessary with Icinga 2 only requiring an additional notification
|
2013-10-10 09:40:50 +02:00
|
|
|
object for the escalation itself.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="differences-1x-2-notification-options"></a> Notification Options
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
TODO
|
|
|
|
|
2013-10-10 08:52:58 +02:00
|
|
|
Unlike Icinga 1.x with the 'notification_options' attribute with comma-separated
|
|
|
|
state and type filters, Icinga 2 uses two configuration attributes for that.
|
|
|
|
All state and type filter use long names or'd with a pipe together
|
|
|
|
|
|
|
|
notification_options w,u,c,r,f,s
|
|
|
|
|
2014-04-09 10:25:23 +02:00
|
|
|
states = [ Warning, Unknown, Critical ]
|
|
|
|
filters = [ Problem, Recovery, FlappingStart, FlappingEnd, DowntimeStart, DowntimeEnd, DowntimeRemoved ]
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
Icinga 2 adds more fine-grained type filters for acknowledgements, downtime
|
2013-10-10 08:52:58 +02:00
|
|
|
and flapping type (start, end, ...).
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-dependencies-parents"></a> Dependencies and Parents
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
In Icinga 1.x it's possible to define host parents to determine network reachability
|
|
|
|
and keep a host's state unreachable rather than down.
|
|
|
|
Furthermore there are host and service dependencies preventing unnecessary checks and
|
|
|
|
notifications. A host must not depend on a service, and vice versa. All dependencies
|
|
|
|
are configured as separate objects and cannot be set directly on the host or service
|
|
|
|
object.
|
|
|
|
|
|
|
|
Icinga 2 adds host and service dependencies as attribute directly onto the host or
|
|
|
|
service object or template. A service can now depend on a host, and vice versa. A
|
|
|
|
service has an implicit dependeny (parent) to its host. A host to host dependency acts
|
|
|
|
implicit as host parent relation.
|
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
The `StatusDataWriter`, `IdoMysqlConnection` and `LivestatusListener` types
|
|
|
|
support the Icinga 1.x schema with dependencies and parent attributes for
|
|
|
|
compatibility reasons.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-flapping"></a> Flapping
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 09:40:50 +02:00
|
|
|
The Icinga 1.x flapping detection uses the last 21 states of a service. This
|
2013-10-10 08:52:58 +02:00
|
|
|
value is hardcoded and cannot be changed. The algorithm on determining a flapping state
|
2013-10-10 14:24:19 +02:00
|
|
|
is as follows:
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
flapping value = (number of actual state changes / number of possible state changes)
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
The flapping value is then compared to the low and high flapping thresholds.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
The algorithm used in Icinga 2 does not store the past states but calculcates the flapping
|
2013-10-10 08:52:58 +02:00
|
|
|
threshold from a single value based on counters and half-life values. Icinga 2 compares
|
|
|
|
the value with a single flapping threshold configuration attribute.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-check-result-freshness"></a> Check Result Freshness
|
2013-10-11 13:25:56 +02:00
|
|
|
|
|
|
|
Freshness of check results must be explicitely enabled in Icinga 1.x. The attribute
|
|
|
|
`freshness_treshold` defines the threshold in seconds. Once the threshold is triggered, an
|
|
|
|
active freshness check is executed defined by the `check_command` attribute. Both check
|
|
|
|
methods (active and passive) use the same freshness check method.
|
|
|
|
|
|
|
|
In Icinga 2 active check freshness is determined by the `check_interval` attribute and no
|
|
|
|
incoming check results in that period of time (last check + check interval). Passive check
|
|
|
|
freshness is calculated from the `check_interval` attribute if set. There is no extra
|
|
|
|
`freshness_threshold` attribute in Icinga 2. If the freshness checks are invalid, a new
|
|
|
|
service check is forced.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-state-retention"></a> State Retention
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
Icinga 1.x uses the `retention.dat` file to save its state in order to be able
|
|
|
|
to reload it after a restart. In Icinga 2 this file is called `icinga2.state`.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
The format objects are stored in is not compatible with Icinga 1.x.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-logging"></a> Logging
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
Icinga 1.x supports syslog facilities and writes its own `icinga.log` log file
|
|
|
|
and archives. These logs are used in Icinga 1.x Classic UI to generate
|
|
|
|
historical reports.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
|
|
|
Icinga 2 compat library provides the CompatLogger object which writes the icinga.log and archive
|
|
|
|
in Icinga 1.x format in order to stay compatible with Classic UI and other addons.
|
|
|
|
The native Icinga 2 logging facilities are split into three configuration objects: SyslogLogger,
|
|
|
|
FileLogger, StreamLogger. Each of them got their own severity and target configuration.
|
|
|
|
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-broker-modules-features"></a> Broker Modules and Features
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
Icinga 1.x broker modules are incompatible with Icinga 2.
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
In order to provide compatibility with Icinga 1.x the functionality of several
|
|
|
|
popular broker modules was implemented for Icinga 2:
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
* IDOUtils
|
|
|
|
* Livestatus
|
|
|
|
* Cluster (allows for high availability and load balancing)
|
2013-10-10 08:52:58 +02:00
|
|
|
|
2013-10-10 14:24:19 +02:00
|
|
|
In Icinga 1.x broker modules may only be loaded once which means it is not easily possible
|
|
|
|
to have one Icinga instance write to multiple IDO databases. Due to the way
|
|
|
|
objects work in Icinga 2 it is possible to set up multiple IDO database instances.
|
2013-10-10 19:05:49 +02:00
|
|
|
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
## <a id="differences-1x-2-distributed-monitoring"></a> Distributed Monitoring
|
2013-10-10 19:05:49 +02:00
|
|
|
|
|
|
|
Icinga 1.x uses the native "obsess over host/service" method which requires the NSCA addon
|
|
|
|
passing the slave's checkresults passively onto the master's external command pipe.
|
|
|
|
While this method may be used for check load distribution, it does not provide any configuration
|
|
|
|
distribution out-of-the-box. Furthermore comments, downtimes and other stateful runtime data is
|
|
|
|
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, including config and check
|
|
|
|
distribution, IPv4/IPv6 support, SSL certificates and domain support for DMZ. High Availability
|
2014-03-18 18:10:01 +01:00
|
|
|
and load balancing are also part of the Icinga 2 [Cluster](#cluster) setup.
|
2014-04-06 21:15:25 +02:00
|
|
|
|