summaryrefslogtreecommitdiff
path: root/puppet/modules/site_check_mk/templates/host_contactgroups.mk
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/site_check_mk/templates/host_contactgroups.mk')
-rw-r--r--puppet/modules/site_check_mk/templates/host_contactgroups.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/puppet/modules/site_check_mk/templates/host_contactgroups.mk b/puppet/modules/site_check_mk/templates/host_contactgroups.mk
new file mode 100644
index 00000000..6a534967
--- /dev/null
+++ b/puppet/modules/site_check_mk/templates/host_contactgroups.mk
@@ -0,0 +1,17 @@
+<%
+ contact_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
+ contact_groups << ' ( "%s", [%s] )' % [env_name, hosts]
+ end
+%>
+host_contactgroups = [
+<%= contact_groups.join(",\n") %>
+]