Module: check_mk
Branch: master
Commit: e7652b819f346d17e057b936d3b01e1c11e50d33
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e7652b819f346d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Feb 21 10:55:48 2013 +0100
New configuration variable contactgroup_members
---
ChangeLog | 1 +
modules/check_mk.py | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1d0445c..3a69fca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
1.2.2b4:
Core:
* FIX: Fix output of cmk -D: datasource programs were missing
+ * New configuration variable contactgroup_members
Checks & Agents:
* FIX: smart - not trying to parse unhandled lines to prevent errors
diff --git a/modules/check_mk.py b/modules/check_mk.py
index fa427bd..395a858 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -289,6 +289,7 @@ parents = []
define_hostgroups = None
define_servicegroups = None
define_contactgroups = None
+contactgroup_members = {}
contacts = {}
timeperiods = {} # needed for WATO
clusters = {}
@@ -2044,8 +2045,11 @@ def create_nagios_config_contactgroups(outfile):
alias = name
outfile.write("\ndefine contactgroup {\n"
" contactgroup_name\t\t%s\n"
- " alias\t\t\t\t%s\n"
- "}\n" % (name, make_utf8(alias)))
+ " alias\t\t\t\t%s\n" % (name, make_utf8(alias)))
+ members = contactgroup_members.get(name)
+ if members:
+ outfile.write(" members\t\t\t%s\n" %
",".join(members))
+ outfile.write("}\n")
def create_nagios_config_commands(outfile):