Module: check_mk
Branch: master
Commit: efaecde8e248d2ecab6ace5809976a22e0458f70
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=efaecde8e248d2…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Aug 19 11:59:46 2015 +0200
mem.linux, WATO rule hardware corrupted error: changed ValueSpec to MonitoringState
---
checks/mem | 6 +-----
web/plugins/wato/check_parameters.py | 12 +++---------
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/checks/mem b/checks/mem
index 5a66733..aead0f1 100644
--- a/checks/mem
+++ b/checks/mem
@@ -335,11 +335,7 @@ def check_mem_linux(_no_item, params, info):
# HardwareCorrupted
hwc = meminfo.get("HardwareCorrupted")
if 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)
+ yield params.get("handle_hw_corrupted_error", 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 2931c69..dde6392 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3596,15 +3596,9 @@ 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,
+ ( "handle_hw_corrupted_error", MonitoringState(
+ title = _("Handle Hardware Corrupted Error"),
+ default_value = 2,
)),
],
),