From 8d8887c4ee333b620bdfb0a4c5888efb88f48493 Mon Sep 17 00:00:00 2001 From: Keith Burdis Date: Fri, 8 Feb 2013 14:24:09 +0000 Subject: * 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 --- manifests/hostgroup.pp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 manifests/hostgroup.pp (limited to 'manifests/hostgroup.pp') 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], + } +} -- cgit v1.2.3