Different LWRP usage examples are added to examples
directory.
To configure icinga2 server, check examples/icinga2_server
directory. More examples will be added as we go.
assign where (icinga) = assign_where (LWRP)
ignore where (icinga) = ignore_where (LWRP)
assign where
statements are defined as a LWRP resource Array
attribute -assign_where
. Each array element is treated as a different assign where
statement and LWRP creates a separate statement.
e.g.
assign_where ['host.address',
'host.vars.nrpe && host.vars.enable_check',
'host.vars.application == "redis"'
]
Above LWRP resource will be applied to an Object
as shown below:
assign where host.address
assign where host.vars.nrpe && host.vars.enable_check
assign where host.vars.application == "redis"
Similarly, ignore where
statements are created using LWRP resource Array
attribute ignore_where
.
Currently icinga2 cookbook supports below Objects LWRP Resources:
- icinga2_apilistener
- icinga2_apiuser
- icinga2_applynotification
- icinga2_applyservice
- icinga2_checkcommand
- icinga2_endpoint
- icinga2_envendpoint
- icinga2_envhostgroup
- icinga2_envzone
- icinga2_environment
- icinga2_eventcommand
- icinga2_externalcommandlistener
- icinga2_feature
- icinga2_gelfwriter
- icinga2_graphitewriter
- icinga2_influxdbwriter
- icinga2_host
- icinga2_hostgroup
- icinga2_idomysqlconnection
- icinga2_idopgsqlconnection
- icinga2_notification
- icinga2_notificationcommand
- icinga2_scheduleddowntime
- icinga2_script
- icinga2_service
- icinga2_servicegroup
- icinga2_sysloglogger
- icinga2_timeperiod
- icinga2_user
- icinga2_usergroup
- icinga2_zone
- icinga2_livestatuslistener
- icinga2_statusdatawriter
- icinga2_compatlogger
- icinga2_checkresultreader
- icinga2_notificationcomponent
- icinga2_filelogger
- icinga2_perfdatawriter
Note:
-
Few of LWRP attributes which are required to create an icinga2 Object are not declared
:required => true
in LWRP in favour of creating icinga2 Object template. -
Same LWRP resource used to create icinga2
Object
, can also be used to create icinga2Template
as well. -
Few of LWRP resource attributes which refers to icinga2
constants
or can refer toconstants
are treated as literalString
. It means they will not be transformed into rubyString
by LWRP while creating configuration file.
e.g.
Below attribute definition generate correct syntax for ApiListener
LWRP attribute cert_path
:
cert_path 'SysConf + "/icinga2/pki/" + NodeName + ".crt"'
will transform to:
cert_path SysConf + "/icinga2/pki/" + NodeName + ".crt"
While below attribute definition generate incorrect syntax:
cert_path 'SysConf + /icinga2/pki/ + NodeName + .crt'
will transform to
cert_path SysConf + /icinga2/pki/ + NodeName + .crt
LWRP Resource Object Config File Location
Icinga2 Object
created by LWRP are stored under a separate directory objects.d
. Directory name is configurable by node attribute node['icinga2']['objects_d']
.
This directory is created under icinga2 config directory node['icinga2']['conf_dir']
.
LWRP Resource Object/Template Config File Name Convention
LWRP generated icinga2 Objects are stored into a single file. It means each LWRP has its own conf file.
As few of LWRP can create an Object
and Template
, below conf file name convention is followed through out LWRP resources.
Object conf file : "#{LWRP_NAME}.conf".
Template conf file : "#{LWRP_NAME}_template.conf".
e.g.
LWRP `icinga2_host` object resources will create icinga2
`Host` objects conf file - /etc/icinga2/objects.d/host.conf
LWRP `icinga2_service` object resources will create icinga2
`Service` objects conf file - /etc/icinga2/objects.d/service.conf
LWRP `icinga2_service` template resources will create icinga2
`Service` templates conf file - /etc/icinga2/objects.d/service_template.conf
LWRP `icinga2_applyservice` resources will create icinga2
`apply Service` conf file - /etc/icinga2/objects.d/applyservice.conf
All LWRP generated icinga2 object/template/apply conf files are created in a single directory and managed separately.
As this cookbook supplies almost all necessary LWRP for icinga2 feature, object, template etc. it is a good practice and safe to say to use LWRP instead of managing configuration /etc/icinga2/conf.d
or /etc/icinga2/zones.conf
default configuration files.
Note: Default configuration files managed by cookbook:
- /etc/icinga2/constants.conf
- /etc/icinga2/icinga2.conf
- /etc/icinga2/init.conf
icinga2.conf
no longer includes zones.conf
in favour of LWRP.
As mentioned in a section above, instead of creating Host
objects for each chef node, using LWRP environment
Host
objects can easily be created for all chef nodes for a chef environment.
LWRP resource attributes are common for all the Host
. It may be required to define or override attribute for few specific Host
objects, but it is not yet incorporated or foreseen any usage at this point which might change over time.
Turn Off Monitoring for a Chef Node
To turn off monitoring for a chef node, simply set attribute - node['monitoring_off']
.
If this attribute is set for a chef node, LWRP environment
will simply ignore that node.
LWRP generated config file
There are two files generated by LWRP environment
:
-
if zone is not defined -
host_#{*environment*}_#{*resource_name*}.conf
-
if zone is defined:
host_#{environment*}_#{*zone*}_#{*resource_name*}.conf
Note: Cookbook version prior to v0.7.0 might require to manually delete configuration file
host_#{*environment*}.conf
if zone is defined. Note: Cookbook version prior to v2.7.1 might require to manually delete configuration filehost_#{*environment*}.conf / host_#{*environment*}_#{*zone*}.conf
.
LWRP example
icinga2_environment 'SingaporeDevelopment' do
import node['icinga2']['object']['host']['import']
environment 'development'
limit_region true
ignore_resolv_error true
enable_cluster_hostgroup true
enable_application_hostgroup true
cluster_attribute 'flock'
application_attribute 'application'
check_interval '1m'
retry_interval '10s'
max_check_attempts 3
action_url '/pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_'
end
Above LWRP resource will create Host
objects for a chef environment nodes for a given search_pattern
and other filter.
LWRP Options
- action (optional) - default :create, options: :create, :delete, :reload
- environment (required, String) - chef environment name
- cookbook (optional, String) - default icinga2, chef cookbook name for template
- template (optional, String) - default object.environment.conf.erb, chef template name
- search_pattern (optional, String) - chef search pattern for given environment
- env_resources (optional, Hash) - user provided Hash for environment nodes and host groups etc., overrides default chef search nodes inventory
- cluster_attribute (optional, String) - chef node cluster attribute to create hostgroup and
Host
vars - application_attribute (optional, String) - chef node application attribute to create hostgroup and
Host
vars - enable_cluster_hostgroup (optional, TrueClass/FalseClass) - whether to create
HostGroup
objects for chef node cluster's - enable_application_hostgroup (optional, TrueClass/FalseClass) - whether to create
HostGroup
objects for chef node application's - enable_role_hostgroup (optional, TrueClass/FalseClass) - whether to create
HostGroup
objects for chef node run_list role - host_display_name_attr (optional, String) - whether to use
hostname
orfqdn
orname
(chef node name) for Host Object attributedisplay_name
, options: hostname fqdn name - use_fqdn_resolv (optional, TrueClass/FalseClass) - whether to use DNS FQDN resolved address for
Host
object attributeaddress
- failover_fqdn_address (optional, TrueClass/FalseClass) - whether to use chef node attribute
node['ipaddress']
if failed to resolve node FQDN - ignore_resolv_error (optional, TrueClass/FalseClass) - whether to ignore node FQDN resolve error
- ignore_node_error (optional, TrueClass/FalseClass) - whether to ignore node if failed to determine
node[]'chef_environment']
ornode['fqdn']
ornode['hostname']
exclude_recipes (optional, Array) - exclude chef node ifrun_list
matches recipe, not yet testedexclude_roles (optional, Array) - exclude chef node ifrun_list
matches role, not yet tested- env_custom_vars (optional, Hash) - add
Host
object custom vars to all chef node - limit_region (optional, TrueClass/FalseClass) - whether to limit chef node to chef server region, currently tested for Amazon EC2, e.g. a icinga2 server located in region
us-east-1
will only collect nodes located inus-east-1
region - server_region (optional, String) - icinga2 server region can be overridden if cloud provider is not supported by the cookbook using this attribute
- add_cloud_custom_vars (optional, TrueClass/FalseClass) - whether to add cloud attributes, currently supports amazon ec2, e.g. instance id, vpc subnet etc.
- add_inet_custom_vars (optional, TrueClass/FalseClass) - whether to add inet ip address custom vars to Host objects
- add_node_vars (optional, Hash) - add node attributes to custom vars, e.g.
add_node_vars 'hardware' => %w(dmi system manufacturer)
will add a custom var hardware with value of node attributenode['dmi']['system']['manufacturer']
- env_filter_node_vars (optional, Hash) - filter or match chef nodes for a given
Hash
attribute key value pairs - env_skip_node_vars (optional, Hash) - ignore chef nodes for a given
Hash
attribute key value pairs - import (optional, String) - icinga
Host
object import template attribute - check_command (optional, String) - icinga
Host
object attributecheck_command
- max_check_attempts (optional, Integer) - icinga
Host
object attributemax_check_attempts
- check_period (optional, String) - icinga
Host
object attributecheck_period
- notification_period (optional, String) - icinga
Host
object attributenotification_period
- check_interval (optional, String/Integer) - icinga
Host
object attributecheck_interval
- retry_interval (optional, Integer) - icinga
Host
object attributeretry_interval
- enable_notifications (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_notifications
- enable_active_checks (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_active_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_passive_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_passive_checks
- enable_event_handler (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_event_handler
- enable_flapping (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_flapping
- enable_perfdata (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_perfdata
- event_command (optional, String) - icinga
Host
object attributeevent_command
- flapping_threshold (optional, String) - icinga
Host
object attributeflapping_threshold
- volatile (optional, , TrueClass/FalseClass) - icinga
Host
object attributevolatile
- zone (optional, String) - icinga
Host
object attributezone
- command_endpoint (optional, String) - icinga
Host
object attributecommand_endpoint
- notes (optional, String) - icinga
Host
object attributenotes
- notes_url (optional, String) - icinga
Host
object attributenotes_url
- action_url (optional, String) - icinga
Host
object attributeaction_url
- icon_image (optional, String) - icinga
Host
object attributeicon_image
- icon_image_alt (optional, String) - icinga
Host
object attributeicon_image_alt
- endpoint_port (optional, Integer) - icinga
Endpoint
object attributeport
- endpoint_log_duration (optional, String) - icinga
Endpoint
object attributelog_duration
- zone_parent (optional, String) - icinga
Zone
object attributeparent
Note: Few of LWRP resource attributes has default value, please check LWRP resource until information is added here.
LWRP envhostgroup
creates an icinga Hostgroup
object for LWRP environment
host groups.
An environment
host groups are evaluated at compile time, hence it conflicts with LWRP hostgroup
resources. To avoid the conflict, LWRP envhostgroup
resources are created in a separate object file for an environment.
LWRP Environment HostGroup example
icinga2_envhostgroup 'envhostgroup' do
environment environment_name
groups %w(group)
end
Above LWRP resource will create HostGroup
for a chef environment.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- environment (name_attribute, String) - chef environment name
- groups (optional, Array) - host group names
Note: This LWRP resource is only meant for LWRP environment
and not to be used for custom resources.
LWRP envendpoint
creates an icinga Endpoint
object for LWRP environment
endpoints.
An environment
endpoints are evaluated at compile time, hence it conflicts with LWRP endpoint
resources. To avoid the conflict, LWRP envendpoint
resources are created in a separate object file for an environment.
LWRP Environment Endpoint example
icinga2_envendpoint 'envendpoint' do
endpoints %w(endpoint)
port 5665
environment environment_name
log_duration '1d'
end
Above LWRP resource will create Endpoint
for a chef environment.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- environment (name_attribute, String) - chef environment name
- endpoints (optional, Array) - endpoint names
- port (optional, Integer) - default 5665, The service name/port of the remote Icinga 2 instance
- log_duration (optional, String) - Duration for keeping replay logs on connection loss.
Note: This LWRP resource is only meant for LWRP environment
and not to be used for custom resources.
LWRP envzone
creates an icinga Zone
object for LWRP environment
zones.
An environment
zones are evaluated at compile time, hence it conflicts with LWRP zone
resources. To avoid the conflict, LWRP envzone
resources are created in a separate object file for an environment.
LWRP Environment Zone example
icinga2_envzone 'envzone' do
zones %w(zone)
parent 'master'
environment environment_name
end
Above LWRP resource will create Zone
for a chef environment.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- environment (name_attribute, String) - chef environment name
- zones (optional, Array) - zone names
- parent (optional, String) - The name of the parent zone.
Note: This LWRP resource is only meant for LWRP environment
and not to be used for custom resources.
Unlike LWRP environment
, LWRP host
creates an icinga Host
object or template.
LWRP host
can be useful for servers not managed by Chef or to monitor Cloud Services like Amazon Elastic Cache or Amazon RDS etc.
LWRP Host Object example
icinga2_host 'redis-ec.abcdef.0001.apse1.cache.amazonaws.com' do
display_name 'Production Redis Server'
address 'redis-ec.abcdef.0001.apse1.cache.amazonaws.com'
custom_vars :check_tcp_ports => %w(6379), :application => 'redis', :environment => 'production', :cluster_name => 'prodredis0001'
end
Above LWRP resource will create an icinga Host
object.
LWRP Host Template example
icinga2_host 'generic-host' do
template true
max_check_attempts 5
check_interval '1m'
retry_interval '30s'
check_command 'hostalive'
end
Above LWRP resource will create an icinga Host
template - generic-host
.
LWRP Options
- action (optional) - default :create, options: :create, :delete, :reload
- display_name (optional, String) - icinga
Host
object import template attribute - import (optional, String) - icinga
Host
object import template attribute - address (optional, String) - icinga
Host
object import template attribute - address6 (optional, String) - icinga
Host
object import template attribute - groups (optional, Array) - icinga
Host
object import template attribute - check_command (optional, String) - icinga
Host
object attributecheck_command
- max_check_attempts (optional, Integer) - icinga
Host
object attributemax_check_attempts
- check_period (optional, String) - icinga
Host
object attributecheck_period
- notification_period (optional, String) - icinga
Host
object attributenotification_period
- check_interval (optional, String/Integer) - icinga
Host
object attributecheck_interval
- retry_interval (optional, String/Integer) - icinga
Host
object attributeretry_interval
- enable_notifications (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_notifications
- enable_active_checks (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_active_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_passive_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_passive_checks
- enable_event_handler (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_event_handler
- enable_flapping (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_flapping
- enable_perfdata (optional, TrueClass/FalseClass) - icinga
Host
object attributeenable_perfdata
- event_command (optional, String) - icinga
Host
object attributeevent_command
- flapping_threshold (optional, String) - icinga
Host
object attributeflapping_threshold
- volatile (optional, , TrueClass/FalseClass) - icinga
Host
object attributevolatile
- zone (optional, String) - icinga
Host
object attributezone
- command_endpoint (optional, String) - icinga
Host
object attributecommand_endpoint
- notes (optional, String) - icinga
Host
object attributenotes
- notes_url (optional, String) - icinga
Host
object attributenotes_url
- action_url (optional, String) - icinga
Host
object attributeaction_url
- icon_image (optional, String) - icinga
Host
object attributeicon_image
- icon_image_alt (optional, String) - icinga
Host
object attributeicon_image_alt
- custom_vars (optional, String) - icinga
Host
object attributevars
- template (optional, TrueClass/FalseClass) - whether to create a
Host
template
LWRP hostgroup
creates an icinga HostGroup
object.
LWRP HostGroup example
icinga2_hostgroup 'hostgroup_name' do
display_name 'Host Group'
groups ['othergroup']
assign_where ['"hostgroup_name" in host.vars.hostgroups']
ignore_where ['"hostgroup_name" in host.vars.hostgroups']
end
Above LWRP resource will create an icinga HostGroup
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- display_name (optional, String) - icinga
HostGroup
attributedisplay_name
- groups (optional, Array) - icinga
HostGroup
attributegroups
- assign_where (optional, Array) - an array of
assign where
statements - ignore_where (optional, Array) - an array of
ignore where
statements
LWRP service
creates an icinga Service
object or template.
LWRP Service Object example
icinga2_service 'redis-ec.abcdef.0001.apse1.cache.amazonaws.com_service_check' do
display_name 'Production Redis Service Check'
host_name 'redis-ec.abcdef.0001.apse1.cache.amazonaws.com'
check_command 'tcp'
custom_vars :tcp_port => 6379
end
Above LWRP resource will create an icinga Service
object for a host tcp port check.
LWRP Service Template example
icinga2_service 'generic-service' do
template true
max_check_attempts 5
check_interval '1m'
retry_interval '30s'
end
Above LWRP resource will create an icinga Service
template object for a generic-service
Service
.
LWRP Options
- action (optional) - default :create, options: :create, :delete, :reload
- display_name (optional) - icinga
Service
object attributedisplay_name
- import (optional) - icinga
Service
object attributeimport
- host_name (optional) - icinga
Service
object attributehost_name
- groups (optional) - icinga
Service
object attributegroups
- check_command (optional) - icinga
Service
object attributecheck_command
- max_check_attempts (optional) - icinga
Service
object attributemax_check_attempts
- check_period (optional) - icinga
Service
object attributecheck_period
- notification_period (optional) - icinga
Service
object attributenotification_period
- check_interval (optional) - icinga
Service
object attributecheck_interval
- retry_interval (optional) - icinga
Service
object attributeretry_interval
- enable_notifications (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_notifications
- enable_active_checks (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_active_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_passive_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_passive_checks
- enable_event_handler (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_event_handler
- enable_flapping (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_flapping
- enable_perfdata (optional) - icinga
Service
object attributeenable_perfdata
- event_command (optional, TrueClass/FalseClass) - icinga
Service
object attributeevent_command
- flapping_threshold (optional, String) - icinga
Service
object attributeflapping_threshold
- volatile (optional, TrueClass/FalseClass) - icinga
Service
object attributevolatile
- zone (optional, String) - icinga
Service
object attributezone
- command_endpoint (optional, String) - icinga
Service
object attributecommand_endpoint
- notes (optional, String) - icinga
Service
object attributenotes
- notes_url (optional, String) - icinga
Service
object attributenotes_url
- action_url (optional, String) - icinga
Service
object attributeaction_url
- icon_image (optional, String) - icinga
Service
object attributeicon_image
- icon_image_alt (optional, String) - icinga
Service
object attributeicon_image_alt
- custom_vars (optional, Hash) - icinga
Service
object attributevars
- template (optional, TrueClass/FalseClass) - whether to create a
Service
template
LWRP service
creates an icinga Service
object or template.
LWRP Apply Service Object example
icinga2_applyservice 'nrpe_check_load' do
display_name 'CPU Average Load'
import 'generic-service'
check_command 'nrpe'
custom_vars :nrpe_command => 'check_load'
assign_where ['host.vars.nrpe']
check_interval '1m'
retry_interval '15s'
max_check_attempts 3
action_url '/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'
end
Above LWRP resource will apply an icinga Service
object to all Hosts
with custom vars host.vars.nrpe
.
LWRP Apply Service For Object example
icinga2_applyservice 'areca' do
set 'areca => config in host.vars.areca'
display_name '"areca raidset" + areca'
import 'generic-service'
check_command 'check_snmp'
assign_where ['"areca" in host.vars.enabled_services']
merge_vars ['config']
check_interval '5m'
retry_interval '3m'
max_check_attempts 2
end
Above LWRP resource will apply an icinga Service
object with a Service for set (also called hash or dictionary) to all Hosts
with custom vars host.vars.enabled_services
including 'areca'. It will also merge the values in config
into the Service
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete, :reload
- display_name (optional, String) - icinga
Service
object attributedisplay_name
- set (optional, String) - gives a set (hash/dictionary) to the icinga
service
object - import (optional, String) - icinga
Service
object attributeimport
- host_name (optional, String) - icinga
Service
object attributehost_name
- groups (optional, Array) - icinga
Service
object attributegroups
- check_command (optional, String) - icinga
Service
object attributecheck_command
- max_check_attempts (optional, Integer) - icinga
Service
object attributemax_check_attempts
- check_period (optional, String) - icinga
Service
object attributecheck_period
- notification_period (optional, String) - icinga
Service
object attributenotification_period
- check_interval (optional, String/Integer) - icinga
Service
object attributecheck_interval
- retry_interval (optional, String/Integer) - icinga
Service
object attributeretry_interval
- enable_notifications (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_notifications
- enable_active_checks (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_active_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_passive_checks
- enable_passive_checks (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_passive_checks
- enable_event_handler (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_event_handler
- enable_flapping (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_flapping
- enable_perfdata (optional, TrueClass/FalseClass) - icinga
Service
object attributeenable_perfdata
- event_command (optional, TrueClass/FalseClass) - icinga
Service
object attributeevent_command
- flapping_threshold (optional, TrueClass/FalseClass) - icinga
Service
object attributeflapping_threshold
- volatile (optional, TrueClass/FalseClass) - icinga
Service
object attributevolatile
- zone (optional, String) - icinga
Service
object attributezone
- command_endpoint (optional, String) - icinga
Service
object attributecommand_endpoint
- notes (optional, String) - icinga
Service
object attributenotes
- notes_url (optional, String) - icinga
Service
object attributenotes_url
- action_url (optional, String) - icinga
Service
object attributeaction_url
- icon_image (optional, String) - icinga
Service
object attributeicon_image
- icon_image_alt (optional, String) - icinga
Service
object attributeicon_image_alt
- custom_vars (optional, Hash) - icinga
Service
object attributevars
- merge_vars (optional, Array) - Merge vars from each member of a set into icinga
Service
object attributevars
- assign_where (optional, Array) - an array of
assign where
statements - ignore_where (optional, Array) - an array of
ignore where
statements
LWRP servicegroup
creates an icinga ServiceGroup
object.
LWRP ServiceGroup example
icinga2_servicegroup 'servicegroup_name' do
display_name 'Service Group'
groups ['othergroup']
assign_where ['"servicegroup_name" in host.vars.servicegroups']
ignore_where ['"servicegroup_name" in host.vars.servicegroups']
end
Above LWRP resource will create an icinga ServiceGroup
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- display_name (optional, String) - icinga
ServiceGroup
attributedisplay_name
- groups (optional, Array) - icinga
ServiceGroup
attributegroups
- assign_where (optional, Array) - an array of
assign where
statements - ignore_where (optional, Array) - an array of
ignore where
statements
LWRP feature
enable or disable an icinga Feature
.
LWRP Feature enable example
icinga2_feature 'feature_name'
Above LWRP resource will enable an icinga Feature
.
LWRP Feature disable example
icinga2_feature 'feature' do
action :disable
end
Above LWRP resource will disable an icinga Feature
.
LWRP Options
- name(name_attribute) - icinga2 feature name
- action (optional) - default :enable, options: :enable, :disable
LWRP user
creates an icinga User
object.
LWRP User Object example
icinga2_user 'user_name' do
import 'generic-user'
enable_notifications true
states %w(OK Warning Critical Unknown Up Down)
types %w(DowntimeStart DowntimeEnd DowntimeRemoved Custom Acknowledgement Problem Recovery FlappingStart FlappingEnd)
display_name 'User Info'
groups %w(usergroup)
email 'user@domain'
end
Above LWRP resource will create an icinga User
object.
LWRP User Template example
icinga2_user 'generic-user' do
template true
end
Above LWRP resource will create an icinga User
template.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- display_name (optional, String) - icinga
User
attributedisplay_name
- import (optional, String) - icinga
User
attributeimport
- groups (optional, Array) - icinga
User
attributegroups
- email (optional, String) - icinga
User
attributeemail
- pager (optional, String) - icinga
User
attributepager
- period (optional, String) - icinga
User
attributeperiod
- states (optional, Array) - icinga
User
attributestates
- types (optional, Array) - icinga
User
attributetypes
- zone (optional, String) - icinga
User
attributezone
- custom_vars (optional, Hash) - icinga
User
attributevars
- enable_notifications (optional, TrueClass/FalseClass) - icinga
User
attributeenable_notifications
- template (optional, TrueClass/FalseClass) - whether to create a
User
template
LWRP usergroup
creates an icinga UserGroup
object.
LWRP UserGroup example
icinga2_usergroup 'usergroup_name' do
display_name 'User Group'
groups ['usergroup']
zone 'zone_name'
assign_where ['assign where statement']
ignore_where ['ignore where statement']
end
Above LWRP resource will create an icinga UserGroup
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- display_name (optional, String) - icinga
UserGroup
attributedisplay_name
- groups (optional, Array) - icinga
UserGroup
attributegroups
- zone (optional, String) - icinga
UserGroup
attributezone
- assign_where (optional, Array) - an array of
assign where
statements - ignore_where (optional, Array) - an array of
ignore where
statements
LWRP zone
creates an icinga Zone
object.
LWRP Zone example
icinga2_zone 'zone' do
endpoints %w(endpoint)
parent 'parent zone'
end
Above LWRP resource will create an icinga Zone
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- endpoints (optional, String) - icinga
Zone
attributeendpoints
- parent (optional, String) - icinga
Zone
attributeparent
- global (optional, TrueClass/FalseClass) - icinga
Zone
attributeglobal
LWRP endpoint
creates an icinga Endpoint
object.
LWRP Endpoint example
icinga2_endpoint 'endpoint' do
host 'host address'
port 1234
log_duration 'log duration'
end
Above LWRP resource will create an icinga Endpoint
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- host (optional, String) - icinga
Endpoint
attributehost
- port (optional, Integer) - icinga
Endpoint
attributeport
- log_duration (optional, String) - icinga
Endpoint
attributelog_duration
LWRP timeperiod
creates an icinga TimePeriod
object.
LWRP TimePeriod example
icinga2_timeperiod '24x7' do
import 'legacy-timeperiod'
display_name 'Icinga 2 24x7 TimePeriod'
ranges 'monday' => '00:00-24:00',
'tuesday' => '00:00-24:00',
'wednesday' => '00:00-24:00',
'thursday' => '00:00-24:00',
'friday' => '00:00-24:00',
'saturday' => '00:00-24:00',
'sunday' => '00:00-24:00'
end
Above LWRP resource will create an icinga TimePeriod
object.
LWRP TimePeriod template
icinga2_timeperiod 'legacy-timeperiod' do
template true
display_name 'legacy-timeperiod'
end
Above LWRP resource will create an icinga TimePeriod
template.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- display_name (optional, String) - icinga
TimePeriod
attributedisplay_name
- import (optional, String) - icinga
TimePeriod
attributeimport
- zone (optional, String) - icinga
TimePeriod
attributezone
- ranges (optional, Hash) - icinga
TimePeriod
attributeranges
- template (optional, TrueClass/FalseClass) - whether to create an icinga
TimePeriod
template
LWRP eventcommand
creates an icinga EventCommand
object.
LWRP EventCommand example
icinga2_eventcommand 'eventcommand' do
command 'command name'
custom_vars :attribute => 'value'
end
Above LWRP resource will create an icinga EventCommand
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- import (optional, String) - icinga
EventCommand
attributeimport
- command (optional, String/Array) - icinga
EventCommand
attributecommand
- env (optional, Hash) - icinga
EventCommand
attributeenv
- timeout (optional, String/Integer) - icinga
EventCommand
attributetimeout
- arguments (optional, Hash) - icinga
EventCommand
attributearguments
- custom_vars (optional, Hash) - icinga
EventCommand
attributecustom_vars
LWRP checkcommand
creates an icinga CheckCommand
object.
LWRP CheckCommand example
icinga2_checkcommand 'checkcommand' do
command 'command name'
env :attribute => 'value'
arguments :attribute => 'value'
custom_vars :attribute => 'value'
zone 'zone name'
end
Above LWRP resource will create an icinga CheckCommand
object.
LWRP Options
- action (optional, String) - default :create, options: :create, :delete
- import (optional, String) - default plugin-check-command, icinga
CheckCommand
attributeimport
- command (optional, String/Array) - icinga
CheckCommand
attributecommand
- env (optional, Hash) - icinga
CheckCommand
attributeenv
- timeout (optional, Integer) - icinga
CheckCommand
attributetimeout
- zone (optional, String) - icinga
CheckCommand
attributezone
- arguments (optional, Hash) - icinga
CheckCommand
attributearguments
- custom_vars (optional, Hash) - icinga
CheckCommand
attributecustom_vars
- template (optional, TrueClass/FalseClass) - whether to create a
CheckCommand
template
LWRP scheduleddowntime
creates an icinga ScheduledDowntime
object.
LWRP ScheduledDowntime example
icinga2_scheduleddowntime 'downtime' do
host_name 'host name'
service_name 'service name'
author 'author'
comment 'comment'
duration 'duration'
end
Above LWRP resource will create an icinga ScheduledDowntime
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- host_name (optional, String) - icinga
ScheduledDowntime
attributehost_name
- service_name (optional, String) - icinga
ScheduledDowntime
attributeservice_name
- author (optional, String) - icinga
ScheduledDowntime
attributeauthor
- comment (optional, String) - icinga
ScheduledDowntime
attributecomment
- fixed (optional, TrueClass/FalseClass) - icinga
ScheduledDowntime
attributefixed
- duration (optional, String) - icinga
ScheduledDowntime
attributeduration
- zone (optional, String) - icinga
ScheduledDowntime
attributezone
- ranges (optional, Hash) - icinga
ScheduledDowntime
attributeranges
- template (optional, TrueClass/FalseClass) - whether to create an icinga
ScheduledDowntime
template
LWRP script
creates a template resource file script under node['icinga2']['scripts_dir']
. This resource is optional and not necessary applicable to all scenarios.
LWRP script example
icinga2_script 'mail-host-notification-custom.sh' do
cookbook 'wrapper_cookbook'
source 'mail-host-notification-custom.sh.erb'
end
Above LWRP resource will create a script file under node['icinga2']['scripts_dir']/mail-host-notification-custom.sh
using template mail-host-notification-custom.sh.erb
from cookbook wrapper_cookbook
.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- source (optional, String) - default :name, template resource attribute
source
- cookbook (required, String) - template resource attribute
cookbook
- variables (optional, Hash) - template resource attribute
variables
LWRP externalcommandlistener
creates an icinga ExternalCommandListener
object.
LWRP ExternalCommandListener example
icinga2_externalcommandlistener 'externalcommandlistener' do
library 'library'
command_path 'command path'
end
Above LWRP resource will create an icinga ExternalCommandListener
config object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default 'compat', icinga
ExternalCommandListener
attributelibrary
- command_path (optional, String) - icinga
ExternalCommandListener
attributecommand_path
LWRP gelfwriter
creates an icinga GelfWriter
object.
LWRP GelfWrite example
icinga2_gelfwriter 'gelfwriter' do
library 'library'
host 'host address'
port 1234
source 'source'
end
Above LWRP resource will create an icinga GelfWriter
config object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default 'perfdata', icinga
GelfWriter
attributelibrary
- host (required, String) - icinga
GelfWriter
attributehost
- port (required, Integer) - icinga
GelfWriter
attributeport
- source (optional, String) - icinga
GelfWriter
attributesource
LWRP graphitewriter
creates an icinga GraphiteWriter
object.
LWRP GraphiteWriter example
icinga2_graphitewriter 'graphitewriter' do
library 'library'
host 'host address'
port 1234
end
Above LWRP resource will create an icinga GraphiteWriter
config object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default 'perfdata', icinga
GraphiteWriter
attributelibrary
- host (optional, String) - icinga
GraphiteWriter
attributehost
- port (optional, Integer) - icinga
GraphiteWriter
attributeport
- host_name_template (optional, String) - default icinga.$host.name$, icinga
GraphiteWriter
attributehost_name_template
- service_name_template (optional, String) - default icinga.$host.name$.$service.name$, icinga
GraphiteWriter
attributeservice_name_template
LWRP influxdbwriter
creates an icinga InfluxdbWriter
object.
LWRP InfluxdbWriter example
icinga2_influxdbwriter 'influxdbwriter' do
library 'library'
host 'host address'
port 8087
database 'icinga2'
username 'myuser'
password 'mypassword'
end
Above LWRP resource will create an icinga InfluxdbWriter
config object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default 'perfdata', icinga
InfluxdbWriter
attributelibrary
- host (optional, String) - default 'localhost', icinga
InfluxdbWriter
attributehost
- port (optional, Integer) - default 8087, icinga
InfluxdbWriter
attributeport
- database (optional, String) - default 'icinga2', icinga
InfluxdbWriter
attributedatabase
- username (optional, String) - icinga
InfluxdbWriter
attributeusername
- password (optional, String) - icinga
InfluxdbWriter
attributepassword
- ssl_enable (optional, String) - default 'false', icinga
InfluxdbWriter
attributessl_enable
- ssl_ca_cert (optional, String) - icinga
InfluxdbWriter
attributessl_ca_cert
- ssl_cert (optional, String) - icinga
InfluxdbWriter
attributessl_cert
- ssl_key (optional, String) - icinga
InfluxdbWriter
attributessl_key
- host_template (optional, String) - icinga
InfluxdbWriter
attributehost_template
- service_template (optional, String) - icinga
InfluxdbWriter
attributeservice_template
- enable_send_thresholds (optional, String) - icinga
InfluxdbWriter
attributeenable_send_thresholds
- enable_send_metadata (optional, String) - icinga
InfluxdbWriter
attributeenable_send_metadata
- flush_intervald (optional, String) - icinga
InfluxdbWriter
attributeflush_intervald
- flush_threshold (optional, Integer) - icinga
InfluxdbWriter
attributeflush_threshold
LWRP idomysqlconnection
creates an icinga IdoMySqlConnection
object.
LWRP IdoMySqlConnection example
icinga2_idomysqlconnection 'idomysqlconnection' do
library 'library'
host 'host address'
port 1234
user 'user name'
password 'password'
database 'database name'
socket_path '/var/lib/mysql/mysql.sock'
end
Above LWRP resource will create an icinga IdoMySqlConnection
config object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default 'db_ido_mysql', icinga
IdoMySqlConnection
attributelibrary
- host (optional, String) - icinga
IdoMySqlConnection
attributehost
- port (optional, Integer) - icinga
IdoMySqlConnection
attributeport
- user (optional, String) - icinga
IdoMySqlConnection
attributeuser
- password (optional, String) - icinga
IdoMySqlConnection
attributepassword
- database (optional, String) - icinga
IdoMySqlConnection
attributedatabase
- table_prefix (optional, String) - default icinga_, icinga
IdoMySqlConnection
attributetable_prefix
- instance_name (optional, String) - icinga
IdoMySqlConnection
attributeinstance_name
- instance_description (optional, String) - icinga
IdoMySqlConnection
attributeinstance_description
- enable_ha (optional, TrueClass/FalseClass) - icinga
IdoMySqlConnection
attributeenable_ha
- failover_timeout (optional, String/Integer) - icinga
IdoMySqlConnection
attributefailover_timeout
- cleanup (optional, Hash) - icinga
IdoMySqlConnection
attributecleanup
- categories (optional, Array) - icinga
IdoMySqlConnection
attributecategories
LWRP idopgsqlconnection
creates an icinga IdoPgSqlConnection
object.
LWRP IdoPgSqlConnection example
icinga2_idopgsqlconnection 'idopgsqlconnection' do
library 'library'
host 'host address'
port 1234
user 'user name'
password 'password'
database 'database name'
socket_path '/tmp/.s.PGSQL.nnnn'
end
Above LWRP resource will create an icinga IdoPgSqlConnection
config object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default 'db_ido_mysql', icinga
IdoPgSqlConnection
attributelibrary
- host (optional, String) - icinga
IdoPgSqlConnection
attributehost
- port (optional, Integer) - icinga
IdoPgSqlConnection
attributeport
- user (optional, String) - icinga
IdoPgSqlConnection
attributeuser
- password (optional, String) - icinga
IdoPgSqlConnection
attributepassword
- database (optional, String) - icinga
IdoPgSqlConnection
attributedatabase
- table_prefix (optional, String) - icinga
IdoPgSqlConnection
attributetable_prefix
- instance_name (optional, String) - icinga
IdoPgSqlConnection
attributeinstance_name
- instance_description (optional, String) - icinga
IdoPgSqlConnection
attributeinstance_description
- enable_ha (optional, TrueClass/FalseClass) - icinga
IdoPgSqlConnection
attributeenable_ha
- failover_timeout (optional, String/Integer) - icinga
IdoPgSqlConnection
attributefailover_timeout
- cleanup (optional, Hash) - icinga
IdoPgSqlConnection
attributecleanup
- categories (optional, Array) - icinga
IdoPgSqlConnection
attributecategories
LWRP sysloglogger
creates an icinga SyslogLogger
object.
LWRP SyslogLogger example
icinga2_sysloglogger 'sysloglogger' do
severity 'critical'
end
Above LWRP resource will create an icinga SyslogLogger
object.
LWRP Options
- name(name_attribute) - icinga
SyslogLogger
name - severity (optional, String) - icinga
SyslogLogger
attributeport
LWRP notification
creates an icinga Notification
object.
LWRP Notification Object example
icinga2_notification 'notification' do
import 'notification template'
host_name 'host'
service_name 'service'
users %w(user)
user_groups %w(usergroup)
interval 'interval'
period 'period'
states %w(OK Warning Critical Unknown Up Down)
types %w(Custom Acknowledgement Problem Recovery)
end
Above LWRP resource will create an icinga Notification
object.
LWRP Notification Template example
icinga2_notification 'notification' do
template true
period '24x7'
end
Above LWRP resource will create an icinga Notification
template.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- import (optional, String) - icinga
Notification
attributeimport
- host_name (optional, String) - icinga
Notification
attributehost_name
- service_name (optional, String) - icinga
Notification
attributeservice_name
- users (optional, Array) - icinga
Notification
attributeusers
- user_groups (optional, Array) - icinga
Notification
attributeuser_groups
- times (optional, Hash) - icinga
Notification
attributetimes
- command (optional, String) - icinga
Notification
attributecommand
- interval (optional, String/Integer) - icinga
Notification
attributeinterval
- period (optional, String) - icinga
Notification
attributeperiod
- zone (optional, String) - icinga
Notification
attributezone
- types (optional, Array) - icinga
Notification
attributetypes
- states (optional, Array) - icinga
Notification
attributestates
- custom_vars (optional, Hash) - icinga
Notification
attributevars
- template (optional, TrueClass/FalseClass) - whether to create a
Notification
template
LWRP applynotification
creates an icinga apply Notification
object for Host
and Service
.
LWRP apply Notification Service Object example
icinga2_applynotification 'servicenotification' do
object_type 'Service'
command 'mail-service-notification'
users %w(user)
interval '1h'
assign_where ['host.address && host.vars.environment == "development"']
ignore_where ['host.vars.monitoring_disabled == true']
end
Above LWRP resource will apply Notification
to all Service
objects for provided assign where
statements and ignore for specified ignore where
statements.
LWRP apply Notification Host Object example
icinga2_applynotification 'hostnotification' do
object_type 'Host'
command 'mail-host-notification'
users %w(user)
interval '1h'
assign_where ['host.address && host.vars.environment == "development"']
ignore_where ['host.vars.monitoring_disabled == true']
end
Above LWRP resource will apply Notification
to all Host
objects for provided assign_where
statements and ignore for specified ignore_where
statements.
LWRP Options
- object_type (required, String) - apply Notification to
Host
orService
, valid values are: Host Service - action (optional, String) - default :create, options: :create, :delete
- import (optional, String) - icinga
Notification
attributeimport
- users (optional, Array) - icinga
Notification
attributeusers
- user_groups (optional, Array) - icinga
Notification
attributeuser_groups
- times (optional, Hash) - icinga
Notification
attributetimes
- command (optional, String) - icinga
Notification
attributecommand
- interval (optional, String/Integer) - icinga
Notification
attributeinterval
- period (optional, String) - icinga
Notification
attributeperiod
- types (optional, Array) - icinga
Notification
attributetypes
- states (optional, Array) - icinga
Notification
attributestates
- assign_where (optional, Array) - icinga
assign where
statements - ignore_where (optional, Array) - icinga
ignore where
statements
LWRP notificationcommand
creates an icinga NotificationCommand
object.
LWRP NotificationCommand example
icinga2_notificationcommand 'mail-service-notification' do
command ['ConfigDir + "/icinga2/scripts/mail-service-notification.sh"']
env 'NOTIFICATIONTYPE' => '$notification.type$', \
'SERVICEDESC' => '$service.name$',\
'HOSTALIAS' => '$host.display_name$',\
'HOSTADDRESS' => '$address$',\
'SERVICESTATE' => '$service.state$',\
'LONGDATETIME' => '$icinga.long_date_time$',\
'SERVICEOUTPUT' => '$service.output$',\
'NOTIFICATIONAUTHORNAME' => '$notification.author$',\
'NOTIFICATIONCOMMENT' => '$notification.comment$',\
'HOSTDISPLAYNAME' => '$host.display_name$',\
'SERVICEDISPLAYNAME' => '$service.display_name$',\
'USEREMAIL' => '$user.email$'
end
Above LWRP resource will create an icinga NotificationCommand
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- import (optional, String) - default plugin-notification-command, icinga
NotificationCommand
attributecert_path
- command (optional, String/Array) - icinga
NotificationCommand
attributecommand
- env (optional, Hash) - icinga
NotificationCommand
attributeenv
- timeout (optional, Integer) - icinga
NotificationCommand
attributetimeout
- zone (optional, String) - icinga
NotificationCommand
attributezone
- arguments (optional, Hash) - icinga
NotificationCommand
attributearguments
- custom_vars (optional, Hash) - icinga
NotificationCommand
attributevars
LWRP apilistener
creates an icinga ApiListener
object.
LWRP ApiListener example
icinga2_apilistener 'master' do
cert_path 'ConfigDir + "/icinga2/pki/" + NodeName + ".crt"'
key_path 'ConfigDir + "/icinga2/pki/" + NodeName + ".key"'
ca_path 'ConfigDir + "/icinga2/pki/ca.crt"'
bind_host 'host address'
bind_port '5665'
ticket_salt 'TicketSalt'
end
Above LWRP resource will create an icinga ApiListener
object.
LWRP Options
- action (optional, String) - default :create, options: :create, :delete
- cert_path (required, String) - icinga
ApiListener
attributecert_path
- key_path (required, String) - icinga
ApiListener
attributekey_path
- ca_path (required, String) - icinga
ApiListener
attributeca_path
- crl_path (optional, String) - icinga
ApiListener
attributecrl_path
- bind_host (optional, String) - icinga
ApiListener
attributebind_host
- bind_port (optional, String) - icinga
ApiListener
attributebind_port
- ticket_salt (optional, String) - icinga
ApiListener
attributeticket_salt
- accept_config (optional, TrueClass/FalseClass) - icinga
ApiListener
attributeaccept_config
- accept_commands (optional, TrueClass/FalseClass) - icinga
ApiListener
attributeaccept_commands
LWRP apiuser
creates an icinga ApiUser
object.
LWRP ApiUser example
icinga2_apiuser 'master' do
password 'mysecretapipassword'
client_cn 'myname'
permissions '["*"]'
end
Above LWRP resource will create an icinga apiuser
object.
LWRP Options
- action (optional, String) - default :create, options: :create, :delete
- password (required, String) - icinga
apiuser
attributepassword
- permissions (required, String) - icinga
apiuser
attributepermissions
- client_cn (optional, String) - icinga
apiuser
attributeclient_cn
LWRP livestatuslistener
creates an icinga LiveStatusListener
object.
LWRP LiveStatusListener example
icinga2_livestatuslistener 'livestatuslistener' do
socket_type 'socket type'
socket_path 'socket path'
bind_host 'host address'
bind_port 'host port'
compat_log_path 'log path'
end
Above LWRP resource will create an icinga LiveStatusListener
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- socket_type (optional, String) - icinga
LiveStatusListener
attributesocket_type
- socket_path (optional, String) - icinga
LiveStatusListener
attributesocket_path
- bind_host (optional, String) - icinga
LiveStatusListener
attributebind_host
- bind_port (optional, Integer) - icinga
LiveStatusListener
attributebind_port
- compat_log_path (optional, String) - icinga
LiveStatusListener
attributecompat_log_path
LWRP statusdatawriter
creates an icinga StatusDataWriter
object.
LWRP StatusDataWriter example
icinga2_statusdatawriter 'statusdatawriter' do
status_path 'status path'
objects_path 'objects path'
update_interval 'update interval'
end
Above LWRP resource will create an icinga StatusDataWriter
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default compat, icinga
StatusDataWriter
Objectlibrary
- status_path (optional, String) - icinga
StatusDataWriter
attributestatus_path
- objects_path (optional, String) - icinga
StatusDataWriter
attributeobjects_path
- update_interval (optional, String/Integer) - icinga
StatusDataWriter
attributeupdate_interval
LWRP compatlogger
creates an icinga CompatLogger
object.
LWRP CompatLogger example
icinga2_compatlogger 'compatlogger' do
log_dir 'log dir'
rotation_method 'rotation method'
end
Above LWRP resource will create an icinga CompatLogger
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default compat, icinga
CompatLogger
Objectlibrary
- log_dir (optional, String) - icinga
CompatLogger
attributelog_dir
- rotation_method (optional, String) - icinga
CompatLogger
attributerotation_method
LWRP checkresultreader
creates an icinga CheckResultReader
object.
LWRP CheckResultReader example
icinga2_checkresultreader 'checkresultreader' do
spool_dir 'spool dir'
end
Above LWRP resource will create an icinga CheckResultReader
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default compat, icinga
CheckResultReader
Objectlibrary
- spool_dir (optional, String) - icinga
CheckResultReader
attributespool_dir
LWRP notificationcomponent
creates an icinga NotificationComponent
object.
LWRP NotificationComponent example
icinga2_notificationcomponent 'notificationcomponent'
Above LWRP resource will create an icinga NotificationComponent
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default notification, icinga
NotificationComponent
Objectlibrary
- enable_ha (optional, String) - icinga
NotificationComponent
attributeenable_ha
LWRP filelogger
creates an icinga FileLogger
object.
LWRP FileLogger example
icinga2_filelogger 'filelogger'
Above LWRP resource will create an icinga FileLogger
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- path (optional, String) - icinga
FileLogger
attributepath
- severity (optional, String) - icinga
FileLogger
attributeseverity
LWRP perfdatawriter
creates an icinga PerfdataWriter
object.
LWRP PerfdataWriter example
icinga2_perfdatawriter 'perfdatawriter' do
host_perfdata_path 'host perfdata path'
service_perfdata_path 'service perfdata path'
host_format_template 'host perfdata format'
service_format_template 'service perfdata format'
rotation_interval 'rotation interval'
end
Above LWRP resource will create an icinga PerfdataWriter
object.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- library (optional, String) - default perfdata, icinga
PerfdataWriter
Objectlibrary
- host_perfdata_path (optional, String) - icinga
PerfdataWriter
attributehost_perfdata_path
- service_perfdata_path (optional, String) - icinga
PerfdataWriter
attributeservice_perfdata_path
- host_temp_path (optional, String) - icinga
PerfdataWriter
attributehost_temp_path
- service_temp_path (optional, String) - icinga
PerfdataWriter
attributeservice_temp_path
- host_format_template (optional, String) - icinga
PerfdataWriter
attributehost_format_template
- service_format_template (optional, String) - icinga
PerfdataWriter
attributeservice_format_template
- rotation_interval (optional, String/Integer) - icinga
PerfdataWriter
attributerotation_interval
LWRP applydependency
creates an icinga apply Dependency
object for Host
and Service
.
LWRP apply Dependency Service Object example
icinga2_applydependency 'applyservicedependency' do
object_type 'Service'
parent_service_name 'check_nrpe'
states %w(OK Critical Unknown Warning)
period '24x7'
assign_where ['service.check_command == "nrpe"']
ignore_where ['service.name == "check_nrpe"']
end
Above LWRP resource will apply Dependency
to all Service
objects for provided assign where
statements and ignore for specified ignore where
statements.
LWRP apply Dependency Host Object example
icinga2_applydependency 'applyhostdependency' do
object_type 'Host'
parent_host_name 'gateway host'
states %w(Down Unknown)
period '24x7'
assign_where %w(host.address)
ignore_where ['!host.address']
end
Above LWRP resource will apply Dependency
to all Host
objects for provided assign_where
statements and ignore for specified ignore_where
statements.
LWRP Options
- action (optional) - default :create, options: :create, :delete
- object_relation (optional, String) - default
to
, applyDependency
relation - object_type (required, String) - apply Notification to
Host
orService
, valid values are: Host Service - parent_host_name (optional, String) - icinga apply
Dependency
attributeparent_host_name
- child_host_name (optional, String) - icinga apply
Dependency
attributechild_host_name
- parent_service_name (optional, String) - icinga apply
Dependency
attributeparent_service_name
- child_service_name (optional, String) - icinga apply
Dependency
attributechild_service_name
- disable_checks (optional, TrueClass/FalseClass) - icinga apply
Dependency
attributedisable_checks
- disable_notifications (optional, TrueClass/FalseClass) - icinga apply
Dependency
attributedisable_notifications
- period (optional, String) - icinga apply
Dependency
attributeperiod
- states (optional, Array) - icinga apply
Dependency
attributestates
- assign_where (optional, Array) - icinga
assign where
statements - ignore_where (optional, Array) - icinga
ignore where
statements