summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-03-04 16:40:27 +0100
committervarac <varacanero@zeromail.org>2014-03-04 18:18:37 +0100
commit8d77d623106d5e5edd52c086568d5caa1cb87413 (patch)
tree987cd888fa905f6679b7fea6c8fe85b11f8068a1 /manifests
parent764cd8a0122483dce6e0a37e303b757ec0a6449e (diff)
use check_mk::server::collect_hosts for collecting storedconfig nodes
Diffstat (limited to 'manifests')
-rw-r--r--manifests/config.pp16
-rw-r--r--manifests/init.pp10
-rw-r--r--manifests/server/collect_hosts.pp6
3 files changed, 21 insertions, 11 deletions
diff --git a/manifests/config.pp b/manifests/config.pp
index f764397..6a6f375 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -1,9 +1,10 @@
class check_mk::config (
$site,
- $host_groups = undef,
- $etc_dir = "/omd/sites/${site}/etc",
- $nagios_subdir = 'nagios',
- $bin_dir = "/omd/sites/${site}/bin"
+ $host_groups = undef,
+ $etc_dir = "/omd/sites/${site}/etc",
+ $nagios_subdir = 'nagios',
+ $bin_dir = "/omd/sites/${site}/bin",
+ $use_storedconfigs = true
) {
file { "${etc_dir}/${nagios_subdir}/local":
ensure => directory,
@@ -38,10 +39,11 @@ class check_mk::config (
content => "]\n",
order => 19,
}
- Check_mk::Host <<| |>> {
- target => "${etc_dir}/check_mk/main.mk",
- notify => Exec['check_mk-refresh']
+ if ( $use_storedconfigs ) {
+ class { 'check_mk::server::collect_hosts': }
}
+
+
# local list of hosts is in /omd/sites/${site}/etc/check_mk/all_hosts_static and is appended
concat::fragment { 'all-hosts-static':
ensure => "${etc_dir}/check_mk/all_hosts_static",
diff --git a/manifests/init.pp b/manifests/init.pp
index 999541d..7296941 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -10,7 +10,8 @@ class check_mk (
$omdadmin_htpasswd = undef,
$use_ssh = false,
$shelluser = 'monitoring',
- $shellgroup = 'monitoring' ) {
+ $shellgroup = 'monitoring',
+ $use_storedconfigs = true ) {
class { 'check_mk::install':
filestore => $filestore,
@@ -19,9 +20,10 @@ class check_mk (
workspace => $workspace,
}
class { 'check_mk::config':
- host_groups => $host_groups,
- site => $site,
- require => Class['check_mk::install'],
+ host_groups => $host_groups,
+ site => $site,
+ use_storedconfigs => $use_storedconfigs,
+ require => Class['check_mk::install'],
}
class { 'check_mk::service':
require => Class['check_mk::config'],
diff --git a/manifests/server/collect_hosts.pp b/manifests/server/collect_hosts.pp
new file mode 100644
index 0000000..6d07897
--- /dev/null
+++ b/manifests/server/collect_hosts.pp
@@ -0,0 +1,6 @@
+class check_mk::server::collect_hosts {
+ Check_mk::Host <<| |>> {
+ target => "${::check_mk::config::etc_dir}/check_mk/main.mk",
+ notify => Exec['check_mk-refresh']
+ }
+}