Module: check_mk
Branch: master
Commit: 26242c3f226d809d519317cbe7679a4e0b4a3ef1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26242c3f226d80…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Apr 16 14:42:18 2015 +0200
#2068 FIX Filesystem checks: Fix crash when legacy parameters (tuple) were used
A library function, which is used by many filesystem checks, raised an exception
when the check parameters were not specified as dictionary. For example (93, 96).
This has been fixed.
---
.werks/2068 | 11 +++++++++++
ChangeLog | 1 +
checks/df.include | 21 +++++++++++----------
3 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/.werks/2068 b/.werks/2068
new file mode 100644
index 0000000..34b95b7
--- /dev/null
+++ b/.werks/2068
@@ -0,0 +1,11 @@
+Title: Filesystem checks: Fix crash when legacy parameters (tuple) were used
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1429187803
+Class: fix
+
+A library function, which is used by many filesystem checks, raised an exception
+when the check parameters were not specified as dictionary. For example (93, 96).
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 9757f2e..b4ad364 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -331,6 +331,7 @@
* 2065 FIX: windows agent: now correctly installs service with elevated
privileges...
* 2179 FIX: apc_symmetra: Fixed regression introduced with last release when output
state is empty
* 2067 FIX: windows agent: product version is no longer set to 1.0.0...
+ * 2068 FIX: Filesystem checks: Fix crash when legacy parameters (tuple) were used...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/df.include b/checks/df.include
index 6caf03a..7fd2ad1 100644
--- a/checks/df.include
+++ b/checks/df.include
@@ -338,16 +338,17 @@ def df_check_filesystem_single(hostname, mountpoint, size_mb,
avail_mb, reserved
elif used_mb >= warn_mb:
status = max(1, status)
- show_levels = params.get("show_levels")
- if show_levels == "always" or \
- (show_levels == "onproblem" and status > 0) or \
- (show_levels == "onmagic" and (status > 0 or
levels.get("magic", 1.0) != 1.0)):
- infotext += ", " + levels["levels_text"]
-
- if reserved_mb > 0 and params["show_reserved"]:
- reserved_perc = 100.0 * float(reserved_mb) / size_mb
- infotext += ", therein reserved for root: %.1f%% (%.2f MB)" %
(reserved_perc, reserved_mb)
- perfdata.append(("reserved", reserved_mb))
+ if type(params) == dict:
+ show_levels = params.get("show_levels")
+ if show_levels == "always" or \
+ (show_levels == "onproblem" and status > 0) or \
+ (show_levels == "onmagic" and (status > 0 or
levels.get("magic", 1.0) != 1.0)):
+ infotext += ", " + levels["levels_text"]
+
+ if reserved_mb > 0 and params["show_reserved"]:
+ reserved_perc = 100.0 * float(reserved_mb) / size_mb
+ infotext += ", therein reserved for root: %.1f%% (%.2f MB)" %
(reserved_perc, reserved_mb)
+ perfdata.append(("reserved", reserved_mb))
# Trends. The trends are computed in two steps. In the first step we
# compute the delta to the last check, using a normal check_mk counter.