summaryrefslogtreecommitdiff
path: root/manifests/hostgroup.pp
diff options
context:
space:
mode:
authorKeith Burdis <keith@burdis.org>2013-02-08 14:24:09 +0000
committerKeith Burdis <keith@burdis.org>2013-02-08 14:24:09 +0000
commit8d8887c4ee333b620bdfb0a4c5888efb88f48493 (patch)
tree4e099d4f6933980ffd8e4c69cfd4ba60c2e9856a /manifests/hostgroup.pp
parente2dbf51aaae246e3b8e5d07c01cacac2ed4477ee (diff)
* Switched to using OMD rather than manually compiling check_mk
* Added support for host tags and creating host groups based on these tags * Allow local check_mk configuration to be specified in /etc/check_mk/main.mk.local that is appended to /etc/check_mk/main.mk as check_mk can do a lot more than is covered by this module
Diffstat (limited to 'manifests/hostgroup.pp')
-rw-r--r--manifests/hostgroup.pp18
1 files changed, 18 insertions, 0 deletions
diff --git a/manifests/hostgroup.pp b/manifests/hostgroup.pp
new file mode 100644
index 0000000..756ef50
--- /dev/null
+++ b/manifests/hostgroup.pp
@@ -0,0 +1,18 @@
+define check_mk::hostgroup (
+ $dir,
+ $hostgroups,
+ $target,
+) {
+ $group = $title
+ $group_tags = join($hostgroups[$group], ',')
+ concat::fragment { "check_mk-hostgroup-${host}":
+ target => $target,
+ content => " ( '${group}', [ ${group_tags} ], ALL_HOSTS ),\n",
+ order => 21,
+ }
+ file { "${dir}/${group}.cfg":
+ ensure => present,
+ content => "define hostgroup {\n hostgroup_name ${group}\n}\n",
+ require => File[$dir],
+ }
+}