Module: check_mk
Branch: master
Commit: 71752068d64eea96981232d1abbcaaaf201369e2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=71752068d64eea…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Aug 18 17:10:01 2015 +0200
#2517 mem.linux: Now able to handle hardware corrupted error via WATO rule
This version allows you to downgrade the hardware corrupted error state.
---
.werks/2517 | 9 +++++++++
ChangeLog | 1 +
checks/mem | 6 +++++-
web/plugins/wato/check_parameters.py | 10 ++++++++++
4 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/.werks/2517 b/.werks/2517
new file mode 100644
index 0000000..6b86899
--- /dev/null
+++ b/.werks/2517
@@ -0,0 +1,9 @@
+Title: mem.linux: Now able to handle hardware corrupted error via WATO rule
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1439910466
+Class: feature
+
+This version allows you to downgrade the hardware corrupted error state.
diff --git a/ChangeLog b/ChangeLog
index 02ac85d..943a5ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -50,6 +50,7 @@
* 2528 emc_isilon_cpu, emc_isilon_ifs: New checks for cpu utilization and the
combined cluster storage on EMC Isilon data storage devices
* 2529 kernel.util can now be configured to warn if a single cpu core exceeds a
utilization threshold for a while
* 2419 windows agent: is now downward compatible to win2k
+ * 2517 mem.linux: Now able to handle hardware corrupted error via WATO rule...
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checks/mem b/checks/mem
index 0f58e11..5a66733 100644
--- a/checks/mem
+++ b/checks/mem
@@ -335,7 +335,11 @@ def check_mem_linux(_no_item, params, info):
# HardwareCorrupted
hwc = meminfo.get("HardwareCorrupted")
if hwc:
- yield 2, "Hardware defect of %s" % get_bytes_human_readable(hwc)
+ if "handle_hw_corrupted_error" in params:
+ if params["handle_hw_corrupted_error"] != 3:
+ yield params["handle_hw_corrupted_error"], "Hardware
defect of %s" % get_bytes_human_readable(hwc)
+ else:
+ yield 2, "Hardware defect of %s" % get_bytes_human_readable(hwc)
# Now send performance data. We simply output *all* fields of meminfo
# except for a few really useless values
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index bd9f86a..2931c69 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3596,6 +3596,16 @@ register_check_parameters(
( "levels_committed", UpperMemoryLevels(_("Committed
memory"), (100.0, 150.0), _("RAM + Swap"))),
( "levels_commitlimit", LowerMemoryLevels(_("Commit
Limit"), ( 20.0, 10.0), _("RAM + Swap"))),
( "levels_vmalloc", LowerMemoryLevels(_("Largest Free
VMalloc Chunk"))),
+ ( "handle_hw_corrupted_error", DropdownChoice(
+ title = _("Handle Hardware Corrupted Error"),
+ choices = [
+ (0, _("Set state to OK")),
+ (1, _("Set state to WARN")),
+ (2, _("Set state to CRIT (Default)")),
+ (3, _("Ignore this error")),
+ ],
+ default_value = 2,
+ )),
],
),
None,