Classes
Public Classes
icinga2
: This module installs and configures Icinga 2.icinga2::feature::api
: Configures the Icinga 2 feature api.icinga2::feature::checker
: Configures the Icinga 2 feature checker.icinga2::feature::command
: Configures the Icinga 2 feature command.icinga2::feature::compatlog
: Configures the Icinga 2 feature compatlog.icinga2::feature::debuglog
: Configures the Icinga 2 feature mainlog.icinga2::feature::elasticsearch
: Configures the Icinga 2 feature elasticsearch.icinga2::feature::gelf
: Configures the Icinga 2 feature gelf.icinga2::feature::graphite
: Configures the Icinga 2 feature graphite.icinga2::feature::icingadb
: Configures the Icinga 2 feature icingadb.icinga2::feature::idomysql
: Installs and configures the Icinga 2 feature ido-mysql.icinga2::feature::idopgsql
: Installs and configures the Icinga 2 feature ido-pgsql.icinga2::feature::influxdb
: Configures the Icinga 2 feature influxdb.icinga2::feature::livestatus
: Configures the Icinga 2 feature livestatus.icinga2::feature::mainlog
: Configures the Icinga 2 feature mainlog.icinga2::feature::notification
: Configures the Icinga 2 feature notification.icinga2::feature::opentsdb
: Configures the Icinga 2 feature opentsdb.icinga2::feature::perfdata
: Configures the Icinga 2 feature perfdata.icinga2::feature::statusdata
: Configures the Icinga 2 feature statusdata.icinga2::feature::syslog
: Configures the Icinga 2 feature syslog.icinga2::pki::ca
: This class provides multiple ways to create the CA used by Icinga 2.
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::repo
: This class manages the packages.icinga.com repository based on the operating system. Windows is not supported.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
icinga2::config::fragment
: Set a code fragment in a target configuration file.icinga2::object::apiuser
: Manage Icinga 2 ApiUser objects.icinga2::object::checkcommand
: Manage Icinga 2 Host objects.icinga2::object::checkresultreader
: Manage Icinga 2 CheckResultReader objects.icinga2::object::dependency
: Manage Icinga 2 dependency objects.icinga2::object::endpoint
: Manage Icinga 2 endpoint objects.icinga2::object::eventcommand
: Manage Icinga 2 EventCommand objects.icinga2::object::host
: Manage Icinga 2 Host objects.icinga2::object::hostgroup
: Manage Icinga 2 HostGroup objects.icinga2::object::notification
: Manage Icinga 2 notification objects.icinga2::object::notificationcommand
: Manage Icinga 2 notificationcommand objects.icinga2::object::scheduleddowntime
: Manage Icinga 2 scheduleddowntime objects.icinga2::object::service
: Manage Icinga 2 service objects.icinga2::object::servicegroup
: Manage Icinga 2 servicegroup objects.icinga2::object::timeperiod
: Manage Icinga 2 timeperiod objects.icinga2::object::user
: Manage Icinga 2 user objects.icinga2::object::usergroup
: Manage Icinga 2 usergroup objects.icinga2::object::zone
: Manage Icinga 2 zone objects.
Private Defined types
icinga2::feature
: Private define resource to used by this module only.icinga2::object
: Define resource to used by this module only.
Functions
icinga2::icinga2_attributes
: Summarise what the function does hereicinga2::icinga2_ticket_id
: Summarise what the function does hereicinga2_attributes
: Wrapper for config parsericinga2_ticket_id
: Generates a auth ticket to get a certificate
Data types
Icinga2::CustomAttributes
: A type for the structure of custom attributesIcinga2::Fingerprint
: Type for certificate fingerprintsIcinga2::Interval
: A strict type for intervalsIcinga2::LogFacility
: A strict type of syslog facilitiesIcinga2::LogSeverity
: A strict type for log levels
This module installs and configures Icinga 2.
- Note Setting manage_package to false means that all package aren't handeld by the module included the IDO packages.
Declare icinga2 with all defaults. Keep in mind that your operating system may not have Icinga 2 in its package repository.
include ::icinga2
class { 'icinga2':
manage_repo => 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,
}
package { 'icinga2':
ensure => latest,
notifiy => Class['icinga2'],
}
class { '::icinga2':
manage_package => 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',
}
}
class { '::icinga2':
manage_repo => 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',
}
The following parameters are available in the icinga2
class.
Data type: Stdlib::Ensure::Service
Manages if the service should be stopped or running.
Default value: running
Data type: Boolean
If set to true the Icinga 2 service will start on boot.
Default value: true
Data type: Boolean
When set to true this module will install the packages.icinga.com 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 value: false
Data type: Boolean
If set to false packages aren't managed.
Default value: true
Data type: Boolean
If set to true the icinga selinux package is installed. Requires a selinux_package_name
(icinga2::globals)
and manage_package
has to be set to true.
Default value: false
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
Data type: Array
List of features to activate. Defaults to [checker, mainlog, notification].
Data type: Boolean
Define if configuration files for features not managed by Puppet should be purged.
Default value: true
Data type: Hash
Hash of constants. Defaults are set in the params class. Your settings will be merged with the defaults.
Default value: {}
Data type: Array
A list of the ITL plugins to load. Defaults to [ 'plugins', 'plugins-contrib', 'windows-plugins', 'nscp' ].
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
Configures the Icinga 2 feature api.
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",
}
...
class { 'icinga2::feature::api':
pki => 'none',
ssl_cacert => '-----BEGIN CERTIFICATE----- ...',
ssl_key => '-----BEGIN RSA PRIVATE KEY----- ...',
ssl_cert => '-----BEGIN CERTIFICATE----- ...',
}
class { '::icinga2::feature::api':
ssl_protocolmin => 'TLSv1.2',
ssl_cipher_list => 'HIGH:MEDIUM:!aNULL:!MD5:!RC4',
}
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',
}
The following parameters are available in the icinga2::feature::api
class.
Data type: Enum['absent', 'present']
Set to present enables the feature api, absent disabled it.
Default value: present
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.
- 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'
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
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
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
Data type: Optional[Stdlib::Absolutepath]
Optional location of the certificate revocation list.
Default value: undef
Data type: Optional[Boolean]
Accept zone configuration.
Default value: undef
Data type: Optional[Boolean]
Accept remote commands.
Default value: undef
Data type: Optional[Integer[0]]
Limit the number of anonymous client connections (not configured endpoints and signing requests).
Default value: undef
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
Data type: Stdlib::Port::Unprivileged
Port of the 'ca_host'.
Default value: 5665
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 -sha1 -inform pem -in [certificate-file.crt]'
on your CA host.
Default value: undef
Data type: 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.
Default value: 'TicketSalt'
Data type: Optional[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
Data type: Hash[String, Hash]
Hash to configure endpoint objects. NodeName
is a icnga2 constant.
Default value: { 'NodeName' => {} }
Data type: Hash[String, Hash]
Hash to configure zone objects. ZoneName
and NodeName
are icinga2 constants.
Default value: { 'ZoneName' => { endpoints => [ 'NodeName' ] } }
Data type: Optional[Enum['TLSv1', 'TLSv1.1', 'TLSv1.2']]
Minimal TLS version to require.
Default value: undef
Data type: Optional[Icinga2::Interval]
TLS Handshake timeout.
Default value: undef
Data type: Optional[String]
List of allowed TLS ciphers, to finetune encryption.
Default value: undef
Data type: Optional[Stdlib::Host]
The IP address the api listener will be bound to.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
The port the api listener will be bound to.
Default value: undef
Data type: Optional[Array[String]]
Specifies an array of origin URLs that may access the API.
Default value: undef
Data type: Optional[Boolean]
Indicates whether or not the actual request can be made using credentials.
Default value: undef
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
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
Data type: Optional[String]
Used as suffix in TLS SNI extension name; default from constant ApiEnvironment, which is empty.
Default value: undef
Configures the Icinga 2 feature checker.
- Note Deprecated in Icinga 2.11, replaced by global constant MaxConcurrentChecks which will be set if you still use concurrent_checks.
The following parameters are available in the icinga2::feature::checker
class.
Data type: Enum['absent', 'present']
Set to present enables the feature checker, absent disabled it.
Default value: present
Data type: Optional[Integer[1]]
The maximum number of concurrent checks.
Default value: undef
Configures the Icinga 2 feature command.
The following parameters are available in the icinga2::feature::command
class.
Data type: Enum['absent', 'present']
Set to present to enable the feature command, absent to disabled it.
Default value: present
Data type: Optional[Stdlib::Absolutepath]
Absolute path to the command pipe.
Default value: undef
Configures the Icinga 2 feature compatlog.
The following parameters are available in the icinga2::feature::compatlog
class.
Data type: Enum['absent', 'present']
Set to present enables the feature compatlog, absent disabled it.
Default value: present
Data type: Optional[Stdlib::Absolutepath]
Absolute path to the log directory.
Default value: undef
Data type: Optional[Enum['DAILY', 'HOURLY', 'MONTHLY', 'WEEKLY']]
Sets how often should the log file be rotated.
Default value: undef
Configures the Icinga 2 feature mainlog.
The following parameters are available in the icinga2::feature::debuglog
class.
Data type: Enum['absent', 'present']
Set to present enables the feature mainlog, absent disables it.
Default value: present
Data type: Stdlib::Absolutepath
Absolute path to the log file.
Default value: "${::icinga2::globals::log_dir}/debug.log"
Configures the Icinga 2 feature elasticsearch.
class { 'icinga2::feature::elasticsearch':
host => "10.10.0.15",
index => "icinga2"
}
The following parameters are available in the icinga2::feature::elasticsearch
class.
Data type: Enum['absent', 'present']
Set to present enables the feature elasticsearch, absent disables it.
Default value: present
Data type: Optional[Stdlib::Host]
Elasticsearch host address.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
Elasticsearch HTTP port.
Default value: undef
Data type: Optional[String]
Elasticsearch index name.
Default value: undef
Data type: Optional[String]
Elasticsearch user name.
Default value: undef
Data type: Optional[String]
Elasticsearch user password.
Default value: undef
Data type: Optional[Boolean]
Either enable or disable SSL. Other SSL parameters are only affected if this is set to 'true'.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the private key.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the certificate.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the CA certificate.
Default value: undef
Data type: Optional[String]
The private key in a base64 encoded string to store in spicified ssl_key_path file.
Default value: undef
Data type: Optional[String]
The certificate in a base64 encoded to store in spicified ssl_cert_path file.
Default value: undef
Data type: Optional[String]
The CA root certificate in a base64 encoded string to store in spicified ssl_cacert_path file.
Default value: undef
Data type: Optional[Boolean]
Whether to send check performance data metrics.
Default value: undef
Data type: Optional[Icinga2::Interval]
How long to buffer data points before transferring to Elasticsearch.
Default value: undef
Data type: Optional[Integer]
How many data points to buffer before forcing a transfer to Elasticsearch.
Default value: undef
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Configures the Icinga 2 feature gelf.
The following parameters are available in the icinga2::feature::gelf
class.
Data type: Enum['absent', 'present']
Set to present enables the feature gelf, absent disables it.
Default value: present
Data type: Optional[Stdlib::Host]
GELF receiver host address.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
GELF receiver port.
Default value: undef
Data type: Optional[String]
Source name for this instance.
Default value: undef
Data type: Optional[Boolean]
Enable performance data for 'CHECK RESULT' events.
Default value: undef
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Configures the Icinga 2 feature graphite.
class { '::icinga2::feature::graphite':
host => '10.10.0.15',
port => 2003,
enable_send_thresholds => true,
enable_send_metadata => true,
}
The following parameters are available in the icinga2::feature::graphite
class.
Data type: Enum['absent', 'present']
Set to present enables the feature graphite, absent disabled it.
Default value: present
Data type: Optional[Stdlib::Host]
Graphite Carbon host address.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
Graphite Carbon port.
Default value: undef
Data type: Optional[String]
Template for metric path of hosts.
Default value: undef
Data type: Optional[String]
Template for metric path of services.
Default value: undef
Data type: Optional[Boolean]
Default value: undef
Data type: Optional[Boolean]
Default value: undef
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Configures the Icinga 2 feature icingadb.
The following parameters are available in the icinga2::feature::icingadb
class.
Data type: Enum['absent', 'present']
Set to present, enables the feature icingadb, absent disabled it.
Default value: present
Data type: Optional[Stdlib::Host]
IcingaDB Redis host address.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
IcingaDB Redis port.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
IcingaDB Redis unix sockt. Can be used instead of host and port attributes.
Default value: undef
Data type: Optional[String]
IcingaDB Redis password.
Default value: undef
Installs and configures the Icinga 2 feature ido-mysql.
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']
}
The following parameters are available in the icinga2::feature::idomysql
class.
Data type: Enum['absent', 'present']
Set to present enables the feature ido-mysql, absent disables it.
Default value: present
Data type: Stdlib::Host
MySQL database host address.
Default value: 'localhost'
Data type: Optional[Stdlib::Port::Unprivileged]
MySQL database port.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
MySQL socket path.
Default value: undef
Data type: String
MySQL database user with read/write permission to the icinga database.
Default value: 'icinga'
Data type: String
MySQL database user's password.
Data type: String
MySQL database name.
Default value: 'icinga'
Data type: Boolean
Either enable or disable SSL/TLS. Other SSL parameters are only affected if this is set to 'true'.
Default value: false
Data type: Optional[Stdlib::Absolutepath]
Location of the private key. Only valid if ssl is enabled.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the certificate. Only valid if ssl is enabled.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the CA certificate. Only valid if ssl is enabled.
Default value: undef
Data type: Optional[String]
The private key in a base64 encoded string to store in spicified ssl_key_path file. Only valid if ssl is enabled.
Default value: undef
Data type: Optional[String]
The certificate in a base64 encoded string to store in spicified ssl_cert_path file. Only valid if ssl is enabled.
Default value: undef
Data type: Optional[String]
The CA root certificate in a base64 encoded string to store in spicified ssl_cacert_path file. Only valid if ssl is enabled.
Default value: undef
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
Data type: Optional[String]
MySQL SSL list of allowed ciphers. Only valid if ssl is enabled.
Default value: undef
Data type: Optional[String]
MySQL database table prefix.
Default value: undef
Data type: Optional[String]
Unique identifier for the local Icinga 2 instance.
Default value: undef
Data type: Optional[String]
Description for the Icinga 2 instance.
Default value: undef
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Data type: Optional[Icinga2::Interval]
Set the failover timeout in a HA cluster. Must not be lower than 60s.
Default value: undef
Data type: Optional[Hash[String,Icinga2::Interval]]
Hash with items for historical table cleanup.
Default value: undef
Data type: Optional[Array]
Array of information types that should be written to the database.
Default value: undef
Data type: Boolean
Whether to import the MySQL schema or not.
Default value: false
Installs and configures the Icinga 2 feature ido-pgsql.
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_password('icinga2', 'supersecret'),
}
class{ 'icinga2::feature::idopgsql':
user => "icinga2",
password => "supersecret",
database => "icinga2",
import_schema => true,
require => Postgresql::Server::Db['icinga2']
}
The following parameters are available in the icinga2::feature::idopgsql
class.
Data type: Enum['absent', 'present']
Set to present enables the feature ido-pgsql, absent disables it.
Default value: present
Data type: Stdlib::Host
PostgreSQL database host address.
Default value: 'localhost'
Data type: Stdlib::Port::Unprivileged
PostgreSQL database port.
Default value: 5432
Data type: String
PostgreSQL database user with read/write permission to the icinga database.
Default value: 'icinga'
Data type: String
PostgreSQL database user's password.
Data type: String
PostgreSQL database name.
Default value: 'icinga'
Data type: Optional[String]
PostgreSQL database table prefix.
Default value: undef
Data type: Optional[String]
Unique identifier for the local Icinga 2 instance.
Default value: undef
Data type: Optional[String]
Description of the Icinga 2 instance.
Default value: undef
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Data type: Optional[Icinga2::Interval]
Set the failover timeout in a HA cluster. Must not be lower than 60s.
Default value: undef
Data type: Optional[Hash]
Hash with items for historical table cleanup.
Default value: undef
Data type: Optional[Array]
Array of information types that should be written to the database.
Default value: undef
Data type: Boolean
Whether to import the PostgreSQL schema or not.
Default value: false
Configures the Icinga 2 feature influxdb.
class { 'icinga2::feature::influxdb':
host => "10.10.0.15",
username => "icinga2",
password => "supersecret",
database => "icinga2"
}
The following parameters are available in the icinga2::feature::influxdb
class.
Data type: Enum['absent', 'present']
Set to present enables the feature influxdb, absent disables it.
Default value: present
Data type: Optional[Stdlib::Host]
InfluxDB host address.
Default value: undef
Data type: Optional[Stdlib::Port]
InfluxDB HTTP port.
Default value: undef
Data type: Optional[String]
InfluxDB database name.
Default value: undef
Data type: Optional[String]
InfluxDB user name.
Default value: undef
Data type: Optional[String]
InfluxDB user password.
Default value: undef
Data type: Optional[Boolean]
Either enable or disable SSL. Other SSL parameters are only affected if this is set to 'true'.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the private key.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the certificate.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Location of the CA certificate.
Default value: undef
Data type: Optional[String]
The private key in a base64 encoded string to store in ssl_key_path file.
Default value: undef
Data type: Optional[String]
The certificate in a base64 encoded string to store in ssl_cert_path file.
Default value: undef
Data type: Optional[String]
The CA root certificate in a base64 encoded to store in ssl_cacert_path file.
Default value: undef
Data type: String
The value of this is used for the measurement setting in host_template.
Default value: '$host.check_command$'
Data type: Hash
Tags defined in this hash will be set in the host_template.
Default value: { hostname => '$host.name$' }
Data type: String
The value of this is used for the measurement setting in host_template.
Default value: '$service.check_command$'
Data type: Hash
Tags defined in this hash will be set in the service_template.
Default value: { hostname => '$host.name$', service => '$service.name$' }
Data type: Optional[Boolean]
Whether to send warn, crit, min & max tagged data.
Default value: undef
Data type: Optional[Boolean]
Whether to send check metadata e.g. states, execution time, latency etc.
Default value: undef
Data type: Optional[Icinga2::Interval]
How long to buffer data points before transfering to InfluxDB.
Default value: undef
Data type: Optional[Integer[1]]
How many data points to buffer before forcing a transfer to InfluxDB.
Default value: undef
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Configures the Icinga 2 feature livestatus.
The following parameters are available in the icinga2::feature::livestatus
class.
Data type: Enum['absent', 'present']
Set to present enables the feature livestatus, absent disables it.
Default value: present
Data type: Optional[Enum['tcp', 'unix']]
Specifies the socket type. Can be either 'tcp' or 'unix'.
Default value: undef
Data type: Optional[Stdlib::Host]
IP address to listen for connections. Only valid when socket_type is 'tcp'.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
Port to listen for connections. Only valid when socket_type is 'tcp'.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specifies the path to the UNIX socket file. Only valid when socket_type is 'unix'.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Required for historical table queries. Requires CompatLogger feature to be enabled.
Default value: undef
Configures the Icinga 2 feature mainlog.
The following parameters are available in the icinga2::feature::mainlog
class.
Data type: Enum['absent', 'present']
Set to 'present' enables the feature mainlog, 'absent' disabled it.
Default value: present
Data type: Icinga2::LogSeverity
You can set the log severity to 'information', 'notice', 'warning' or 'debug'.
Default value: 'information'
Data type: Stdlib::Absolutepath
Absolute path to the log file.
Default value: "${::icinga2::globals::log_dir}/icinga2.log"
Configures the Icinga 2 feature notification.
The following parameters are available in the icinga2::feature::notification
class.
Data type: Enum['absent', 'present']
Set to present enables the feature notification, absent disabled it.
Default value: present
Data type: Optional[Boolean]
Notifications are load-balanced amongst all nodes in a zone.
Default value: undef
Configures the Icinga 2 feature opentsdb.
The following parameters are available in the icinga2::feature::opentsdb
class.
Data type: Enum['absent', 'present']
Set to present enables the feature opentsdb, absent disables it.
Default value: present
Data type: Optional[Stdlib::Host]
OpenTSDB host address.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
OpenTSDB port.
Default value: undef
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Configures the Icinga 2 feature perfdata.
The following parameters are available in the icinga2::feature::perfdata
class.
Data type: Enum['absent', 'present']
Set to present enables the feature perfdata, absent disables it.
Default value: present
Data type: Optional[Stdlib::Absolutepath]
Absolute path to the perfdata file for hosts.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Absolute path to the perfdata file for services.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Path to the temporary host file.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Path to the temporary service file.
Default value: undef
Data type: Optional[String]
Host Format template for the performance data file.
Default value: undef
Data type: Optional[String]
Service Format template for the performance data file.
Default value: undef
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
Data type: Optional[Boolean]
Enable the high availability functionality. Only valid in a cluster setup.
Default value: undef
Configures the Icinga 2 feature statusdata.
The following parameters are available in the icinga2::feature::statusdata
class.
Data type: Enum['absent', 'present']
Set to present enables the feature statusdata, absent disables it.
Default value: present
Data type: Optional[Stdlib::Absolutepath]
Absolute path to the status.dat file.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Absolute path to the object.cache file.
Default value: undef
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
Configures the Icinga 2 feature syslog.
The following parameters are available in the icinga2::feature::syslog
class.
Data type: Enum['absent', 'present']
Set to present enables the feature syslog, absent disables it.
Default value: present
Data type: Optional[Icinga2::LogSeverity]
You can choose the log severity between information, notice, warning or debug.
Default value: undef
Data type: Optional[Icinga2::LogFacility]
Defines the facility to use for syslog entries. This can be a facility constant like FacilityDaemon.
Default value: undef
This class provides multiple ways to create the CA used by Icinga 2.
include icinga2
include icinga2::pki::ca
include icinga2
class { 'icinga2::pki::ca':
ca_cert => '-----BEGIN CERTIFICATE----- ...',
ca_key => '-----BEGIN RSA PRIVATE KEY----- ...',
}
The following parameters are available in the icinga2::pki::ca
class.
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
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
Set a code fragment in a target configuration file.
To create a custom configuration add content to a specified target at the position you set in the order parameter. You can use also templates to add content.
include ::icinga2
icinga2::object::service { 'load':
display_name => 'Load',
apply => true,
check_command => 'load',
assign => ['vars.os == Linux'],
target => '/etc/icinga2/conf.d/service_load.conf',
order => 30,
}
icinga2::config::fragment { 'load-function':
target => '/etc/icinga2/conf.d/service_load.conf',
order => 10,
content => 'vars.load_wload1 = {{
if (get_time_period("backup").is_inside) {
return 20
} else {
return 5
}
}}',
}
The following parameters are available in the icinga2::config::fragment
defined type.
Data type: String
Content to insert in file specified in target.
Data type: Stdlib::Absolutepath
Destination config file to store in this fragment. File will be declared the first time.
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'
Data type: String
Default value: $title
Manage Icinga 2 ApiUser objects.
::icinga2::object::apiuser { 'director':
ensure => present,
password => 'Eih5Weefoo2oa8sh',
permissions => [ '*' ],
target => '/etc/icinga2/conf.d/api-users.conf',
}
::icinga2::object::apiuser { 'icingaweb2':
ensure => present,
password => '12e2ef553068b519',
permissions => [ 'status/query', 'actions/*', 'objects/modify/*', 'objects/query/*' ],
target => '/etc/icinga2/conf.d/api-users.conf',
}
::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',
}
The following parameters are available in the icinga2::object::apiuser
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the name of the apiuser object.
Default value: $title
Data type: Optional[String]
Password string.
Default value: undef
Data type: Optional[String]
Optional. Client Common Name (CN).
Default value: undef
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
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared at the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 30
Manage Icinga 2 Host objects.
The following parameters are available in the icinga2::object::checkcommand
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Title of the CheckCommand object.
Default value: $title
Data type: Array
Sorted List of templates to include.
Default value: []
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
Data type: Optional[Hash]
A dictionary of macros which should be exported as environment variables prior to executing the command.
Default value: undef
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
Data type: Optional[Integer[1]]
The command timeout in seconds.
Default value: undef
Data type: Optional[Variant[Hash, String]]
A dictionary of command arguments.
Default value: undef
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 15
Manage Icinga 2 CheckResultReader objects.
The following parameters are available in the icinga2::object::checkresultreader
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the ceckresultreader object.
Default value: $title
Data type: Optional[Stdlib::Absolutepath]
The directory which contains the check result files.
Default value: undef
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: '05'
Manage Icinga 2 dependency objects.
The following parameters are available in the icinga2::object::dependency
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the dependency object.
Default value: $title
Data type: Optional[String]
The parent host.
Default value: undef
Data type: Optional[String]
The parent service. If omitted, this dependency object is treated as host dependency.
Default value: undef
Data type: Optional[String]
The child host.
Default value: undef
Data type: Optional[String]
The child service. If omitted, this dependency object is treated as host dependency.
Default value: undef
Data type: Optional[Boolean]
Whether to disable checks when this dependency fails.
Default value: undef
Data type: Optional[Boolean]
Whether to disable notifications when this dependency fails. true.
Default value: undef
Data type: Optional[Boolean]
Whether to ignore soft states for the reachability calculation. true.
Default value: undef
Data type: Optional[String]
Time period during which this dependency is enabled.
Default value: undef
Data type: Optional[Array]
A list of state filters when this dependency should be OK.
Default value: undef
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
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
Data type: Enum['Host', 'Service']
An object type on which to target the apply rule. Valid values are Host
and Service
.
Default value: 'Host'
Data type: Array
Assign user group members using the group assign rules.
Default value: []
Data type: Array
Exclude users using the group ignore rules.
Default value: []
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 70
Manage Icinga 2 endpoint objects.
The following parameters are available in the icinga2::object::endpoint
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the endpoint object.
Default value: $title
Data type: Optional[Stdlib::Host]
Optional. The IP address of the remote Icinga 2 instance.
Default value: undef
Data type: Optional[Stdlib::Port::Unprivileged]
The service name/port of the remote Icinga 2 instance.
Default value: undef
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
Data type: Optional[Stdlib::Absolutepath]
Destination config file to store in this object. File will be declared at the first time.
Default value: undef
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 40
Manage Icinga 2 EventCommand objects.
The following parameters are available in the icinga2::object::eventcommand
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the eventcommand object.
Default value: $title
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.
Default value: undef
Data type: Optional[Hash]
A dictionary of macros which should be exported as environment variables prior to executing the command.
Default value: undef
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
Data type: Optional[Integer[1]]
The command timeout in seconds.
Default value: undef
Data type: Optional[Hash]
A dictionary of command arguments.
Default value: undef
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 20
Manage Icinga 2 Host objects.
The following parameters are available in the icinga2::object::host
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Hostname of the Host object.
Default value: $title
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Optional[String]
A short description of the host (e.g. displayed by external interfaces instead of the name if set).
Default value: undef
Data type: Optional[Stdlib::Host]
The host's address v4.
Default value: undef
Data type: Optional[Stdlib::Host]
The host's address v6.
Default value: undef
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
Data type: Optional[Array]
A list of host groups this host belongs to.
Default value: undef
Data type: Optional[String]
The name of the check command.
Default value: undef
Data type: Optional[Integer[1]]
The number of times a host is re-checked before changing into a hard state.
Default value: undef
Data type: Optional[String]
The name of a time period which determines when this host should be checked.
Default value: undef
Data type: Optional[Icinga2::Interval]
Check command timeout in seconds. Overrides the CheckCommand's timeout attribute.
Default value: undef
Data type: Optional[Icinga2::Interval]
The check interval (in seconds). This interval is used for checks when the host is in a HARD state.
Default value: undef
Data type: Optional[Icinga2::Interval]
The retry interval (in seconds). This interval is used for checks when the host is in a SOFT state.
Default value: undef
Data type: Optional[Boolean]
Whether notifications are enabled.
Default value: undef
Data type: Optional[Boolean]
Whether active checks are enabled.
Default value: undef
Data type: Optional[Boolean]
Whether passive checks are enabled.
Default value: undef
Data type: Optional[Boolean]
Enables event handlers for this host.
Default value: undef
Data type: Optional[Boolean]
Whether flap detection is enabled.
Default value: undef
Data type: Optional[Boolean]
Whether performance data processing is enabled.
Default value: undef
Data type: Optional[String]
The name of an event command that should be executed every time the host's state changes or the host is in a SOFT state.
Default value: undef
Data type: Optional[Integer[1]]
Flapping lower bound in percent for a host to be considered not flapping.
Default value: undef
Data type: Optional[Integer[1]]
Flapping upper bound in percent for a host to be considered flapping.
Default value: undef
Data type: Optional[Boolean]
The volatile setting enables always HARD state types if NOT-OK state changes occur.
Default value: undef
Data type: Optional[String]
The zone this object is a member of.
Default value: undef
Data type: Optional[String]
The endpoint where commands are executed on.
Default value: undef
Data type: Optional[String]
Notes for the host.
Default value: undef
Data type: Optional[String]
Url for notes for the host (for example, in notification commands).
Default value: undef
Data type: Optional[String]
Url for actions for the host (for example, an external graphing tool).
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Icon image for the host. Used by external interfaces only.
Default value: undef
Data type: Optional[String]
Icon image description for the host. Used by external interface only.
Default value: undef
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 50
Manage Icinga 2 HostGroup objects.
icinga2::object::hostgroup { 'monitoring-hosts':
display_name => 'Linux Servers',
groups => [ 'linux-servers' ],
target => '/etc/icinga2/conf.d/groups2.conf',
assign => [ 'host.name == NodeName' ],
}
The following parameters are available in the icinga2::object::hostgroup
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: Optional[String]
A short description of the host group.
Default value: undef
Data type: Optional[Array]
An array of nested group names.
Default value: undef
Data type: Array
Assign host group members using the group rules.
Default value: []
Data type: Array
Ignore host group members using the group rules.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared at the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 55
Data type: String
Default value: $title
Manage Icinga 2 notification objects.
The following parameters are available in the icinga2::object::notification
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the notification object.
Default value: $title
Data type: Optional[String]
The name of the host this notification belongs to.
Default value: undef
Data type: Optional[String]
The short name of the service this notification belongs to. If omitted, this notification object is treated as host notification.
Default value: undef
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
Data type: Optional[Variant[String, Array]]
A list of user names who should be notified.
Default value: undef
Data type: Optional[Variant[String, Array]]
A list of user group names who should be notified.
Default value: undef
Data type: Optional[Hash]
A dictionary containing begin and end attributes for the notification.
Default value: undef
Data type: Optional[String]
The name of the notification command which should be executed when the notification is triggered.
Default value: undef
Data type: Optional[Variant[Icinga2::Interval,Pattern[/(host|service)\./]]]
The notification interval (in seconds). This interval is used for active notifications.
Default value: undef
Data type: Optional[String]
The name of a time period which determines when this notification should be triggered.
Default value: undef
Data type: Optional[String]
The zone this object is a member of.
Default value: undef
Data type: Optional[Variant[Array, String]]
A list of type filters when this notification should be triggered.
Default value: undef
Data type: Optional[Variant[Array, String]]
A list of state filters when this notification should be triggered.
Default value: undef
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
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
Data type: Variant[Boolean, String]
Set notification_name as prefix in front of 'apply for'. Only effects if apply is a string.
Default value: false
Data type: Enum['Host', 'Service']
An object type on which to target the apply rule. Valid values are Host
and Service
.
Default value: 'Host'
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 85
Data type: Array
Default value: []
Data type: Array
Default value: []
Manage Icinga 2 notificationcommand objects.
The following parameters are available in the icinga2::object::notificationcommand
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the notificationcommand object.
Default value: $title
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.
Default value: undef
Data type: Optional[Hash]
A dictionary of macros which should be exported as environment variables prior to executing the command.
Default value: undef
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
Data type: Optional[Integer[1]]
The command timeout in seconds.
Default value: undef
Data type: Optional[Hash]
A dictionary of command arguments.
Default value: undef
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 25
Manage Icinga 2 scheduleddowntime objects.
The following parameters are available in the icinga2::object::scheduleddowntime
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the scheduleddowntime object.
Default value: $title
Data type: Optional[String]
The name of the host this comment belongs to.
Default value: undef
Data type: Optional[String]
The short name of the service this comment belongs to. If omitted, this comment object is treated as host comment.
Default value: undef
Data type: Optional[String]
The author's name.
Default value: undef
Data type: Optional[String]
The comment text.
Default value: undef
Data type: Optional[Boolean]
Whether this is a fixed downtime.
Default value: undef
Data type: Optional[Icinga2::Interval]
The duration as number.
Default value: undef
Data type: Optional[Hash]
A dictionary containing information which days and durations apply to this timeperiod.
Default value: undef
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
Data type: Variant[Boolean, String]
Set scheduleddowntime_name as prefix in front of 'apply for'. Only effects if apply is a string.
Default value: false
Data type: Enum['Host', 'Service']
An object type on which to target the apply rule. Valid values are Host
and Service
.
Default value: 'Host'
Data type: Array
Assign user group members using the group assign rules.
Default value: []
Data type: Array
Exclude users using the group ignore rules.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 90
Manage Icinga 2 service objects.
::icinga2::object::service { 'ping4':
import => ['generic-service'],
apply => true,
check_command => 'ping',
assign => ['host.address'],
target => '/etc/icinga2/zones.d/global-templates/services.conf',
}
A apply Service for (disk_name =>config in host.vars.disks)
rule is applied to all Linux hosts with an Icinga Agent. Note in this example it's required that the endpoint (see command_endpoint
) and the host object has the same name!
::icinga2::object::service { 'linux_disks':
import => ['generic-service'],
apply => 'disk_name => config in host.vars.disks',
check_command => 'disk',
command_endpoint => 'host.name',
vars => '+ config',
assign => ['host.vars.os == Linux'],
ignore => ['host.vars.noagent'],
target => '/etc/icinga2/zones.d/global-templates/services.conf',
}
The following parameters are available in the icinga2::object::service
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the service object.
Default value: $title
Data type: Optional[String]
A short description of the service.
Default value: undef
Data type: Optional[String]
The host this service belongs to. There must be a Host object with that name.
Default value: undef
Data type: Optional[Array]
The service groups this service belongs to.
Default value: undef
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
Data type: Optional[String]
The name of the check command.
Default value: undef
Data type: Optional[Integer[1]]
The number of times a service is re-checked before changing into a hard state.
Default value: undef
Data type: Optional[String]
The name of a time period which determines when this service should be checked.
Default value: undef
Data type: Optional[Icinga2::Interval]
Check command timeout in seconds. Overrides the CheckCommand's timeout attribute.
Default value: undef
Data type: Optional[Icinga2::Interval]
The check interval (in seconds). This interval is used for checks when the service is in a HARD state.
Default value: undef
Data type: Optional[Icinga2::Interval]
The retry interval (in seconds). This interval is used for checks when the service is in a SOFT state.
Default value: undef
Data type: Optional[Boolean]
Whether notifications are enabled.
Default value: undef
Data type: Optional[Boolean]
Whether active checks are enabled.
Default value: undef
Data type: Optional[Boolean]
Whether passive checks are enabled.
Default value: undef
Data type: Optional[Boolean]
Enables event handlers for this host.
Default value: undef
Data type: Optional[Boolean]
Whether flap detection is enabled.
Default value: undef
Data type: Optional[Boolean]
Whether performance data processing is enabled.
Default value: undef
Data type: Optional[String]
The name of an event command that should be executed every time the service's state changes or the service is in a SOFT state.
Default value: undef
Data type: Optional[Integer[1]]
Flapping lower bound in percent for a host to be considered not flapping.
Default value: undef
Data type: Optional[Integer[1]]
Flapping upper bound in percent for a host to be considered flapping.
Default value: undef
Data type: Optional[Boolean]
The volatile setting enables always HARD state types if NOT-OK state changes occur.
Default value: undef
Data type: Optional[String]
The zone this object is a member of.
Default value: undef
Data type: Optional[String]
The endpoint where commands are executed on.
Default value: undef
Data type: Optional[String]
Notes for the service.
Default value: undef
Data type: Optional[String]
Url for notes for the service (for example, in notification commands).
Default value: undef
Data type: Optional[String]
Url for actions for the service (for example, an external graphing tool).
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Icon image for the service. Used by external interfaces only.
Default value: undef
Data type: Optional[String]
Icon image description for the service. Used by external interface only.
Default value: undef
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
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
Data type: Variant[Boolean, String]
Set service_name as prefix in front of 'apply for'. Only effects if apply is a string.
Default value: false
Data type: Array
Assign user group members using the group assign rules.
Default value: []
Data type: Array
Exclude users using the group ignore rules.
Default value: []
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 60
Manage Icinga 2 servicegroup objects.
The following parameters are available in the icinga2::object::servicegroup
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the servicegroup object.
Default value: $title
Data type: Optional[String]
A short description of the service group.
Default value: undef
Data type: Optional[Array]
An array of nested group names.
Default value: undef
Data type: Array
Assign user group members using the group assign rules.
Default value: []
Data type: Array
Exclude users using the group ignore rules.
Default value: []
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 65
Manage Icinga 2 timeperiod objects.
The following parameters are available in the icinga2::object::timeperiod
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the timeperiod object.
Default value: $title
Data type: Optional[String]
A short description of the time period.
Default value: undef
Data type: Array
Sorted List of templates to include.
Default value: ['legacy-timeperiod']
Data type: Optional[Hash]
A dictionary containing information which days and durations apply to this timeperiod.
Default value: undef
Data type: Optional[Boolean]
Boolean whether to prefer timeperiods includes or excludes.
Default value: undef
Data type: Optional[Array]
An array of timeperiods, which should exclude from your timerange.
Default value: undef
Data type: Optional[Array]
An array of timeperiods, which should include into your timerange
Default value: undef
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Stdlib::Absolutepath
Destination config file to store this object in. File will be declared on the first run.
Data type: Variant[String, Integer]
String or integer to control the position in the target file, sorted alpha numeric.
Default value: 35
Manage Icinga 2 user objects.
The following parameters are available in the icinga2::object::user
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the user object.
Default value: $title
Data type: Optional[String]
A short description of the user.
Default value: undef
Data type: Optional[String]
An email string for this user. Useful for notification commands.
Default value: undef
Data type: Optional[String]
A pager string for this user. Useful for notification commands.
Default value: undef
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
Data type: Optional[Array]
An array of group names.
Default value: undef
Data type: Optional[Boolean]
Whether notifications are enabled for this user.
Default value: undef
Data type: Optional[String]
The name of a time period which determines when a notification for this user should be triggered.
Default value: undef
Data type: Optional[Array]
A set of type filters when this notification should be triggered. everything is matched.
Default value: undef
Data type: Optional[Array]
A set of state filters when this notification should be triggered.
Default value: undef
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 75
Manage Icinga 2 usergroup objects.
The following parameters are available in the icinga2::object::usergroup
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the usergroup object.
Default value: $title
Data type: Optional[String]
A short description of the service group.
Default value: undef
Data type: Array
An array of nested group names.
Default value: []
Data type: Array
Assign user group members using the group assign rules.
Default value: []
Data type: Array
Exclude users using the group ignore rules.
Default value: []
Data type: Boolean
Set to true creates a template instead of an object.
Default value: false
Data type: Array
Sorted List of templates to include.
Default value: []
Data type: Stdlib::Absolutepath
Destination config file to store in this object. File will be declared the first time.
Data type: Variant[String, Integer]
String or integer to set the position in the target file, sorted alpha numeric.
Default value: 80
Manage Icinga 2 zone objects.
The following parameters are available in the icinga2::object::zone
defined type.
Data type: Enum['absent', 'present']
Set to present enables the object, absent disables it.
Default value: present
Data type: String
Set the Icinga 2 name of the zone object.
Default value: $title
Data type: Optional[Array]
List of endpoints belong to this zone.
Default value: []
Data type: Optional[String]
Parent zone to this zone.
Default value: undef
Data type: Optional[Boolean]
If set to true, a global zone is defined and the parameter endpoints and parent are ignored.
Default value: false
Data type: Optional[Stdlib::Absolutepath]
Destination config file to store in this object. File will be declared at the first time.
Default value: undef
Data type: Variant[String, Integer]
String or integer to control the position in the target file, sorted alpha numeric.
Default value: 45
Type: Ruby 4.x API
---- original file header ----
---- original file header ----
Returns: Data type
Describe what the function returns here
Data type: Any
The original array of arguments. Port this to individually managed params to get the full benefit of the modern function API.
Type: Ruby 4.x API
---- original file header ----
---- original file header ----
Returns: Data type
Describe what the function returns here
Data type: Any
The original array of arguments. Port this to individually managed params to get the full benefit of the modern function API.
Type: Ruby 3.x API
Wrapper for config parser
The icinga2_attributes function.
Returns: Any
Parsed config as string
Type: Ruby 3.x API
Generates a auth ticket to get a certificate
The icinga2_ticket_id function.
Returns: Any
The ticket to get a certificate
A type for the structure of custom attributes
Alias of Optional[Variant[String, Array[Variant[String, Hash]], Hash]]
Type for certificate fingerprints
Alias of Pattern[/^([0-9a-fA-F]{2}\:){19}[0-9,a-f,A-F]{2}$/]
A strict type for intervals
Alias of Pattern[/^\d+\.?\d*[d|h|m|s]?$/]
A strict type of syslog facilities
Alias of Variant[Enum['LOG_AUTH', 'LOG_AUTHPRIV', 'LOG_CRON', 'LOG_DAEMON', 'LOG_FTP', 'LOG_KERN', 'LOG_LPR', 'LOG_MAIL', 'LOG_NEWS', 'LOG_SYSLOG', 'LOG_USER', 'LOG_UUCP'], Pattern[/^LOG_LOCAL[0-7]$/]]
A strict type for log levels
Alias of Enum['debug', 'information', 'notice', 'warning', 'critical']