diff options
author | varac <varacanero@zeromail.org> | 2016-05-03 21:48:57 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-05-03 21:48:57 +0200 |
commit | 265ed2182f790a723996fd84de4dfcb93f800ee0 (patch) | |
tree | 0bc0e1cbd65a3260e8353343d0daa5ccb5ec3662 | |
parent | 3df00e29388adbf1c0e058df09a7c3886edbaca1 (diff) | |
parent | 385402972a3f4566393faaf28bf09cbcc5191ab0 (diff) |
Merge remote-tracking branch 'shared/master' into leap_master
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | manifests/config.pp | 15 | ||||
-rw-r--r-- | manifests/init.pp | 37 |
3 files changed, 34 insertions, 24 deletions
@@ -76,6 +76,12 @@ created making the URL http://hostname/acme/check_mk/ running as the 'acme' user *use_ssh*: Configures ssh to agents that use the same parameter. Default: false. +*inventory_only_on_changes*: By default (parameter set to `true`) these two execs are called + only when config files changes: + - Exec['check_mk-refresh'] (which runs a check inventory by calling `check_mk -II`) + - Exec['check_mk-reload'] (which generates the nagios config and reloads nagios by calling `check_mk -O`) + By setting this parameter to `false` these execs will be called on each puppetrun. + ### Notes * A user and group with the same value as the site parameter is created. By default this is 'monitoring'. diff --git a/manifests/config.pp b/manifests/config.pp index a9f99d8..522be19 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,11 +1,12 @@ # Deploy check_mk config class check_mk::config ( $site, - $host_groups = undef, - $etc_dir = "/omd/sites/${site}/etc", - $nagios_subdir = 'nagios', - $bin_dir = "/omd/sites/${site}/bin", - $use_storedconfigs = true + $host_groups = undef, + $etc_dir = "/omd/sites/${site}/etc", + $nagios_subdir = 'nagios', + $bin_dir = "/omd/sites/${site}/bin", + $use_storedconfigs = true, + $inventory_only_on_changes = true ) { file { # for local check_mk checks @@ -93,12 +94,12 @@ class check_mk::config ( # re-read config if it changes exec { 'check_mk-refresh': command => "/bin/su -l -c '${bin_dir}/check_mk -II' ${site}", - refreshonly => true, + refreshonly => $inventory_only_on_changes, notify => Exec['check_mk-reload'], } exec { 'check_mk-reload': command => "/bin/su -l -c '${bin_dir}/check_mk -O' ${site}", - refreshonly => true, + refreshonly => $inventory_only_on_changes, creates => '/etc/nagios3/conf.d/check_mk/check_mk_objects.cfg' } # re-read inventory at least daily diff --git a/manifests/init.pp b/manifests/init.pp index 7296941..4aab837 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,17 +1,19 @@ +# configure check_mk server class check_mk ( - $filestore = undef, - $host_groups = undef, - $package = 'omd-0.56', - $site = 'monitoring', - $workspace = '/root/check_mk', - $omd_service_name = 'omd', - $http_service_name = 'httpd', - $xinitd_service_name = 'xinetd', - $omdadmin_htpasswd = undef, - $use_ssh = false, - $shelluser = 'monitoring', - $shellgroup = 'monitoring', - $use_storedconfigs = true ) { + $filestore = undef, + $host_groups = undef, + $package = 'omd-0.56', + $site = 'monitoring', + $workspace = '/root/check_mk', + $omd_service_name = 'omd', + $http_service_name = 'httpd', + $xinitd_service_name = 'xinetd', + $omdadmin_htpasswd = undef, + $use_ssh = false, + $shelluser = 'monitoring', + $shellgroup = 'monitoring', + $use_storedconfigs = true, + $inventory_only_on_changes = true) { class { 'check_mk::install': filestore => $filestore, @@ -20,10 +22,11 @@ class check_mk ( workspace => $workspace, } class { 'check_mk::config': - host_groups => $host_groups, - site => $site, - use_storedconfigs => $use_storedconfigs, - require => Class['check_mk::install'], + host_groups => $host_groups, + site => $site, + use_storedconfigs => $use_storedconfigs, + inventory_only_on_changes => $inventory_only_on_changes, + require => Class['check_mk::install'], } class { 'check_mk::service': require => Class['check_mk::config'], |