Forge Home

icinga2

Icinga 2 Puppet Module

420,674 downloads

35 latest version

4.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 4.2.1 (latest)
  • 4.2.0
  • 4.1.1
  • 4.1.0
  • 4.0.1
  • 4.0.0 (deleted)
  • 3.7.0
  • 3.6.2
  • 3.6.1
  • 3.6.0
  • 3.5.3
  • 3.5.2
  • 3.5.1
  • 3.5.0
  • 3.4.1
  • 3.4.0
  • 3.3.1
  • 3.3.0 (deleted)
  • 3.2.2
  • 3.2.1
  • 3.2.0
  • 3.1.3
  • 3.1.2
  • 3.1.1
  • 3.1.0
  • 3.0.0
  • 2.4.1
  • 2.4.0
  • 2.3.4
  • 2.3.2
  • 2.3.0
  • 2.2.0
  • 2.1.1
  • 2.1.0
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 1.4.0
  • 1.3.7
  • 1.3.6
  • 1.3.5
  • 1.3.4
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.1.1
  • 1.1.0
  • 1.0.2
  • 1.0.1
  • 1.0.0 (deleted)
released Apr 26th 2024
This version is compatible with:
  • Puppet Enterprise 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , , , , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'icinga-icinga2', '4.2.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add icinga-icinga2
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install icinga-icinga2 --version 4.2.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: monitoring

Documentation

icinga/icinga2 — version 4.2.1 Apr 26th 2024

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • icinga2::config: This class exists to manage general configuration files needed by Icinga 2 to run.
  • icinga2::globals: This class loads the default parameters by doing a hiera lookup.
  • icinga2::install: This class handles the installation of the Icinga 2 package. On Windows only chocolatey is supported as installation source.
  • icinga2::service: This class handles the Icinga 2 service. By default the service will start on boot and will be restarted if stopped.

Defined types

Public Defined types

Private Defined types

  • icinga2::feature: Private define resource to used by this module only.
  • icinga2::object: Define resource to used by this module only.
  • icinga2::tls::client: A class to generate tls key, cert and cacert paths.

Functions

Data types

Classes

icinga2

This module installs and configures Icinga 2.

  • Note Setting manage_packages to false means that all package aren't handeld by the module included the IDO packages.

Examples

Declare icinga2 with all defaults. Keep in mind that your operating system may not have Icinga 2 in its package repository.

include icinga2
If you want to use the module icinga/puppet-icinga, e.g. to use the official Icinga Project repositories, enable the manage_repos parameter.
class { 'icinga2':
  manage_repos => true,
}
If you don't want to manage the Icinga 2 service with puppet, you can dissable this behaviour with the manage_service parameter. When set to false no service refreshes will be triggered.
class { 'icinga2':
  manage_service => false,
}
To manage the version of Icinga 2 binaries you can do it by disable package management:
package { 'icinga2':
  ensure  => latest,
  notifiy => Class['icinga2'],
}

class { 'icinga2':
  manage_packages => false,
}
To set constants in etc/icinga2/constants.conf use the constants parameter and as value a hash, every key will be set as constant and assigned by it's value. Defaults can be overwritten.
class { 'icinga2':
  ...
  constants   => {
    'key1'             => 'value1',
    'key2'             => 'value2',
    'PluginContirbDir' => '/usr/local/nagios/plugins',
  }
}
Enabling features with there defaults or loading parameters via Hiera:
class { 'icinga2':
  manage_repos => true,
  features     => ['checker', 'mainlog', 'command'],
}
The ITL contains several CheckCommand definitions to load, set these in the array of the plugins parameter, i.e. for a master or satellite do the following and disbale the load of the configuration in conf.d.
class { 'icinga':
  ...
  plugins => [ 'plugins', 'contrib-plugins', 'nscp', 'windows-plugins' ],
  confd   => false,
}
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 resource. This module collects all file resource types with this tag and triggers a reload of Icinga 2 on a file change.
include ::icinga2

file { '/etc/icinga2/conf.d/foo.conf':
  ensure => file,
  owner  => icinga,
  ...
  tag    => 'icinga2::config::file',
  ...
}
To use a different directory for your configuration, create the directory as file resource with tag icinga2::config::file.
file { '/etc/icinga2/local.d':
  ensure => directory,
  tag    => 'icinga2::config::file'
}
class { 'icinga2':
  ...
  confd => 'local.d',
}

Parameters

The following parameters are available in the icinga2 class:

ensure

Data type: Stdlib::Ensure::Service

Manages if the service should be stopped or running.

Default value: running

enable

Data type: Boolean

If set to true the Icinga 2 service will start on boot.

Default value: true

manage_repos

Data type: Boolean

When set to true this module will use the module icinga/puppet-icinga to manage repositories, e.g. the release repo on packages.icinga.com repository by default, the EPEL repository or Backports. For more information, see http://github.com/icinga/puppet-icinga.

Default value: false

manage_packages

Data type: Boolean

If set to false packages aren't managed.

Default value: true

manage_selinux

Data type: Boolean

If set to true the icinga selinux package is installed. Requires a selinux_package_name (icinga2::globals) and manage_packages has to be set to true.

Default value: false

manage_service

Data type: Boolean

If set to true the service is managed otherwise the service also isn't restarted if a config file changed.

Default value: true

features

Data type: Array

List of features to activate. Defaults to [checker, mainlog, notification].

purge_features

Data type: Boolean

Define if configuration files for features not managed by Puppet should be purged.

Default value: true

constants

Data type: Hash

Hash of constants. Defaults are set in the params class. Your settings will be merged with the defaults.

Default value: {}

plugins

Data type: Array

A list of the ITL plugins to load. Defaults to [ 'plugins', 'plugins-contrib', 'windows-plugins', 'nscp' ].

confd

Data type: Variant[Boolean, String]

conf.d is the directory where Icinga 2 stores its object configuration by default. To disable it, set this parameter to false. By default this parameter is true. It's also possible to assign your own directory. This directory must be managed outside of this module as file resource with tag icinga2::config::file.

Default value: true

icinga2::feature::api

Configures the Icinga 2 feature api.

Examples

Use the puppet certificates and key copy these files to the cert directory named to 'hostname.key', 'hostname.crt' and 'ca.crt' if the contant NodeName is set to 'hostname'.
include icinga2::feature::api
To use your own certificates and key as file resources if the contant NodeName is set to fqdn (default) do:
class { 'icinga2::feature::api':
  pki => 'none',
}

File {
  owner => 'icinga',
  group => 'icinga',
}

file { "/var/lib/icinga2/certs/${::fqdn}.key":
  ensure => file,
  tag    => 'icinga2::config::file',
  source => "puppet:///modules/profiles/private_keys/${::fqdn}.key",
}
...
If you like to manage the certificates and the key as strings in base64 encoded format:
class { 'icinga2::feature::api':
  pki         => 'none',
  ssl_cacert  => '-----BEGIN CERTIFICATE----- ...',
  ssl_key     => '-----BEGIN RSA PRIVATE KEY----- ...',
  ssl_cert    => '-----BEGIN CERTIFICATE----- ...',
}
Fine tune TLS settings
class { 'icinga2::feature::api':
  ssl_protocolmin => 'TLSv1.2',
  ssl_cipher_list => 'HIGH:MEDIUM:!aNULL:!MD5:!RC4',
}
Transfer a CA certificate and key from an existing CA by using the file resource:
include icinga2

file { '/var/lib/icinga2/ca/ca.crt':
  source => '...',
  tag    => 'icinga2::config::file',
}

file { '/var/lib/icinga2/ca/ca.key':
  source => '...',
  tag    => 'icinga2::config::file',
}

Parameters

The following parameters are available in the icinga2::feature::api class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature api, absent disabled it.

Default value: present

pki

Data type: Enum['ca', 'icinga2', 'none', 'puppet']

Provides multiple sources for the certificate, key and ca.

  • puppet: Copies the key, cert and CAcert from the Puppet ssl directory to the cert directory /var/lib/icinga2/certs on Linux and C:/ProgramData/icinga2/var/lib/icinga2/certs on Windows. Please note that Puppet 7 uses an intermediate CA by default and Icinga cannot handle its CA certificate, see Icinga Issue.
  • icinga2: Uses the icinga2 CLI to generate a Certificate Request and Key to obtain a signed Certificate from 'ca_host' using the icinga2 ticket mechanism. In case the 'ticket_salt' has been configured the ticket_id will be generated by the module in a custom function that imitates the icinga ticket generation. The 'ticket_id' parameter can be used to directly set an ticket_id.
  • none: Does nothing and you either have to manage the files yourself as file resources or use the ssl_key, ssl_cert, ssl_cacert parameters.

Default value: 'icinga2'

ssl_key

Data type: Optional[String]

The private key in a base64 encoded string to store in cert directory. This parameter requires pki to be set to 'none'.

Default value: undef

ssl_cert

Data type: Optional[String]

The certificate in a base64 encoded string to store in cert directory This parameter requires pki to be set to 'none'.

Default value: undef

ssl_cacert

Data type: Optional[String]

The CA root certificate in a base64 encoded string to store in cert directory. This parameter requires pki to be set to 'none'.

Default value: undef

ssl_crl

Data type: Optional[Stdlib::Absolutepath]

Optional location of the certificate revocation list.

Default value: undef

accept_config

Data type: Optional[Boolean]

Accept zone configuration.

Default value: undef

accept_commands

Data type: Optional[Boolean]

Accept remote commands.

Default value: undef

max_anonymous_clients

Data type: Optional[Integer[0]]

Limit the number of anonymous client connections (not configured endpoints and signing requests).

Default value: undef

ca_host

Data type: Optional[Stdlib::Host]

This host will be connected to request the certificate. Set this if you use the icinga2 pki.

Default value: undef

ca_port

Data type: Stdlib::Port::Unprivileged

Port of the 'ca_host'.

Default value: 5665

fingerprint

Data type: Optional[Icinga2::Fingerprint]

Fingerprint of the CA host certificate for validation. Requires pki is set to icinga2. You can get the fingerprint via 'openssl x509 -noout -fingerprint -sha256 -inform pem -in [certificate-file.crt]' on your CA host. (Icinga2 versions before 2.12.0 require '-sha1' as digest algorithm.)

Default value: undef

ticket_salt

Data type: Variant[String, Sensitive[String]]

Salt to use for ticket generation. The salt is stored to api.conf if none or ca is chosen for pki. Defaults to constant TicketSalt. Keep in mind this parameter is parsed so please use only alpha numric characters as salt or a constant.

Default value: 'TicketSalt'

ticket_id

Data type: Optional[Variant[String, Sensitive[String]]]

If a ticket_id is given it will be used instead of generating an ticket_id. The ticket_id will be used only when requesting a certificate from the ca_host in case the pki is set to 'icinga2'.

Default value: undef

endpoints

Data type: Hash[String, Hash]

Hash to configure endpoint objects. NodeName is a icnga2 constant.

Default value: { 'NodeName' => {} }

zones

Data type: Hash[String, Hash]

Hash to configure zone objects. ZoneName and NodeName are icinga2 constants.

Default value: { 'ZoneName' => { endpoints => ['NodeName'] } }

ssl_protocolmin

Data type: Optional[Enum['TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3']]

Minimal TLS version to require.

Default value: undef

ssl_handshake_timeout

Data type: Optional[Icinga2::Interval]

TLS Handshake timeout.

Default value: undef

connect_timeout

Data type: Optional[Icinga2::Interval]

Timeout for establishing new connections.

Default value: undef

ssl_cipher_list

Data type: Optional[String]

List of allowed TLS ciphers, to finetune encryption.

Default value: undef

bind_host

Data type: Optional[Stdlib::Host]

The IP address the api listener will be bound to.

Default value: undef

bind_port

Data type: Optional[Stdlib::Port::Unprivileged]

The port the api listener will be bound to.

Default value: undef

access_control_allow_origin

Data type: Optional[Array[String]]

Specifies an array of origin URLs that may access the API.

Default value: undef

access_control_allow_credentials

Data type: Optional[Boolean]

Indicates whether or not the actual request can be made using credentials.

Default value: undef

access_control_allow_headers

Data type: Optional[String]

Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.

Default value: undef

access_control_allow_methods

Data type: Optional[Array[Enum['GET', 'POST', 'PUT', 'DELETE']]]

Used in response to a preflight request to indicate which HTTP methods can be used when making the actual request.

Default value: undef

environment

Data type: Optional[String]

Used as suffix in TLS SNI extension name; default from constant ApiEnvironment, which is empty.

Default value: undef

icinga2::feature::checker

Configures the Icinga 2 feature checker.

Parameters

The following parameters are available in the icinga2::feature::checker class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature checker, absent disabled it.

Default value: present

icinga2::feature::command

Configures the Icinga 2 feature command.

Parameters

The following parameters are available in the icinga2::feature::command class:

ensure

Data type: Enum['absent', 'present']

Set to present to enable the feature command, absent to disabled it.

Default value: present

command_path

Data type: Optional[Stdlib::Absolutepath]

Absolute path to the command pipe.

Default value: undef

icinga2::feature::compatlog

Configures the Icinga 2 feature compatlog.

Parameters

The following parameters are available in the icinga2::feature::compatlog class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature compatlog, absent disabled it.

Default value: present

log_dir

Data type: Optional[Stdlib::Absolutepath]

Absolute path to the log directory.

Default value: undef

rotation_method

Data type: Optional[Enum['DAILY', 'HOURLY', 'MONTHLY', 'WEEKLY']]

Sets how often should the log file be rotated.

Default value: undef

icinga2::feature::debuglog

Configures the Icinga 2 feature mainlog.

Parameters

The following parameters are available in the icinga2::feature::debuglog class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature mainlog, absent disables it.

Default value: present

path

Data type: Stdlib::Absolutepath

Absolute path to the log file.

Default value: "${icinga2::globals::log_dir}/debug.log"

icinga2::feature::elasticsearch

Configures the Icinga 2 feature elasticsearch.

Examples

class { 'icinga2::feature::elasticsearch':
  host     => "10.10.0.15",
  index    => "icinga2"
}

Parameters

The following parameters are available in the icinga2::feature::elasticsearch class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature elasticsearch, absent disables it.

Default value: present

host

Data type: Optional[Stdlib::Host]

Elasticsearch host address.

Default value: undef

port

Data type: Optional[Stdlib::Port::Unprivileged]

Elasticsearch HTTP port.

Default value: undef

index

Data type: Optional[String]

Elasticsearch index name.

Default value: undef

username

Data type: Optional[String]

Elasticsearch user name.

Default value: undef

password

Data type: Optional[Variant[String, Sensitive[String]]]

Elasticsearch user password. The password parameter isn't parsed anymore.

Default value: undef

enable_ssl

Data type: Optional[Boolean]

Either enable or disable SSL. Other SSL parameters are only affected if this is set to 'true'.

Default value: undef

ssl_noverify

Data type: Optional[Boolean]

Disable TLS peer verification. Only valid if ssl is enabled.

Default value: undef

ssl_key_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client private key. Only valid if ssl is enabled.

Default value: undef

ssl_cert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client certificate. Only valid if ssl is enabled.

Default value: undef

ssl_cacert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the CA certificate. Only valid if ssl is enabled.

Default value: undef

ssl_key

Data type: Optional[Variant[String, Sensitive[String]]]

The client private key in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cert

Data type: Optional[String]

The client certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cacert

Data type: Optional[String]

The CA root certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

enable_send_perfdata

Data type: Optional[Boolean]

Whether to send check performance data metrics.

Default value: undef

flush_interval

Data type: Optional[Icinga2::Interval]

How long to buffer data points before transferring to Elasticsearch.

Default value: undef

flush_threshold

Data type: Optional[Integer]

How many data points to buffer before forcing a transfer to Elasticsearch.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

icinga2::feature::gelf

Configures the Icinga 2 feature gelf.

Parameters

The following parameters are available in the icinga2::feature::gelf class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature gelf, absent disables it.

Default value: present

host

Data type: Optional[Stdlib::Host]

GELF receiver host address.

Default value: undef

port

Data type: Optional[Stdlib::Port::Unprivileged]

GELF receiver port.

Default value: undef

source

Data type: Optional[String]

Source name for this instance.

Default value: undef

enable_ssl

Data type: Boolean

Either enable or disable SSL/TLS. Other SSL parameters are only affected if this is set to 'true'.

Default value: false

ssl_key_path

Data type: Optional[Stdlib::Absolutepath]

Location of the private key. Only valid if ssl is enabled.

Default value: undef

ssl_cert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the certificate. Only valid if ssl is enabled.

Default value: undef

ssl_cacert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the CA certificate. Only valid if ssl is enabled.

Default value: undef

ssl_key

Data type: Optional[Variant[String, Sensitive[String]]]

The client private key in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cert

Data type: Optional[String]

The client certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cacert

Data type: Optional[String]

The CA certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_noverify

Data type: Optional[Boolean]

Disable TLS peer verification. Only valid if ssl is enabled.

Default value: undef

enable_send_perfdata

Data type: Optional[Boolean]

Enable performance data for 'CHECK RESULT' events.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

icinga2::feature::graphite

Configures the Icinga 2 feature graphite.

Examples

class { 'icinga2::feature::graphite':
  host                   => '10.10.0.15',
  port                   => 2003,
  enable_send_thresholds => true,
  enable_send_metadata   => true,
}

Parameters

The following parameters are available in the icinga2::feature::graphite class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature graphite, absent disabled it.

Default value: present

host

Data type: Optional[Stdlib::Host]

Graphite Carbon host address.

Default value: undef

port

Data type: Optional[Stdlib::Port::Unprivileged]

Graphite Carbon port.

Default value: undef

host_name_template

Data type: Optional[String]

Template for metric path of hosts.

Default value: undef

service_name_template

Data type: Optional[String]

Template for metric path of services.

Default value: undef

enable_send_thresholds

Data type: Optional[Boolean]

Default value: undef

enable_send_metadata

Data type: Optional[Boolean]

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

icinga2::feature::icingadb

Configures the Icinga 2 feature icingadb.

Parameters

The following parameters are available in the icinga2::feature::icingadb class:

ensure

Data type: Enum['absent', 'present']

Set to present, enables the feature icingadb, absent disabled it.

Default value: present

host

Data type: Optional[Stdlib::Host]

IcingaDB Redis host address.

Default value: undef

port

Data type: Optional[Stdlib::Port::Unprivileged]

IcingaDB Redis port.

Default value: undef

socket_path

Data type: Optional[Stdlib::Absolutepath]

IcingaDB Redis unix sockt. Can be used instead of host and port attributes.

Default value: undef

connect_timeout

Data type: Optional[Icinga2::Interval]

Timeout for establishing new connections.

Default value: undef

password

Data type: Optional[Variant[String, Sensitive[String]]]

IcingaDB Redis password. The password parameter isn't parsed anymore.

Default value: undef

env_id

Data type: Optional[Variant[String, Sensitive[String]]]

The ID is used in all Icinga DB components to separate data from multiple different environments and is written to the file /var/lib/icinga2/icingadb.env by Icinga 2. Icinga 2 generates a unique environment ID from its CA certificate when it is first started with the Icinga DB feature enabled.

Default value: undef

enable_tls

Data type: Boolean

Either enable or disable SSL/TLS. Other SSL parameters are only affected if this is set to 'true'.

Default value: false

tls_key_file

Data type: Optional[Stdlib::Absolutepath]

Location of the private key. Only valid if tls is enabled.

Default value: undef

tls_cert_file

Data type: Optional[Stdlib::Absolutepath]

Location of the certificate. Only valid if tls is enabled.

Default value: undef

tls_cacert_file

Data type: Optional[Stdlib::Absolutepath]

Location of the CA certificate. Only valid if tls is enabled.

Default value: undef

tls_crl_file

Data type: Optional[Stdlib::Absolutepath]

Location of the Certicicate Revocation List. Only valid if tls is enabled.

Default value: undef

tls_key

Data type: Optional[Variant[String, Sensitive[String]]]

The private key in a PEM formated string to store spicified in tls_key_file. Only valid if tls is enabled.

Default value: undef

tls_cert

Data type: Optional[String]

The certificate in a PEM format string to store spicified in tls_cert_file. Only valid if tls is enabled.

Default value: undef

tls_cacert

Data type: Optional[String]

The CA root certificate in a PEM formated string to store spicified in tls_cacert_file. Only valid if tls is enabled.

Default value: undef

tls_capath

Data type: Optional[String]

Path to all trusted CA certificates. Only valid if tls is enabled.

Default value: undef

tls_cipher

Data type: Optional[String]

List of allowed ciphers. Only valid if tls is enabled.

Default value: undef

tls_protocolmin

Data type: Optional[String]

Minimum TLS protocol version like TLSv1.2. Only valid if tls is enabled.

Default value: undef

tls_noverify

Data type: Optional[Boolean]

Whether not to verify the peer.

Default value: undef

icinga2::feature::idomysql

Installs and configures the Icinga 2 feature ido-mysql.

Examples

The ido-mysql featue requires an existing database and a user with permissions. This example uses the puppetlabs/mysql module.
include mysql::server

mysql::db { 'icinga2':
  user     => 'icinga2',
  password => 'supersecret',
  host     => 'localhost',
  grant    => ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'DROP', 'CREATE VIEW', 'CREATE', 'INDEX', 'EXECUTE', 'ALTER'],
}

class{ 'icinga2::feature::idomysql':
  user          => "icinga2",
  password      => "supersecret",
  database      => "icinga2",
  import_schema => true,
  require       => Mysql::Db['icinga2']
}

Parameters

The following parameters are available in the icinga2::feature::idomysql class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature ido-mysql, absent disables it.

Default value: present

host

Data type: Stdlib::Host

MySQL database host address.

Default value: 'localhost'

port

Data type: Optional[Stdlib::Port::Unprivileged]

MySQL database port.

Default value: undef

socket_path

Data type: Optional[Stdlib::Absolutepath]

MySQL socket path.

Default value: undef

user

Data type: String

MySQL database user with read/write permission to the icinga database.

Default value: 'icinga'

password

Data type: Variant[String, Sensitive[String]]

MySQL database user's password. The password parameter isn't parsed anymore.

database

Data type: String

MySQL database name.

Default value: 'icinga'

enable_ssl

Data type: Boolean

Either enable or disable SSL/TLS. Other SSL parameters are only affected if this is set to 'true'.

Default value: false

ssl_key_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client private key. Only valid if ssl is enabled.

Default value: undef

ssl_cert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client certificate. Only valid if ssl is enabled.

Default value: undef

ssl_cacert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the CA certificate. Only valid if ssl is enabled.

Default value: undef

ssl_key

Data type: Optional[Variant[String, Sensitive[String]]]

The client private key in PEM Format. Only valid if ssl is enabled.

Default value: undef

ssl_cert

Data type: Optional[String]

The client certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cacert

Data type: Optional[String]

The CA root certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_capath

Data type: Optional[Stdlib::Absolutepath]

MySQL SSL trusted SSL CA certificates in PEM format directory path. Only valid if ssl is enabled.

Default value: undef

ssl_cipher

Data type: Optional[String]

MySQL SSL list of allowed ciphers. Only valid if ssl is enabled.

Default value: undef

table_prefix

Data type: Optional[String]

MySQL database table prefix.

Default value: undef

instance_name

Data type: Optional[String]

Unique identifier for the local Icinga 2 instance.

Default value: undef

instance_description

Data type: Optional[String]

Description for the Icinga 2 instance.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

failover_timeout

Data type: Optional[Icinga2::Interval]

Set the failover timeout in a HA cluster. Must not be lower than 60s.

Default value: undef

cleanup

Data type: Optional[Icinga2::IdoCleanup]

Hash with items for historical table cleanup.

Default value: undef

categories

Data type: Optional[Array]

Array of information types that should be written to the database.

Default value: undef

import_schema

Data type: Variant[Boolean, Enum['mariadb', 'mysql']]

Whether to import the MySQL schema or not. New options mariadb and mysql, both means true. With mariadb its cli options are used for the import, whereas with mysql its different options.

Default value: false

icinga2::feature::idopgsql

Installs and configures the Icinga 2 feature ido-pgsql.

Examples

The ido-pgsql featue requires an existing database and a user with permissions. This example uses the puppetlab/postgresql module.
include icinga2
include postgresql::server

postgresql::server::db { 'icinga2':
  user     => 'icinga2',
  password => postgresql::postgresql_password('icinga2', 'supersecret'),
}

class{ 'icinga2::feature::idopgsql':
  user          => 'icinga2',
  password      => 'supersecret',
  database      => 'icinga2',
  import_schema => true,
  require       => Postgresql::Server::Db['icinga2']
}

Parameters

The following parameters are available in the icinga2::feature::idopgsql class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature ido-pgsql, absent disables it.

Default value: present

host

Data type: Stdlib::Host

PostgreSQL database host address.

Default value: 'localhost'

port

Data type: Optional[Stdlib::Port::Unprivileged]

PostgreSQL database port.

Default value: undef

user

Data type: String

PostgreSQL database user with read/write permission to the icinga database.

Default value: 'icinga'

password

Data type: Variant[String, Sensitive[String]]

PostgreSQL database user's password. The password parameter isn't parsed anymore.

database

Data type: String

PostgreSQL database name.

Default value: 'icinga'

ssl_mode

Data type: Optional[Enum['verify-full', 'verify-ca']]

Enable SSL connection mode.

Default value: undef

ssl_key_path

Data type: Optional[Stdlib::Absolutepath]

Location of the private key. Only valid if ssl_mode is set unequal to disabled.

Default value: undef

ssl_cert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the certificate. Only valid if ssl_mode is set unequal to disabled.

Default value: undef

ssl_cacert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the CA certificate. Only valid if ssl_mode is set unequal to disabled.

Default value: undef

ssl_key

Data type: Optional[Variant[String, Sensitive[String]]]

The client private key in PEM format. Only valid if ssl_mode is set unequal to disabled.

Default value: undef

ssl_cert

Data type: Optional[String]

The client certificate in PEM format. Only valid if ssl_mode is set unequal to disabled.

Default value: undef

ssl_cacert

Data type: Optional[String]

The CA root certificate in PEM format. Only valid if ssl_mode is set unequal to disabled.

Default value: undef

table_prefix

Data type: Optional[String]

PostgreSQL database table prefix.

Default value: undef

instance_name

Data type: Optional[String]

Unique identifier for the local Icinga 2 instance.

Default value: undef

instance_description

Data type: Optional[String]

Description of the Icinga 2 instance.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

failover_timeout

Data type: Optional[Icinga2::Interval]

Set the failover timeout in a HA cluster. Must not be lower than 60s.

Default value: undef

cleanup

Data type: Optional[Icinga2::IdoCleanup]

Hash with items for historical table cleanup.

Default value: undef

categories

Data type: Optional[Array]

Array of information types that should be written to the database.

Default value: undef

import_schema

Data type: Boolean

Whether to import the PostgreSQL schema or not.

Default value: false

icinga2::feature::influxdb

Configures the Icinga 2 feature influxdb.

Examples

class { 'icinga2::feature::influxdb':
  host     => "10.10.0.15",
  username => "icinga2",
  password => "supersecret",
  database => "icinga2"
}

Parameters

The following parameters are available in the icinga2::feature::influxdb class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature influxdb, absent disables it.

Default value: present

host

Data type: Optional[Stdlib::Host]

InfluxDB host address.

Default value: undef

port

Data type: Optional[Stdlib::Port]

InfluxDB HTTP port.

Default value: undef

database

Data type: Optional[String]

InfluxDB database name.

Default value: undef

username

Data type: Optional[String]

InfluxDB user name.

Default value: undef

password

Data type: Optional[Variant[String, Sensitive[String]]]

InfluxDB user password. The password parameter isn't parsed anymore.

Default value: undef

basic_auth

Data type: Optional[Icinga2::BasicAuth]

Username and password for HTTP basic authentication.

Default value: undef

enable_ssl

Data type: Optional[Boolean]

Either enable or disable SSL. Other SSL parameters are only affected if this is set to 'true'.

Default value: undef

ssl_noverify

Data type: Optional[Boolean]

Disable TLS peer verification. Only valid if ssl is enabled.

Default value: undef

ssl_key_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client private key. Only valid if ssl is enabled.

Default value: undef

ssl_cert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client certificate. Only valid if ssl is enabled.

Default value: undef

ssl_cacert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the CA certificate. Only valid if ssl is enabled.

Default value: undef

ssl_key

Data type: Optional[Variant[String, Sensitive[String]]]

The client private key in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cert

Data type: Optional[String]

The client certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cacert

Data type: Optional[String]

The CA root certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

host_measurement

Data type: String

The value of this is used for the measurement setting in host_template.

Default value: '$host.check_command$'

host_tags

Data type: Hash

Tags defined in this hash will be set in the host_template.

Default value: { hostname => '$host.name$' }

service_measurement

Data type: String

The value of this is used for the measurement setting in host_template.

Default value: '$service.check_command$'

service_tags

Data type: Hash

Tags defined in this hash will be set in the service_template.

Default value: { hostname => '$host.name$', service => '$service.name$' }

enable_send_thresholds

Data type: Optional[Boolean]

Whether to send warn, crit, min & max tagged data.

Default value: undef

enable_send_metadata

Data type: Optional[Boolean]

Whether to send check metadata e.g. states, execution time, latency etc.

Default value: undef

flush_interval

Data type: Optional[Icinga2::Interval]

How long to buffer data points before transfering to InfluxDB.

Default value: undef

flush_threshold

Data type: Optional[Integer[1]]

How many data points to buffer before forcing a transfer to InfluxDB.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

icinga2::feature::influxdb2

Configures the Icinga 2 feature influxdb2.

Examples

class { 'icinga2::feature::influxdb2':
  host         => "10.10.0.15",
  organization => "ICINGA",
  bucket       => "icinga2",
  auth_token   => "supersecret",
}

Parameters

The following parameters are available in the icinga2::feature::influxdb2 class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature influxdb, absent disables it.

Default value: present

host

Data type: Optional[Stdlib::Host]

InfluxDB host address.

Default value: undef

port

Data type: Optional[Stdlib::Port]

InfluxDB HTTP port.

Default value: undef

organization

Data type: String

InfluxDB organization name.

bucket

Data type: String

InfluxDB bucket name.

auth_token

Data type: Variant[String, Sensitive[String]]

InfluxDB authentication token.

enable_ssl

Data type: Optional[Boolean]

Either enable or disable SSL. Other SSL parameters are only affected if this is set to 'true'.

Default value: undef

ssl_noverify

Data type: Optional[Boolean]

Disable TLS peer verification. Only valid if ssl is enabled.

Default value: undef

ssl_key_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client private key. Only valid if ssl is enabled.

Default value: undef

ssl_cert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the client certificate. Only valid if ssl is enabled.

Default value: undef

ssl_cacert_path

Data type: Optional[Stdlib::Absolutepath]

Location of the CA certificate. Only valid if ssl is enabled.

Default value: undef

ssl_key

Data type: Optional[Variant[String, Sensitive[String]]]

The client private key in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cert

Data type: Optional[String]

The client certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

ssl_cacert

Data type: Optional[String]

The CA root certificate in PEM format. Only valid if ssl is enabled.

Default value: undef

host_measurement

Data type: String

The value of this is used for the measurement setting in host_template.

Default value: '$host.check_command$'

host_tags

Data type: Hash

Tags defined in this hash will be set in the host_template.

Default value: { hostname => '$host.name$' }

service_measurement

Data type: String

The value of this is used for the measurement setting in host_template.

Default value: '$service.check_command$'

service_tags

Data type: Hash

Tags defined in this hash will be set in the service_template.

Default value: { hostname => '$host.name$', service => '$service.name$' }

enable_send_thresholds

Data type: Optional[Boolean]

Whether to send warn, crit, min & max tagged data.

Default value: undef

enable_send_metadata

Data type: Optional[Boolean]

Whether to send check metadata e.g. states, execution time, latency etc.

Default value: undef

flush_interval

Data type: Optional[Icinga2::Interval]

How long to buffer data points before transfering to InfluxDB.

Default value: undef

flush_threshold

Data type: Optional[Integer[1]]

How many data points to buffer before forcing a transfer to InfluxDB.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

icinga2::feature::livestatus

Configures the Icinga 2 feature livestatus.

Parameters

The following parameters are available in the icinga2::feature::livestatus class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature livestatus, absent disables it.

Default value: present

socket_type

Data type: Optional[Enum['tcp', 'unix']]

Specifies the socket type. Can be either 'tcp' or 'unix'.

Default value: undef

bind_host

Data type: Optional[Stdlib::Host]

IP address to listen for connections. Only valid when socket_type is 'tcp'.

Default value: undef

bind_port

Data type: Optional[Stdlib::Port::Unprivileged]

Port to listen for connections. Only valid when socket_type is 'tcp'.

Default value: undef

socket_path

Data type: Optional[Stdlib::Absolutepath]

Specifies the path to the UNIX socket file. Only valid when socket_type is 'unix'.

Default value: undef

compat_log_path

Data type: Optional[Stdlib::Absolutepath]

Required for historical table queries. Requires CompatLogger feature to be enabled.

Default value: undef

icinga2::feature::mainlog

Configures the Icinga 2 feature mainlog.

Parameters

The following parameters are available in the icinga2::feature::mainlog class:

ensure

Data type: Enum['absent', 'present']

Set to 'present' enables the feature mainlog, 'absent' disabled it.

Default value: present

severity

Data type: Icinga2::LogSeverity

You can set the log severity to 'information', 'notice', 'warning' or 'debug'.

Default value: 'information'

path

Data type: Stdlib::Absolutepath

Absolute path to the log file.

Default value: "${icinga2::globals::log_dir}/icinga2.log"

icinga2::feature::notification

Configures the Icinga 2 feature notification.

Parameters

The following parameters are available in the icinga2::feature::notification class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature notification, absent disabled it.

Default value: present

enable_ha

Data type: Optional[Boolean]

Notifications are load-balanced amongst all nodes in a zone.

Default value: undef

icinga2::feature::opentsdb

Configures the Icinga 2 feature opentsdb.

Parameters

The following parameters are available in the icinga2::feature::opentsdb class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature opentsdb, absent disables it.

Default value: present

host

Data type: Optional[Stdlib::Host]

OpenTSDB host address.

Default value: undef

port

Data type: Optional[Stdlib::Port::Unprivileged]

OpenTSDB port.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

icinga2::feature::perfdata

Configures the Icinga 2 feature perfdata.

Parameters

The following parameters are available in the icinga2::feature::perfdata class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature perfdata, absent disables it.

Default value: present

host_perfdata_path

Data type: Optional[Stdlib::Absolutepath]

Absolute path to the perfdata file for hosts.

Default value: undef

service_perfdata_path

Data type: Optional[Stdlib::Absolutepath]

Absolute path to the perfdata file for services.

Default value: undef

host_temp_path

Data type: Optional[Stdlib::Absolutepath]

Path to the temporary host file.

Default value: undef

service_temp_path

Data type: Optional[Stdlib::Absolutepath]

Path to the temporary service file.

Default value: undef

host_format_template

Data type: Optional[String]

Host Format template for the performance data file.

Default value: undef

service_format_template

Data type: Optional[String]

Service Format template for the performance data file.

Default value: undef

rotation_interval

Data type: Optional[Icinga2::Interval]

Rotation interval for the files specified in {host,service}_perfdata_path. Can be written in minutes or seconds, i.e. 1m or 15s.

Default value: undef

enable_ha

Data type: Optional[Boolean]

Enable the high availability functionality. Only valid in a cluster setup.

Default value: undef

icinga2::feature::statusdata

Configures the Icinga 2 feature statusdata.

Parameters

The following parameters are available in the icinga2::feature::statusdata class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature statusdata, absent disables it.

Default value: present

status_path

Data type: Optional[Stdlib::Absolutepath]

Absolute path to the status.dat file.

Default value: undef

objects_path

Data type: Optional[Stdlib::Absolutepath]

Absolute path to the object.cache file.

Default value: undef

update_interval

Data type: Optional[Icinga2::Interval]

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 value: undef

icinga2::feature::syslog

Configures the Icinga 2 feature syslog.

Parameters

The following parameters are available in the icinga2::feature::syslog class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature syslog, absent disables it.

Default value: present

severity

Data type: Icinga2::LogSeverity

You can choose the log severity between information, notice, warning or debug.

Default value: 'warning'

facility

Data type: Optional[Icinga2::LogFacility]

Defines the facility to use for syslog entries. This can be a facility constant like FacilityDaemon.

Default value: undef

icinga2::feature::windowseventlog

Configures the Icinga 2 feature windowseventlog.

Parameters

The following parameters are available in the icinga2::feature::windowseventlog class:

ensure

Data type: Enum['absent', 'present']

Set to present enables the feature windowseventlog, absent disables it.

Default value: present

severity

Data type: Icinga2::LogSeverity

You can choose the log severity between information, notice, warning or debug.

Default value: 'warning'

icinga2::pki::ca

This class provides multiple ways to create the CA used by Icinga 2.

Examples

Let Icinga 2 generate a CA for you:
include icinga2
include icinga2::pki::ca
Set the content of CA certificate and key:
include icinga2

class { 'icinga2::pki::ca':
  ca_cert => '-----BEGIN CERTIFICATE----- ...',
  ca_key  => '-----BEGIN RSA PRIVATE KEY----- ...',
}

Parameters

The following parameters are available in the icinga2::pki::ca class:

ca_cert

Data type: Optional[String]

Content of the CA certificate. If this is unset, a certificate will be generated with the Icinga 2 CLI.

Default value: undef

ca_key

Data type: Optional[String]

Content of the CA key. If this is unset, a key will be generated with the Icinga 2 CLI.

Default value: undef

icinga2::query_objects

Class to query icinga2::objects from puppetdb.

Parameters

The following parameters are available in the icinga2::query_objects class:

destination

Data type: String

Destination equal to what was set in parameter export for objects.

Default value: $facts['networking']['fqdn']

environments

Data type: Array[String]

limits the response to objects of these environments if set, all environments if list is empty

Default value: [$environment]

Defined types

icinga2::config::fragment

Set a code fragment in a target configuration file. It's not possible to add a fragment to an object.

Examples

To create a custom configuration add content to a specified target at the position you set in the order parameter.
include ::icinga2

icinga2::object::service { 'load':
  display_name  => 'Load',
  apply         => true,
  check_command => 'load',
  vars          => {
    load_wload1 => 'dynamic_threshold(backup, 20, 5)',
    load_cload1 => 'dynamic_threshold(backup, 40, 10)',
  },
  assign        => ['vars.os == Linux'],
  target        => '/etc/icinga2/example.d/services.conf',
  order         => 30,
}

icinga2::config::fragment { 'load-function':
  target  => '/etc/icinga2/example.d/services.conf',
  order   => 10,
  content => "globals.dynamic_threshold = function(timeperiod, ivalue, ovalue) {
  return function() use (timeperiod, ivalue, ovalue) {
    if (get_time_period(timeperiod).is_inside) {
      return ivalue
    } else {
      return ovalue
    }
  }
}\n",
}

Parameters

The following parameters are available in the icinga2::config::fragment defined type:

content

Data type: String

Content to insert in file specified in target.

target

Data type: Stdlib::Absolutepath

Destination config file to store in this fragment. File will be declared the first time.

code_name

Data type: String

Namevar of the fragment.

Default value: $title

order

Data type: Variant[String, Integer]

String or integer to set the position in the target file, sorted in alpha numeric order. Defaults to 00.

Default value: '00'

icinga2::object::apiuser

Manage Icinga 2 ApiUser objects.

Examples

Create an user with full permissions:
::icinga2::object::apiuser { 'director':
  ensure      => present,
  password    => 'Eih5Weefoo2oa8sh',
  permissions => [ '*' ],
  target      => '/etc/icinga2/conf.d/api-users.conf',
}
Create an user with restricted permissions for Icinga Web 2:
::icinga2::object::apiuser { 'icingaweb2':
  ensure      => present,
  password    => '12e2ef553068b519',
  permissions => [ 'status/query', 'actions/*', 'objects/modify/*', 'objects/query/*' ],
  target      => '/etc/icinga2/conf.d/api-users.conf',
}
Create user who's only allowed to query hosts and services:
::icinga2::object::apiuser { 'read':
  ensure      => present,
  password    => 'read',
  permissions => [
    {
      permission => 'objects/query/Host',
      filter     => '{{ regex("^Linux", host.vars.os) }}'
    },
    {
      permission => 'objects/query/Service',
      filter     => '{{ regex("^Linux", host.vars.os) }}'
    },
  ],
  target      => '/etc/icinga2/conf.d/api-users.conf',
}

Parameters

The following parameters are available in the icinga2::object::apiuser defined type:

ensure

Data type: Enum['absent', 'present']

Set to present enables the object, absent disables it.

Default value: present

apiuser_name

Data type: String

Set the name of the apiuser object.

Default value: $title

password

Data type: Optional[Variant[String, Sensitive[String]]]

Password string. The password parameter isn't parsed anymore.

Default value: undef

client_cn

Data type: Optional[String]

Optional. Client Common Name (CN).

Default value: undef

permissions

Data type: Optional[Array]

Array of permissions. Either as string or dictionary with the keys permission and filter. The latter must be specified as function.

Default value: undef

target

Data type: Stdlib::Absolutepath

Destination config file to store in this object. File will be declared at the first time.

order

Data type: Variant[String, Integer]

String or integer to set the position in the target file, sorted alpha numeric.

Default value: 30

export

Data type: Variant[Array[String], String]

Export object to destination, collected by class icinga2::query_objects.

Default value: []

icinga2::object::checkcommand

Manage Icinga 2 Host objects.

Parameters

The following parameters are available in the icinga2::object::checkcommand defined type:

ensure

Data type: Enum['absent', 'present']

Set to present enables the object, absent disables it.

Default value: present

checkcommand_name

Data type: String

Title of the CheckCommand object.

Default value: $title

import

Data type: Array

Sorted List of templates to include.

Default value: []

command

Data type: Optional[Variant[Array, String]]

The command. This can either be an array of individual command arguments. Alternatively a string can be specified in which case the shell interpreter (usually /bin/sh) takes care of parsing the command. When using the "arguments" attribute this must be an array. Can be specified as function for advanced implementations.

Default value: undef

env

Data type: Optional[Hash]

A dictionary of macros which should be exported as environment variables prior to executing the command.

Default value: undef

vars

Data type: Optional[Icinga2::CustomAttributes]

A dictionary containing custom attributes that are specific to this service, a string to do operations on this dictionary or an array for multiple use of custom attributes.

Default value: undef

timeout

Data type: Optional[Icinga2::Interval]

The command timeout in seconds.

Default value: undef

arguments

Data type: Optional[Variant[Hash, String]]

A dictionary of command arguments.

Default value: undef

target

Data type: Stdlib::Absolutepath

Destination config file to store in this object. File will be declared the first time.

template

Data type: Boolean

Set to true creates a template instead of an object.

Default value: false

order

Data type: Variant[String, Integer]

String or integer to set the position in the target file, sorted alpha numeric.

Default value: 15

export

Data type: Variant[Array[String], String]

Export object to destination, collected by class icinga2::query_objects.

Default value: []

icinga2::object::checkresultreader

Manage Icinga 2 CheckResultReader objects.

Parameters

The following parameters are available in the icinga2::object::checkresultreader defined type:

ensure

Data type: Enum['absent', 'present']

Set to present enables the object, absent disables it.

Default value: present

checkresultreader_name

Data type: String

Set the Icinga 2 name of the ceckresultreader object.

Default value: $title

spool_dir

Data type: Optional[Stdlib::Absolutepath]

The directory which contains the check result files.

Default value: undef

target

Data type: Stdlib::Absolutepath

Destination config file to store in this object. File will be declared the first time.

order

Data type: Variant[String, Integer]

String or integer to set the position in the target file, sorted alpha numeric.

Default value: '05'

icinga2::object::dependency

Manage Icinga 2 dependency objects.

Parameters

The following parameters are available in the icinga2::object::dependency defined type:

ensure

Data type: Enum['absent', 'present']

Set to present enables the object, absent disables it.

Default value: present

dependency_name

Data type: String

Set the Icinga 2 name of the dependency object.

Default value: $title

parent_host_name

Data type: Optional[String]

The parent host.

Default value: undef

parent_service_name

Data type: Optional[String]

The parent service. If omitted, this dependency object is treated as host dependency.

Default value: undef

child_host_name

Data type: Optional[String]

The child host.

Default value: undef

child_service_name

Data type: Optional[String]

The child service. If omitted, this dependency object is treated as host dependency.

Default value: undef

disable_checks

Data type: Optional[Boolean]

Whether to disable checks when this dependency fails.

Default value: undef

disable_notifications

Data type: Optional[Boolean]

Whether to disable notifications when this dependency fails. true.

Default value: undef

ignore_soft_states

Data type: Optional[Boolean]

Whether to ignore soft states for the reachability calculation. true.

Default value: undef

period

Data type: Optional[String]

Time period during which this dependency is enabled.

Default value: undef

states

Data type: Optional[Array]

A list of state filters when this dependency should be OK.

Default value: undef

apply

Data type: Variant[Boolean, String]

Dispose an apply instead an object if set to 'true'. Value is taken as statement, i.e. 'vhost => config in host.vars.vhosts'.

Default value: false

prefix

Data type: Variant[Boolean, String]

Set dependency_name as prefix in front of 'apply for'. Only effects if apply is a string.

Default value: false

apply_target

Data type: Enum['Host', 'Service']

An object type on which to target the apply rule. Valid values are Host and Service.

Default value: 'Host'

assign

Data type: Array

Assign user group members using the group assign rules.

Default value: []

ignore

Data type: Array

Exclude users using the group ignore rules.

Default value: []

template

Data type: Boolean

Set to true creates a template instead of an object.

Default value: false

import

Data type: Array

Sorted List of templates to include.

Default value: []

target

Data type: Stdlib::Absolutepath

Destination config file to store in this object. File will be declared the first time.

order

Data type: Variant[String, Integer]

String or integer to set the position in the target file, sorted alpha numeric.

Default value: 70

export

Data type: Variant[Array[String], String]

Export object to destination, collected by class icinga2::query_objects.

Default value: []

icinga2::object::endpoint

Manage Icinga 2 endpoint objects.

Parameters

The following parameters are available in the icinga2::object::endpoint defined type:

ensure

Data type: Enum['absent', 'present']

Set to present enables the object, absent disables it.

Default value: present

endpoint_name

Data type: String

Set the Icinga 2 name of the endpoint object.

Default value: $title

host

Data type: Optional[Stdlib::Host]

Optional. The IP address of the remote Icinga 2 instance.

Default value: undef

port

Data type: Optional[Stdlib::Port::Unprivileged]

The service name/port of the remote Icinga 2 instance.

Default value: undef

log_duration

Data type: Optional[Icinga2::Interval]

Duration for keeping replay logs on connection loss. Attribute is specified in seconds. If log_duration is set to 0, replaying logs is disabled. You could also specify the value in human readable format like 10m for 10 minutes or 1h for one hour.

Default value: undef

target

Data type: Optional[Stdlib::Absolutepath]

Destination config file to store in this object. File will be declared at the first time.

Default value: undef

order

Data type: Variant[String, Integer]

String or integer to set the position in the target file, sorted alpha numeric.

Default value: 40