- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with icinga2
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Icinga2 is a widely used open source monitoring software. This Puppet module helps installing and managing configuration of Icinga2 on multiple operating sytems.
This Module is a rewrite of puppet-icinga2 and will replace it in the future.
This module installs and configures Icinga2 on your Linux or Windows hosts. By default it will use packages provided by your distributions repository, respectively chocolatey on Windows. The module can be enabled to use packages.icinga.org as primary repository, which will give you the ability to install the latest Icinga2 release. All features and objects available in Icinga2 can be enabled and configured with this module.
- Packages Installation
- Service
- Objects Configuration
- Feature Configuration
- Apply Rules
- MySQL/PostgreSQL Database Schema Import
- Repository Management
- Certification Authority
This module depends on:
Depending on your setup following modules may also be required:
The default class icinga2
will install and configure a basic installation of Icinga2 on your system. By default it will
enable the features checker
, mainlog
and notification
. As default installation source the distributions repository will
used. On Windows systems we use chocolatey. To get the latest version of Icinga2 you need to enable the manage_repo
parameter, which will allow the module to add the official packages.icinga.org repository to your host.
class { 'icinga2':
manage_repo => true
}
Each Icinga2 feature can be enabled or disabled by using the according classes. In addition to that, there is a set of
default features that are enabled by default: [ 'checker', 'mainlog', 'notification' ]
The default set of features can be changed by setting the features
parameter:
class { 'icinga2':
manage_repo => true,
features => ['checker', 'mainlog', 'command']
}
To add enable features and change their default settings, use the feature classes:
class { 'icinga2::feature::graphite':
host => '10.10.0.15',
port => 2003,
enable_send_thresholds => true,
enable_send_metadata => true
}
Sometimes it's necessary to cover very special configurations that you cannot handle with this module. In this case you
can use the icinga2::config::file
tag on your file ressource. This module collects all file ressource types with this
tag and triggers a reload of Icinga2 on a file change.
include icinga2
file { '/etc/icinga2/conf.d/for-loop.conf':
ensure => file,
tag => 'icinga2::config::file',
}
- Public classes
- Class: icinga2
- Class: icinga2::feature::checker
- Class: icinga2::feature::mainlog
- Class: icinga2::feature::notification
- Class: icinga2::feature::command
- Class: icinga2::feature::compatlog
- Class: icinga2::feature::graphite
- Class: icinga2::feature::livestatus
- Class: icinga2::feature::opentsdb
- Class: icinga2::feature::perfdata
- Class: icinga2::feature::statusdata
- Class: icinga2::feature::syslog
- Class::icinga2::feature::debuglog
- Class::icinga2::feature::gelf
- Private classes
- Public defined types
- Private defined types
The default class of this modoule. It handles the basic installation and configuration of Icinga2. When you declare this class, puppet will do the following:
- Install Icinga2
- Place a default configuration for the Icinga2 daemon
- Keep the default configuration of the Icinga2 package
- Start Icinga2 and enable the service
This class can be declared without adjusting any parameter:
class { 'icinga2': }
Parameters within icinga2
:
Defines if the service should be running
or stopped
. Default is running
If set to true
the Icinga2 service will start on boot. Default is true
.
When set to true
this module will install the packages.icinga.org repository. With this official repo
you can get the latest version of Icinga. When set to false
the operating systems default will be used. As the Icinga
Project does not offer a Chocolatey repository, you will get a warning if you enable this parameter on Windows. Default
is false
Lets you decide if the Icinga2 daemon should be reloaded when configuration files have changed. Default is true
A list of features to enable by default. Default is [checker, mainlog, notification]
Define if configuration files for features not managed by Puppet should be purged. Default is true.
Hash of constants. Defaults are set in the params class. Your settings will be merged with the defaults.
A list of the ITL plugins to load. Default to [ 'plugins', 'plugins-contrib', 'windows-plugins', 'nscp' ]
.
This is the directory where Icinga2 stores it's object configuration by default. To disable this, set the parameter
to false
. It's also possible to assign your own directory. This directory is relative to etc/icinga2 and must be
managed outside of this module as file resource with tag icinga2::config::file. By default this parameter is true
.
Enables or disables the checker
feature.
Parameters of icinga2::feature::checker
:
Either present
or absent
. Defines if the feature checker
should be enabled. Default is present
.
Enables or disables the mainlog
feature.
Parameters of icinga2::feature::mainlog
:
Either present
or absent
. Defines if the feature mainlog
should be enabled. Default is present
.
Sets the severity of the mainlog
feature. Can be set to:
information
notice
warning
debug
Default is information
Absolute path to the logging file. Default depends on platform:
- Linux:
/var/log/icinga2/icinga2.log
- Windows:
C:/ProgramData/icinga2/var/log/icinga2/icinga2.log
Enables or disables the notification
feature.
Parameters of icinga2::feature::notification
:
Either present
or absent
. Defines if the feature notification
should be enabled. Default is present
.
Enables or disables the command
feature.
Parameters of icinga2::feature::command
:
Either present
or absent
. Defines if the feature command
should be enabled. Default is present
.
Absolute path to the command pipe. Default depends on platform:
- Linux:
/var/run/icinga2/cmd/icinga2.cmd
- Windows:
C:/ProgramData/icinga2/var/run/icinga2/cmd/icinga2.cmd
Enables or disables the compatlog
feature.
Parameters of icinga2::feature::compatlog
:
Either present
or absent
. Defines if the feature compatlog
should be enabled. Default is present
.
Absolute path to the command pipe. Default depends on platform:
- Linux:
/var/run/icinga2/cmd/icinga2.cmd
- Windows:
C:/ProgramData/icinga2/var/run/icinga2/cmd/icinga2.cmd
Absolute path to the log directory. Default depends on platform:
- Linux:
/var/log/icinga2/compat
- Windows:
C:/ProgramData/icinga2/var/log/icinga2/compat
Sets how often should the log file be rotated. Valid options are:
HOURLY
DAILY
WEEKLY
MONTHLY
Default is DAILY
Enables or disables the graphite
feature.
Parameters of icinga2::feature::graphite
:
Either present
or absent
. Defines if the feature graphite
should be enabled. Default is present
.
Graphite Carbon host address. Default is 127.0.0.1
.
Graphite Carbon port. Default is 2003
.
Template for metric path of hosts. Default is icinga2.$host.name$.host.$host.check_command$
.
Template for metric path of services. Default is icinga2.$host.name$.services.$service.name$.$service.check_command$
.
Send threholds as metrics. Default is false.
Send metadata as metrics. Default is false.
Enables or disables the livestatus
feature.
Parameters of icinga2::feature::livestatus
:
Either present
or absent
. Defines if the feature livestatus
should be enabled. Default is present
.
Specifies the socket type. Can be either 'tcp' or 'unix'. Default is 'unix'
IP address to listen for connections. Only valid when socket_type is tcp
. Default is 127.0.0.1
Port to listen for connections. Only valid when socket_type is tcp
. Default is 6558
Specifies the path to the UNIX socket file. Only valid when socket_type is unix
. Default depends on platform:
- Linux:
/var/run/icinga2/cmd/livestatus
- Windows:
C:/ProgramData/icinga2/var/run/icinga2/cmd/livestatus
Required for historical table queries. Requires CompatLogger
feature to be enabled. Default depends platform:
Linux: var/icinga2/log/icinga2/compat
Windows: C:/ProgramData/icinga2/var/log/icinga2/compat
Enables or disables the opentsdb
feature.
Parameters of icinga2::feature::opentsdb
:
Either present
or absent
. Defines if the feature opentsdb
should be enabled. Default is present
.
OpenTSDB host address. Default is 127.0.0.1
OpenTSDB port. Default is 4242
Enables or disables the perfdata
feature.
Parameters of icinga2::feature::perfdata
:
Either present
or absent
. Defines if the feature perfdata
should be enabled. Default is present
.
Absolute path to the perfdata file for hosts. Default depends on platform:
- Linux:
/var/spool/icinga2/host-perfdata
- Windows:
C:/ProgramData/icinga2/var/spool/icinga2/host-perfdata
Absolute path to the perfdata file for services. Default depends on platform:
- Linux:
/var/spool/icinga2/service-perfdata
- Windows:
C:/ProgramData/icinga2/var/spool/icinga2/service-perfdata
Path to the temporary host file. Defaults depends on platform:
- Linux:
/var/spool/icinga2/tmp/host-perfdata
- Windows:
C:/ProgramData/icinga2/var/spool/icinga2/tmp/host-perfdata
Path to the temporary service file. Defaults depends on platform:
- Linux:
/var/spool/icinga2/tmp/host-perfdata
- Windows:
C:/ProgramData/icinga2/var/spool/icinga2/tmp/host-perfdata
Rotation interval for the files specified in {host,service}_perfdata_path. Can be written in minutes or seconds, i.e. 1m or 15s. Defaults is 30s.
Enables or disables the statusdata
feature.
Parameters of icinga2::feature::statusdata
:
Either present
or absent
. Defines if the feature statusdata
should be enabled. Default is present
.
Absolute path to the status.dat file. Default depends on platform:
- Linux:
/var/cache/icinga2/status.dat
- Windows:
C:/ProgramData/icinga2/var/cache/icinga2/status.dat
Absolute path to the object.cache file. Default depends on platform:
- Linux:
/var/cache/icinga2/object.cache
- Windows:
C:/ProgramData/icinga2/var/cache/icinga2/object.cache
Interval in seconds to update both status files. You can also specify it in minutes with the letter m or in seconds
with s. Default is 30s
Enables or disables the syslog
feature.
Parameters of icinga2::feature::syslog
:
Either present
or absent
. Defines if the feature syslog
should be enabled. Default is present
.
Set severity level for logging to syslog. Available options are:
information
notice
warning
debug
Default is warning
Enables or disables the debuglog
feature.
Parameters of icinga2::feature::debuglog
:
Either present
or absent
. Defines if the feature debuglog
should be enabled. Default is present
.
Absolute path to the log file. Default depends on platform:
- Linux:
/var/log/icinga2/debug.log
- Windows:
C:/ProgramData/icinga2/var/log/icinga2/debug.log
Enables or disables the gelf
feature.
Parameters of icinga2::feature::gelf
:
Either present
or absent
. Defines if the feature gelf
should be enabled. Default is present
.
GELF receiver host address. Default is 127.0.0.1
GELF receiver port. Default is 12201
Source name for this instance. Default is icinga2
Enable performance data for CHECK RESULT events. Default is false
.
Installs the packages.icinga.org repository. Depending on your operating system puppetlabs/apt or puppetlabs/chocolatey are required.
Handles the installation of the Icinga2 package.
Installs basic configuration files required to run Icinga2.
Starts/stops and enables/disables the service.
This defined type is used by all feature defined types as basis. It can generally enable or disable features.
Parameters of icinga2::feature
:
Either present
or absent
. Defines if the feature should be enabled. Default is present
.
Name of the feature. This name is used for the corresponding configuration file.
This module has been tested on:
- Debian 7, 8
- Ubuntu 14.04, 16.04
- CentOS/RHEL 6, 7
- Windows Server 2012
Other operating systems or versions may work but have not been tested.
A roadmap of this project is located at https://dev.icinga.org/projects/puppet-icinga2-rewrite/roadmap. Please consider this roadmap when you start contributing to the project.
When contributing several steps such as pull requests and proper testing implementations are required. Find a detailed step by step guide in CONTRIBUTING.md.
Testing is essential in our workflow to ensure a good quality. We use RSpec as well as Serverspec to test all components of this module. For a detailed description see TESTING.md.
When releasing new versions we refer to SemVer 1.0.0 for version numbers. All steps required when creating a new release are described in RELEASE.md
See also CHANGELOG.md
AUTHORS is generated on each release.