Whitespace cleanup.

This commit is contained in:
Nick Chappell 2014-09-13 19:46:24 -07:00
parent b7c6046ec5
commit cc57f33ac1
28 changed files with 126 additions and 129 deletions

View file

@ -3,7 +3,7 @@
## Overview ## Overview
This module installs and configures the [Icinga 2 monitoring system](https://www.icinga.org/icinga2/). It can also install and configure [NRPE](http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details) on client systems that are being monitored by an Icinga 2 server. This module installs and configures the [Icinga 2 monitoring system](https://www.icinga.org/icinga2/). It can also install and configure [NRPE](http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details) on client systems that are being monitored by an Icinga 2 server.
The module has only been tested on [CentOS 6.5](http://www.centos.org/download/) and Ubuntu [12.04](http://releases.ubuntu.com/12.04/) and [14.04](http://releases.ubuntu.com/14.04/). Red Hat and other EL derivatives, like Fedora, should work, but have not been tested. The module has only been tested on [CentOS 6.5](http://www.centos.org/download/) and Ubuntu [12.04](http://releases.ubuntu.com/12.04/) and [14.04](http://releases.ubuntu.com/14.04/). Red Hat and other EL derivatives, like Fedora, should work, but have not been tested.
@ -46,7 +46,7 @@ For production use, you'll probably want to get the database password via a [Hie
To install Icinga 2, first set up a MySQL or Postgres database. To install Icinga 2, first set up a MySQL or Postgres database.
Once the database is set up, use the `icinga2::server` class with the database connection parameters to specify Once the database is set up, use the `icinga2::server` class with the database connection parameters to specify
<pre> <pre>
#Install Icinga 2: #Install Icinga 2:
@ -66,7 +66,7 @@ When the `server_db_type` parameter is set, the right IDO database connection pa
<pre> <pre>
#Install Icinga 2: #Install Icinga 2:
class { 'icinga2::server': class { 'icinga2::server':
server_db_type => 'pgsql', server_db_type => 'pgsql',
db_host => 'localhost' db_host => 'localhost'
db_port => '5432' db_port => '5432'
@ -101,7 +101,7 @@ In a future version, the module will automatically create the IDO connection obj
<pre> <pre>
#Install Icinga 2: #Install Icinga 2:
class { 'icinga2::server': class { 'icinga2::server':
... ...
server_install_nagios_plugins => false, server_install_nagios_plugins => false,
... ...
@ -186,11 +186,11 @@ Unlike the built-in Nagios types, the file owner, group and mode of the automati
####`undef` and default object values ####`undef` and default object values
Most of the object parameters *in the Puppet module* are set to **undef**. Most of the object parameters *in the Puppet module* are set to **undef**.
This means that they will not be added to the rendered object definition files. This means that they will not be added to the rendered object definition files.
**However**, this doesn't mean that the values are undefined in Icinga 2. Icinga 2 itself has built-in default values for many object parameters and falls back to them if one isn't present in an object definition. See the docs for individual object types in [Configuring Icinga 2](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2) for more info about which object parameters have what default values. **However**, this doesn't mean that the values are undefined in Icinga 2. Icinga 2 itself has built-in default values for many object parameters and falls back to them if one isn't present in an object definition. See the docs for individual object types in [Configuring Icinga 2](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2) for more info about which object parameters have what default values.
####`icinga2::object::host` ####`icinga2::object::host`

View file

@ -7,12 +7,12 @@
# Coming soon... # Coming soon...
# #
# === Examples # === Examples
# #
# Coming soon... # Coming soon...
# #
#Our base class. #Our base class.
class icinga2 { class icinga2 {
} }

View file

@ -25,4 +25,4 @@ class icinga2::nrpe (
class {'icinga2::nrpe::install':} ~> class {'icinga2::nrpe::install':} ~>
class {'icinga2::nrpe::config':} ~> class {'icinga2::nrpe::config':} ~>
class {'icinga2::nrpe::service':} class {'icinga2::nrpe::service':}
} }

View file

@ -6,7 +6,7 @@
# * $command_name = What NRPE will know the command as; this defaults to the title of the resource # * $command_name = What NRPE will know the command as; this defaults to the title of the resource
# * $nrpe_plugin_libdir = The directory where the NRPE plugins themselves live # * $nrpe_plugin_libdir = The directory where the NRPE plugins themselves live
# * $nrpe_plugin_name = The name of the plugin the command will run # * $nrpe_plugin_name = The name of the plugin the command will run
# * $nrpe_plugin_args = The arguments to pass to the plugin. This may be optional, # * $nrpe_plugin_args = The arguments to pass to the plugin. This may be optional,
# depending on the plugin and whether it expects any arguments or parameters # depending on the plugin and whether it expects any arguments or parameters
define icinga2::nrpe::command ( define icinga2::nrpe::command (

View file

@ -4,11 +4,11 @@
# #
class icinga2::nrpe::config inherits icinga2::nrpe { class icinga2::nrpe::config inherits icinga2::nrpe {
include icinga2::nrpe include icinga2::nrpe
#config resources here #config resources here
#The NRPE configuration base directory: #The NRPE configuration base directory:
file { $nrpe_config_basedir: file { $nrpe_config_basedir:
ensure => directory, ensure => directory,
@ -17,7 +17,7 @@ class icinga2::nrpe::config inherits icinga2::nrpe {
mode => '755', mode => '755',
require => Package[$icinga2::params::icinga2_client_packages], require => Package[$icinga2::params::icinga2_client_packages],
} }
#The folder that will hold our command definition files: #The folder that will hold our command definition files:
file { '/etc/nagios/nrpe.d': file { '/etc/nagios/nrpe.d':
ensure => directory, ensure => directory,

View file

@ -4,7 +4,7 @@
# #
class icinga2::nrpe::install inherits icinga2::nrpe { class icinga2::nrpe::install inherits icinga2::nrpe {
include icinga2::nrpe include icinga2::nrpe
#Apply our subclasses in the right order. Use the squiggly arrows (~>) to ensure that the #Apply our subclasses in the right order. Use the squiggly arrows (~>) to ensure that the
#class left is applied before the class on the right and that it also refreshes the #class left is applied before the class on the right and that it also refreshes the
@ -18,7 +18,7 @@ class icinga2::nrpe::install inherits icinga2::nrpe {
#Package repositories #Package repositories
################## ##################
class icinga2::nrpe::install::repos inherits icinga2::nrpe { class icinga2::nrpe::install::repos inherits icinga2::nrpe {
include icinga2::nrpe include icinga2::nrpe
#repository resources here #repository resources here
@ -47,4 +47,4 @@ class icinga2::nrpe::install::execs {
#exec resources here #exec resources here
} }

View file

@ -32,6 +32,5 @@ define icinga2::nrpe::plugin (
require => Package[$icinga2::params::icinga2_client_packages], require => Package[$icinga2::params::icinga2_client_packages],
notify => Service[$icinga2::params::nrpe_daemon_name] notify => Service[$icinga2::params::nrpe_daemon_name]
} }
} }

View file

@ -1,6 +1,6 @@
# == Class: icinga2::params # == Class: icinga2::params
# #
# This class is intentionally empty. It just serves as a container class for other # This class is intentionally empty. It just serves as a container class for other
# icinga2::object:: classes to make the module's file layout cleaner (all object defined types # icinga2::object:: classes to make the module's file layout cleaner (all object defined types
# can be put into an objects/ subdirectory) # can be put into an objects/ subdirectory)
# #
@ -10,4 +10,4 @@
# more details. # more details.
# #
class icinga2::objects { } class icinga2::objects { }

View file

@ -43,7 +43,7 @@ define icinga2::object::apply_service_to_host (
$target_file_group = 'root', $target_file_group = 'root',
$target_file_mode = '644' $target_file_mode = '644'
) { ) {
#Do some validation of the class' parameters: #Do some validation of the class' parameters:
validate_string($object_servicename) validate_string($object_servicename)
validate_string($template_to_import) validate_string($template_to_import)
@ -65,4 +65,4 @@ define icinga2::object::apply_service_to_host (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -1,5 +1,5 @@
# == Defined type: icinga2::object::host # == Defined type: icinga2::object::host
# #
# This is a defined type for Icinga 2 host objects. # This is a defined type for Icinga 2 host objects.
# See the following Icinga 2 doc page for more info: # See the following Icinga 2 doc page for more info:
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-host # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-host
@ -48,7 +48,7 @@ define icinga2::object::host (
validate_string($object_hostname) validate_string($object_hostname)
validate_string($template_to_import) validate_string($template_to_import)
validate_string($display_name) validate_string($display_name)
validate_string($ipv4_address) validate_string($ipv4_address)
validate_array($groups) validate_array($groups)
validate_hash($vars) validate_hash($vars)
validate_string($target_dir) validate_string($target_dir)
@ -66,4 +66,4 @@ define icinga2::object::host (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -43,4 +43,4 @@ define icinga2::object::hostgroup (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -1,5 +1,5 @@
# == Defined type: icinga2::object::idomysqlconnection # == Defined type: icinga2::object::idomysqlconnection
# #
# This is a defined type for Icinga 2 IDO MySQL connection objects. # This is a defined type for Icinga 2 IDO MySQL connection objects.
# See the following Icinga 2 doc page for more info: # See the following Icinga 2 doc page for more info:
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-idomysqlconnection # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-idomysqlconnection
@ -35,7 +35,6 @@ define icinga2::object::idomysqlconnection (
statehistory_age => 0, statehistory_age => 0,
servicechecks_age => 0, servicechecks_age => 0,
systemcommands_age => 0 systemcommands_age => 0
}, },
$categories = [], $categories = [],
$target_dir = '/etc/icinga2/conf.d', $target_dir = '/etc/icinga2/conf.d',
@ -49,11 +48,11 @@ define icinga2::object::idomysqlconnection (
validate_string($object_name) validate_string($object_name)
validate_string($template_to_import) validate_string($template_to_import)
validate_string($host) validate_string($host)
validate_string($user) validate_string($user)
validate_string($password) validate_string($password)
validate_string($database) validate_string($database)
validate_string($table_prefix) validate_string($table_prefix)
validate_string($instance_name) validate_string($instance_name)
validate_hash($cleanup) validate_hash($cleanup)
validate_array($categories) validate_array($categories)
validate_string($target_dir) validate_string($target_dir)
@ -71,4 +70,4 @@ define icinga2::object::idomysqlconnection (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -1,5 +1,5 @@
# == Defined type: icinga2::object::idopgsqlconnection # == Defined type: icinga2::object::idopgsqlconnection
# #
# This is a defined type for Icinga 2 IDO Postgres connection objects. # This is a defined type for Icinga 2 IDO Postgres connection objects.
# See the following Icinga 2 doc page for more info: # See the following Icinga 2 doc page for more info:
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-idopgsqlconnection # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-idopgsqlconnection
@ -35,7 +35,6 @@ define icinga2::object::idopgsqlconnection (
statehistory_age => 0, statehistory_age => 0,
servicechecks_age => 0, servicechecks_age => 0,
systemcommands_age => 0 systemcommands_age => 0
}, },
$categories = [], $categories = [],
$target_dir = '/etc/icinga2/conf.d', $target_dir = '/etc/icinga2/conf.d',
@ -49,11 +48,11 @@ define icinga2::object::idopgsqlconnection (
validate_string($object_name) validate_string($object_name)
validate_string($template_to_import) validate_string($template_to_import)
validate_string($host) validate_string($host)
validate_string($user) validate_string($user)
validate_string($password) validate_string($password)
validate_string($database) validate_string($database)
validate_string($table_prefix) validate_string($table_prefix)
validate_string($instance_name) validate_string($instance_name)
validate_hash($cleanup) validate_hash($cleanup)
validate_array($categories) validate_array($categories)
validate_string($target_dir) validate_string($target_dir)
@ -71,4 +70,4 @@ define icinga2::object::idopgsqlconnection (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -47,7 +47,7 @@ define icinga2::object::service (
validate_string($object_servicename) validate_string($object_servicename)
validate_string($template_to_import) validate_string($template_to_import)
validate_string($display_name) validate_string($display_name)
validate_string($host_name) validate_string($host_name)
validate_array($groups) validate_array($groups)
validate_hash($vars) validate_hash($vars)
validate_string($target_dir) validate_string($target_dir)

View file

@ -26,7 +26,7 @@ define icinga2::object::servicegroup (
#Do some validation of the class' parameters: #Do some validation of the class' parameters:
validate_string($object_servicegroup_name) validate_string($object_servicegroup_name)
validate_string($template_to_import) validate_string($template_to_import)
validate_string($display_name) validate_string($display_name)
validate_array($groups) validate_array($groups)
validate_string($target_dir) validate_string($target_dir)
validate_string($target_file_name) validate_string($target_file_name)
@ -43,4 +43,4 @@ define icinga2::object::servicegroup (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -1,5 +1,5 @@
# == Defined type: icinga2::object::user # == Defined type: icinga2::object::user
# #
# This is a defined type for Icinga 2 user objects. # This is a defined type for Icinga 2 user objects.
# See the following Icinga 2 doc page for more info: # See the following Icinga 2 doc page for more info:
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-user # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-user
@ -30,7 +30,7 @@ define icinga2::object::user (
#Do some validation of the class' parameters: #Do some validation of the class' parameters:
validate_string($object_username) validate_string($object_username)
validate_string($display_name) validate_string($display_name)
validate_string($host_name) validate_string($host_name)
validate_array($groups) validate_array($groups)
validate_hash($vars) validate_hash($vars)
validate_array($types) validate_array($types)
@ -50,4 +50,4 @@ define icinga2::object::user (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -42,4 +42,4 @@ define icinga2::object::usergroup (
notify => Service['icinga2'], notify => Service['icinga2'],
} }
} }

View file

@ -19,17 +19,17 @@ class icinga2::params {
# Icinga 2 common package parameters # Icinga 2 common package parameters
case $::operatingsystem { case $::operatingsystem {
#CentOS systems: #CentOS systems:
'CentOS': { 'CentOS': {
#Pick the right package provider: #Pick the right package provider:
$package_provider = 'yum' $package_provider = 'yum'
} }
#Ubuntu systems: #Ubuntu systems:
'Ubuntu': { 'Ubuntu': {
#Pick the right package provider: #Pick the right package provider:
$package_provider = 'apt' $package_provider = 'apt'
} }
#Fail if we're on any other OS: #Fail if we're on any other OS:
default: { fail("${::operatingsystem} is not supported!") } default: { fail("${::operatingsystem} is not supported!") }
} }
@ -63,8 +63,8 @@ class icinga2::params {
$icinga2_server_package = 'icinga2' $icinga2_server_package = 'icinga2'
$icinga2_server_plugin_packages = ["nagios-plugins-nrpe", "nagios-plugins-all", "nagios-plugins-openmanage", "nagios-plugins-check-updates"] $icinga2_server_plugin_packages = ["nagios-plugins-nrpe", "nagios-plugins-all", "nagios-plugins-openmanage", "nagios-plugins-check-updates"]
} }
#Ubuntu systems: #Ubuntu systems:
'Ubuntu': { 'Ubuntu': {
case $::operatingsystemrelease { case $::operatingsystemrelease {
#Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available... #Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available...
@ -83,7 +83,7 @@ class icinga2::params {
} }
} }
} }
#Fail if we're on any other OS: #Fail if we're on any other OS:
default: { fail("${::operatingsystem} is not supported!") } default: { fail("${::operatingsystem} is not supported!") }
} }
@ -135,8 +135,8 @@ class icinga2::params {
$etc_icinga2_obejcts_sub_dir_group = 'icinga' $etc_icinga2_obejcts_sub_dir_group = 'icinga'
$etc_icinga2_obejcts_sub_dir_mode = '750' $etc_icinga2_obejcts_sub_dir_mode = '750'
} }
#Ubuntu systems: #Ubuntu systems:
'Ubuntu': { 'Ubuntu': {
case $::operatingsystemrelease { case $::operatingsystemrelease {
@ -229,25 +229,25 @@ class icinga2::params {
} }
} }
#Fail if we're on any other OS: #Fail if we're on any other OS:
default: { fail("${::operatingsystem} is not supported!") } default: { fail("${::operatingsystem} is not supported!") }
} }
################## ##################
# Icinga 2 server service settings # Icinga 2 server service settings
case $::operatingsystem { case $::operatingsystem {
#Icinga 2 server daemon names for Red Had/CentOS systems: #Icinga 2 server daemon names for Red Had/CentOS systems:
'CentOS': { 'CentOS': {
$icinga2_server_service_name = 'icinga2' $icinga2_server_service_name = 'icinga2'
} }
#Icinga 2 server daemon names for Ubuntu systems: #Icinga 2 server daemon names for Ubuntu systems:
'Ubuntu': { 'Ubuntu': {
$icinga2_server_service_name = 'icinga2' $icinga2_server_service_name = 'icinga2'
} }
#Fail if we're on any other OS: #Fail if we're on any other OS:
default: { fail("${::operatingsystem} is not supported!") } default: { fail("${::operatingsystem} is not supported!") }
} }
@ -255,9 +255,9 @@ class icinga2::params {
############################## ##############################
# Icinga 2 client parameters # Icinga 2 client parameters
############################## ##############################
################## ##################
# Icinga 2 client settings # Icinga 2 client settings
$nrpe_listen_port = '5666' $nrpe_listen_port = '5666'
$nrpe_log_facility = 'daemon' $nrpe_log_facility = 'daemon'
$nrpe_debug_level = '0' $nrpe_debug_level = '0'
@ -265,9 +265,9 @@ class icinga2::params {
$nrpe_command_timeout = '60' $nrpe_command_timeout = '60'
#in seconds: #in seconds:
$nrpe_connection_timeout = '300' $nrpe_connection_timeout = '300'
#Note: because we use .join in the nrpe.cfg.erb template, this value *must* be an array #Note: because we use .join in the nrpe.cfg.erb template, this value *must* be an array
$nrpe_allowed_hosts = ['127.0.0.1',] $nrpe_allowed_hosts = ['127.0.0.1',]
case $::operatingsystem { case $::operatingsystem {
#File and template variable names for Red Had/CentOS systems: #File and template variable names for Red Had/CentOS systems:
'CentOS': { 'CentOS': {
@ -296,9 +296,9 @@ class icinga2::params {
'CentOS': { 'CentOS': {
#Pick the right list of client packages: #Pick the right list of client packages:
$icinga2_client_packages = ["nrpe", "nagios-plugins-nrpe", "nagios-plugins-all", "nagios-plugins-openmanage", "nagios-plugins-check-updates"] $icinga2_client_packages = ["nrpe", "nagios-plugins-nrpe", "nagios-plugins-all", "nagios-plugins-openmanage", "nagios-plugins-check-updates"]
} }
#Ubuntu systems: #Ubuntu systems:
'Ubuntu': { 'Ubuntu': {
case $::operatingsystemrelease { case $::operatingsystemrelease {
#Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available... #Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available...
@ -315,7 +315,7 @@ class icinga2::params {
} }
} }
} }
#Fail if we're on any other OS: #Fail if we're on any other OS:
default: { fail("${::operatingsystem} is not supported!") } default: { fail("${::operatingsystem} is not supported!") }
} }
@ -327,12 +327,12 @@ class icinga2::params {
'CentOS': { 'CentOS': {
$nrpe_daemon_name = 'nrpe' $nrpe_daemon_name = 'nrpe'
} }
#Daemon names for Ubuntu systems: #Daemon names for Ubuntu systems:
'Ubuntu': { 'Ubuntu': {
$nrpe_daemon_name = 'nagios-nrpe-server' $nrpe_daemon_name = 'nagios-nrpe-server'
} }
#Fail if we're on any other OS: #Fail if we're on any other OS:
default: { fail("${::operatingsystem} is not supported!") } default: { fail("${::operatingsystem} is not supported!") }
} }

View file

@ -23,7 +23,7 @@ class icinga2::server (
$icinga2_server_package = $icinga2::params::icinga2_server_package, $icinga2_server_package = $icinga2::params::icinga2_server_package,
$server_install_nagios_plugins = $icinga2::params::server_install_nagios_plugins, $server_install_nagios_plugins = $icinga2::params::server_install_nagios_plugins,
) inherits icinga2::params { ) inherits icinga2::params {
#Do some validation of parameters so we know we have the right data types: #Do some validation of parameters so we know we have the right data types:
validate_bool($manage_repos) validate_bool($manage_repos)
validate_string($server_db_type) validate_string($server_db_type)

View file

@ -7,14 +7,14 @@
# Coming soon... # Coming soon...
# #
# === Examples # === Examples
# #
# Coming soon... # Coming soon...
# #
class icinga2::server::config inherits icinga2::server { class icinga2::server::config inherits icinga2::server {
include icinga2::params include icinga2::params
#Directory resource for /etc/icinga2/: #Directory resource for /etc/icinga2/:
file { '/etc/icinga2/': file { '/etc/icinga2/':
path => '/etc/icinga2/', path => '/etc/icinga2/',
@ -61,7 +61,7 @@ class icinga2::server::config inherits icinga2::server {
group => $etc_icinga2_features_enabled_group, group => $etc_icinga2_features_enabled_group,
mode => $etc_icinga2_features_enabled_mode, mode => $etc_icinga2_features_enabled_mode,
} }
#Directory resource for /etc/icinga2/pki/: #Directory resource for /etc/icinga2/pki/:
file { '/etc/icinga2/pki/': file { '/etc/icinga2/pki/':
path => '/etc/icinga2/pki/', path => '/etc/icinga2/pki/',
@ -91,7 +91,7 @@ class icinga2::server::config inherits icinga2::server {
#File and directory resources for the object directories that can be used to hold different #File and directory resources for the object directories that can be used to hold different
#types of configuration objects #types of configuration objects
#Directory resource for /etc/icinga2/objects/: #Directory resource for /etc/icinga2/objects/:
file { '/etc/icinga2/objects/': file { '/etc/icinga2/objects/':
path => '/etc/icinga2/objects/', path => '/etc/icinga2/objects/',
@ -372,7 +372,7 @@ class icinga2::server::config inherits icinga2::server {
} }
#Directory resource for /etc/icinga2/objects/applys/ #Directory resource for /etc/icinga2/objects/applys/
#The files in this folder will be objects like #The files in this folder will be objects like
#'apply something blah to Host...' #'apply something blah to Host...'
#See the following link for more info: #See the following link for more info:
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#apply # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#apply
@ -403,4 +403,4 @@ class icinga2::server::config inherits icinga2::server {
mode => $etc_icinga2_obejcts_sub_dir_mode, mode => $etc_icinga2_obejcts_sub_dir_mode,
} }
} }

View file

@ -7,23 +7,23 @@
# Coming soon... # Coming soon...
# #
# === Examples # === Examples
# #
# Coming soon... # Coming soon...
# #
class icinga2::server::install inherits icinga2::server { class icinga2::server::install inherits icinga2::server {
include icinga2::server include icinga2::server
#Apply our classes in the right order. Use the squiggly arrows (~>) to ensure that the #Apply our classes in the right order. Use the squiggly arrows (~>) to ensure that the
#class left is applied before the class on the right and that it also refreshes the #class left is applied before the class on the right and that it also refreshes the
#class on the right. #class on the right.
# #
#Here, we're setting up the package repos first, then installing the packages: #Here, we're setting up the package repos first, then installing the packages:
class{'icinga2::server::install::repos':} ~> class{'icinga2::server::install::repos':} ~>
class{'icinga2::server::install::packages':} ~> class{'icinga2::server::install::packages':} ~>
class{'icinga2::server::install::execs':} -> class{'icinga2::server::install::execs':} ->
Class['icinga2::server::install'] Class['icinga2::server::install']
} }
class icinga2::server::install::repos inherits icinga2::server { class icinga2::server::install::repos inherits icinga2::server {
@ -64,7 +64,7 @@ class icinga2::server::install::repos inherits icinga2::server {
class icinga2::server::install::packages inherits icinga2::server { class icinga2::server::install::packages inherits icinga2::server {
include icinga2::server include icinga2::server
#Install the Icinga 2 package #Install the Icinga 2 package
package {$icinga2_server_package: package {$icinga2_server_package:
ensure => installed, ensure => installed,
@ -142,7 +142,7 @@ class icinga2::server::install::execs inherits icinga2::server {
require => Exec['postgres_schema_load'], require => Exec['postgres_schema_load'],
} }
} }
default: { fail("${server_db_type} is not supported!") } default: { fail("${server_db_type} is not supported!") }
} }
} }

View file

@ -7,12 +7,12 @@
# Coming soon... # Coming soon...
# #
# === Examples # === Examples
# #
# Coming soon... # Coming soon...
# #
class icinga2::server::service inherits icinga2::server { class icinga2::server::service inherits icinga2::server {
include icinga2::server include icinga2::server
#Service resource for the Icinga 2 daemon: #Service resource for the Icinga 2 daemon:
@ -20,5 +20,5 @@ class icinga2::server::service inherits icinga2::server {
ensure => running, ensure => running,
subscribe => Class['icinga2::server::config'], subscribe => Class['icinga2::server::config'],
} }
} }

View file

@ -1,7 +1,7 @@
###################################################################################### ######################################################################################
# /etc/icinga2/icinga2.conf config file template. Based on the file included in # /etc/icinga2/icinga2.conf config file template. Based on the file included in
# the Icinga 2 apt and yum packages. # the Icinga 2 apt and yum packages
# Autogenerated by Puppet # Autogenerated by Puppet
# (c) Nicholas Chappell, 2014 # (c) Nicholas Chappell, 2014
###################################################################################### ######################################################################################
@ -59,4 +59,4 @@ include_recursive "conf.d"
/** /**
* Include all .conf files in the objects/ directory too: * Include all .conf files in the objects/ directory too:
*/ */
include_recursive "objects" include_recursive "objects"

View file

@ -1,7 +1,7 @@
###################################################################################### ######################################################################################
# etc/nagios/nrpe.cfg config file template. Based on the file included in # etc/nagios/nrpe.cfg config file template. Based on the file included in
# the Icinga apt package. # the Icinga apt package
# Autogenerated by Puppet # Autogenerated by Puppet
# (c) Nicholas Chappell, 2014 # (c) Nicholas Chappell, 2014
###################################################################################### ######################################################################################
@ -14,9 +14,9 @@
########################################### ###########################################
############################################################################# #############################################################################
# Sample NRPE Config File # Sample NRPE Config File
# Written by: Ethan Galstad (nagios@nagios.org) # Written by: Ethan Galstad (nagios@nagios.org)
# #
# Last Modified: 11-23-2007 # Last Modified: 11-23-2007
# #
# NOTES: # NOTES:
@ -60,9 +60,9 @@ server_port=<%= scope.lookupvar('icinga2::nrpe::nrpe_listen_port') %>
# NRPE USER # NRPE USER
# This determines the effective user that the NRPE daemon should run as. # This determines the effective user that the NRPE daemon should run as
# You can either supply a username or a UID. # You can either supply a username or a UID.
# #
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd # NOTE: This option is ignored if NRPE is running under either inetd or xinetd
nrpe_user=<%= scope.lookupvar('icinga2::nrpe::nrpe_user') %> nrpe_user=<%= scope.lookupvar('icinga2::nrpe::nrpe_user') %>
@ -70,9 +70,9 @@ nrpe_user=<%= scope.lookupvar('icinga2::nrpe::nrpe_user') %>
# NRPE GROUP # NRPE GROUP
# This determines the effective group that the NRPE daemon should run as. # This determines the effective group that the NRPE daemon should run as.
# You can either supply a group name or a GID. # You can either supply a group name or a GID.
# #
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd # NOTE: This option is ignored if NRPE is running under either inetd or xinetd
nrpe_group=<%= scope.lookupvar('icinga2::nrpe::nrpe_group') %> nrpe_group=<%= scope.lookupvar('icinga2::nrpe::nrpe_group') %>
@ -80,9 +80,9 @@ nrpe_group=<%= scope.lookupvar('icinga2::nrpe::nrpe_group') %>
# ALLOWED HOST ADDRESSES # ALLOWED HOST ADDRESSES
# This is an optional comma-delimited list of IP address or hostnames # This is an optional comma-delimited list of IP address or hostnames
# that are allowed to talk to the NRPE daemon. Network addresses with a bit mask # that are allowed to talk to the NRPE daemon. Network addresses with a bit mask
# (i.e. 192.168.1.0/24) are also supported. Hostname wildcards are not currently # (i.e. 192.168.1.0/24) are also supported. Hostname wildcards are not currently
# supported. # supported.
# #
# Note: The daemon only does rudimentary checking of the client's IP # Note: The daemon only does rudimentary checking of the client's IP
@ -93,16 +93,16 @@ nrpe_group=<%= scope.lookupvar('icinga2::nrpe::nrpe_group') %>
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd # NOTE: This option is ignored if NRPE is running under either inetd or xinetd
allowed_hosts=<%= scope.lookupvar('icinga2::nrpe::nrpe_allowed_hosts').join(',') %> allowed_hosts=<%= scope.lookupvar('icinga2::nrpe::nrpe_allowed_hosts').join(',') %>
# COMMAND ARGUMENT PROCESSING # COMMAND ARGUMENT PROCESSING
# This option determines whether or not the NRPE daemon will allow clients # This option determines whether or not the NRPE daemon will allow clients
# to specify arguments to commands that are executed. This option only works # to specify arguments to commands that are executed. This option only works
# if the daemon was configured with the --enable-command-args configure script # if the daemon was configured with the --enable-command-args configure script
# option. # option.
# #
# *** ENABLING THIS OPTION IS A SECURITY RISK! *** # *** ENABLING THIS OPTION IS A SECURITY RISK! ***
# Read the SECURITY file for information on some of the security implications # Read the SECURITY file for information on some of the security implications
# of enabling this variable. # of enabling this variable.
# #
@ -118,9 +118,9 @@ dont_blame_nrpe=0
# command line from the command definition. # command line from the command definition.
# #
# *** THIS EXAMPLE MAY POSE A POTENTIAL SECURITY RISK, SO USE WITH CAUTION! *** # *** THIS EXAMPLE MAY POSE A POTENTIAL SECURITY RISK, SO USE WITH CAUTION! ***
# Usage scenario: # Usage scenario:
# Execute restricted commmands using sudo. For this to work, you need to add # Execute restricted commmands using sudo. For this to work, you need to add
# the nagios user to your /etc/sudoers. An example entry for alllowing # the nagios user to your /etc/sudoers. An example entry for alllowing
# execution of the plugins from might be: # execution of the plugins from might be:
# #
# nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/ # nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/
@ -129,7 +129,7 @@ dont_blame_nrpe=0
# without asking for a password. If you do this, make sure you don't give # without asking for a password. If you do this, make sure you don't give
# random users write access to that directory or its contents! # random users write access to that directory or its contents!
# command_prefix=/usr/bin/sudo # command_prefix=/usr/bin/sudo
@ -216,11 +216,11 @@ connection_timeout=<%= scope.lookupvar('icinga2::nrpe::nrpe_connection_timeout')
#command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 #command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
#command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1 #command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
#command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z #command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
#command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200 #command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
# The following examples allow user-supplied arguments and can # The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for # only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this # command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'. This poses a potential security risk, so # config file is set to '1'. This poses a potential security risk, so
# make sure you read the SECURITY file before doing this. # make sure you read the SECURITY file before doing this.
@ -235,7 +235,7 @@ connection_timeout=<%= scope.lookupvar('icinga2::nrpe::nrpe_connection_timeout')
# if you'd prefer, you can instead place directives here # if you'd prefer, you can instead place directives here
#include=/etc/nagios/nrpe_local.cfg #include=/etc/nagios/nrpe_local.cfg
# #
# you can place your config snipplets into nrpe.d/ # you can place your config snipplets into nrpe.d/
# only snipplets ending in .cfg will get included # only snipplets ending in .cfg will get included
include_dir=/etc/nagios/nrpe.d/ include_dir=/etc/nagios/nrpe.d/

View file

@ -13,7 +13,7 @@
object Host "<%= @object_hostname %>" { object Host "<%= @object_hostname %>" {
<%#- If any of the @ parameters are undefined, don't print anything for them: -%> <%#- If any of the @ parameters are undefined, don't print anything for them: -%>
<%- if @template_to_import -%> <%- if @template_to_import -%>
<%#- Otherwise, include the parameter: -%> <%#- Otherwise, include the parameter: -%>
import "<%= @template_to_import -%>" import "<%= @template_to_import -%>"
<%- end -%> <%- end -%>
<%- if @display_name -%> <%- if @display_name -%>

View file

@ -13,7 +13,7 @@
object HostGroup "<%= @object_hostgroup_name %>" { object HostGroup "<%= @object_hostgroup_name %>" {
<%#- If any of the @ parameters are undefined, don't print anything for them: -%> <%#- If any of the @ parameters are undefined, don't print anything for them: -%>
<%- if @template_to_import -%> <%- if @template_to_import -%>
<%#- Otherwise, include the parameter: -%> <%#- Otherwise, include the parameter: -%>
import "<%= @template_to_import -%>" import "<%= @template_to_import -%>"
<%- end -%> <%- end -%>
<%- if @display_name -%> <%- if @display_name -%>
@ -28,4 +28,4 @@ object HostGroup "<%= @object_hostgroup_name %>" {
<%- if @ignore_where -%> <%- if @ignore_where -%>
ignore where "<%= @ignore_where -%>" ignore where "<%= @ignore_where -%>"
<%- end -%> <%- end -%>
} }

View file

@ -13,7 +13,7 @@
object ServiceGroup "<%= @object_servicegroup_name %>" { object ServiceGroup "<%= @object_servicegroup_name %>" {
<%#- If any of the @ parameters are undefined, don't print anything for them: -%> <%#- If any of the @ parameters are undefined, don't print anything for them: -%>
<%- if @template_to_import -%> <%- if @template_to_import -%>
<%#- Otherwise, include the parameter: -%> <%#- Otherwise, include the parameter: -%>
import "<%= @template_to_import -%>" import "<%= @template_to_import -%>"
<%- end -%> <%- end -%>
<%- if @display_name -%> <%- if @display_name -%>
@ -28,4 +28,4 @@ object ServiceGroup "<%= @object_servicegroup_name %>" {
<%- if @ignore_where -%> <%- if @ignore_where -%>
ignore where "<%= @ignore_where -%>" ignore where "<%= @ignore_where -%>"
<%- end -%> <%- end -%>
} }

View file

@ -13,7 +13,7 @@
object UserGroup "<%= @object_usergroup_name %>" { object UserGroup "<%= @object_usergroup_name %>" {
<%#- If any of the @ parameters are undefined, don't print anything for them: -%> <%#- If any of the @ parameters are undefined, don't print anything for them: -%>
<%- if @template_to_import -%> <%- if @template_to_import -%>
<%#- Otherwise, include the parameter: -%> <%#- Otherwise, include the parameter: -%>
import "<%= @template_to_import -%>" import "<%= @template_to_import -%>"
<%- end -%> <%- end -%>
<%- if @display_name -%> <%- if @display_name -%>
@ -22,4 +22,4 @@ object UserGroup "<%= @object_usergroup_name %>" {
<%- if @groups.length != 0 -%> <%- if @groups.length != 0 -%>
groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>] groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>]
<%- end -%> <%- end -%>
} }