summaryrefslogtreecommitdiff
path: root/puppet/modules/site_check_mk/templates/hostgroups.mk
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/site_check_mk/templates/hostgroups.mk')
-rw-r--r--puppet/modules/site_check_mk/templates/hostgroups.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/puppet/modules/site_check_mk/templates/hostgroups.mk b/puppet/modules/site_check_mk/templates/hostgroups.mk
new file mode 100644
index 00000000..7158dcd1
--- /dev/null
+++ b/puppet/modules/site_check_mk/templates/hostgroups.mk
@@ -0,0 +1,17 @@
+<%
+ host_groups = []
+ @environments.keys.sort.each do |env_name|
+ hosts = ""
+ @nagios_hosts.keys.sort.each do |hostname|
+ hostdata = @nagios_hosts[hostname]
+ domain_internal = hostdata['domain_internal']
+ if hostdata['environment'] == env_name
+ hosts << '"' + domain_internal + '", '
+ end
+ end
+ host_groups << ' ( "%s", [%s] )' % [env_name, hosts]
+ end
+%>
+host_groups = [
+<%= host_groups.join(",\n") %>
+]