Module: check_mk
Branch: master
Commit: 9b51d2ce2964209e44a7c6d8421a3017ddf31271
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b51d2ce296420…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 29 12:36:53 2015 +0100
#2716 FIX Fixed error reporting on disabled checks page in case of broken man pages
---
.werks/2716 | 10 ++++++++++
ChangeLog | 1 +
modules/automation.py | 25 +++++++++++++++----------
3 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/.werks/2716 b/.werks/2716
new file mode 100644
index 0000000..90850b0
--- /dev/null
+++ b/.werks/2716
@@ -0,0 +1,10 @@
+Title: Fixed error reporting on disabled checks page in case of broken man pages
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446118582
+
+
diff --git a/ChangeLog b/ChangeLog
index 12497f6..fa5cf59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@
WATO:
* 2666 FIX: Fix search for global configuration variables: ignore case now
* 2715 FIX: Fixed visibility of BI aggregations in editor
+ * 2716 FIX: Fixed error reporting on disabled checks page in case of broken man
pages
HW/SW-Inventory:
* 2436 NetApp monitoring: Now able to gather data for inventory...
diff --git a/modules/automation.py b/modules/automation.py
index 778816f..d9b1223 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -507,16 +507,21 @@ def automation_get_check_information():
checks = {}
for check_type, check in check_info.items():
- manfile = manuals.get(check_type)
- if manfile:
- title = file(manfile).readline().strip().split(":", 1)[1].strip()
- else:
- title = check_type
- checks[check_type] = { "title" : title }
- if check["group"]:
- checks[check_type]["group"] = check["group"]
- checks[check_type]["service_description"] =
check.get("service_description","%s")
- checks[check_type]["snmp"] = check_uses_snmp(check_type)
+ try:
+ manfile = manuals.get(check_type)
+ if manfile:
+ title = file(manfile).readline().strip().split(":",
1)[1].strip()
+ else:
+ title = check_type
+ checks[check_type] = { "title" : title }
+ if check["group"]:
+ checks[check_type]["group"] = check["group"]
+ checks[check_type]["service_description"] =
check.get("service_description","%s")
+ checks[check_type]["snmp"] = check_uses_snmp(check_type)
+ except Exception, e:
+ if opt_debug:
+ raise
+ raise MKAutomationError("Failed to parse man page '%s': %s"
% (check_type, e))
return checks