Module: check_mk
Branch: master
Commit: 7d37cb9f00685761ded512f6d240c27193b7ed45
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d37cb9f006857…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 16 15:35:21 2016 +0100
#3221 FIX Fixed broken nagios config because of missing contact group check-mk-notify with
rule based notifications enabled
Fixes the error "Could not find any contactgroup matching
'check-mk-notify'" when starting the nagios core.
---
.werks/3221 | 10 ++++++++++
ChangeLog | 1 +
modules/nagios.py | 7 ++++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/3221 b/.werks/3221
new file mode 100644
index 0000000..eacd56d
--- /dev/null
+++ b/.werks/3221
@@ -0,0 +1,10 @@
+Title: Fixed broken nagios config because of missing contact group check-mk-notify with
rule based notifications enabled
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1455633251
+
+Fixes the error "Could not find any contactgroup matching
'check-mk-notify'" when starting the nagios core.
diff --git a/ChangeLog b/ChangeLog
index 73716ed..c8218d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* 3193 FIX: Fixed fake check results for hosts...
* 3214 FIX: Removing SNMP checks for non SNMP hosts and agent based checks for non
agent hosts...
* 3220 FIX: Check_MK HW/SW Inventory is now always disabled for "No Agent"
hosts
+ * 3221 FIX: Fixed broken nagios config because of missing contact group
check-mk-notify with rule based notifications enabled...
Checks & Agents:
* 3183 aruba_wlc_aps: new check which monitors the provisioned accesspoints of an
Aruba Network WLAN Controller
diff --git a/modules/nagios.py b/modules/nagios.py
index a76cb5c..0769a2a 100644
--- a/modules/nagios.py
+++ b/modules/nagios.py
@@ -734,9 +734,9 @@ define servicegroup {
""" % (make_utf8(sg), make_utf8(alias)))
def create_nagios_config_contactgroups(outfile):
- if define_contactgroups:
- cgs = list(contactgroups_to_define)
- cgs.sort()
+ cgs = list(contactgroups_to_define)
+ cgs.sort()
+ if cgs:
outfile.write("\n#
------------------------------------------------------------\n")
outfile.write("# Contact groups (controlled by
define_contactgroups)\n")
outfile.write("#
------------------------------------------------------------\n\n")
@@ -870,6 +870,7 @@ def create_nagios_config_contacts(outfile, hostnames):
outfile.write("}\n\n")
if enable_rulebased_notifications and hostnames:
+ contactgroups_to_define.add("check-mk-notify")
outfile.write(
"# Needed for rule based notifications\n"
"define contact {\n"