Module: check_mk
Branch: master
Commit: 9d31579a97869b173617e83fea45c27ca476a76a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d31579a97869b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 8 18:21:17 2015 +0100
mem.linux: fix display bug in vmalloc check, increase committed default levels
---
checks/mem | 12 ++++++++----
web/plugins/wato/check_parameters.py | 3 ++-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/checks/mem b/checks/mem
index 318ca7e..cf888bd 100644
--- a/checks/mem
+++ b/checks/mem
@@ -124,7 +124,7 @@ factory_settings["mem_linux_default_levels"] = {
"levels_total": ("perc_used", (120.0, 150.0)),
"levels_shm": ("perc_used", ( 20.0, 30.0)),
"levels_pagetables": ("perc_used", ( 8.0, 16.0)),
- "levels_committed": ("perc_used", ( 80.0, 90.0)),
+ "levels_committed": ("perc_used", (100.0, 150.0)),
"levels_commitlimit": ("perc_free", ( 20.0, 10.0)),
"levels_vmalloc": ("abs_free", (50*1024*1024,
30*1024*1024)),
}
@@ -148,12 +148,16 @@ def inventory_mem_linux(info):
return [ (None, {}) ]
-def check_mem_levels(title, used, total, levels, of_what=None, of_value=None,
show_percentage=False):
+def check_mem_levels(title, used, total, levels, of_what=None, of_value=None,
show_percentage=False, show_free=False):
if of_value == None:
of_value = total # Reference for percentage levels
state = 0
if of_what:
- infotext = "%s: %s" % (title, get_bytes_human_readable(used))
+ if show_free:
+ value = total - used
+ else:
+ value = used
+ infotext = "%s: %s" % (title, get_bytes_human_readable(value))
else:
infotext = "%s used: %s of %s" % (
title, get_bytes_human_readable(used), get_bytes_human_readable(total))
@@ -295,7 +299,7 @@ def check_mem_linux(_no_item, params, info):
# VMalloc
r = check_mem_levels("Largest Free VMalloc Chunk",
meminfo["VmallocTotal"] - meminfo["VmallocChunk"],
- meminfo["VmallocTotal"], params.get("levels_vmalloc"),
of_what = "VMalloc Area")
+ meminfo["VmallocTotal"], params.get("levels_vmalloc"),
of_what = "VMalloc Area", show_free=True)
if r[0]:
yield r # only display if non-OK
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 711e5da..3a394a9 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -116,6 +116,7 @@ register_rule(group + '/' + subgroup_inventory,
'by prefixing the regular expression with
<tt>(?i)</tt>. Example: '
'<tt>(?i).*mssql</tt> matches all services
which contain <tt>MSSQL</tt> '
'or <tt>MsSQL</tt> or
<tt>mssql</tt> or...'),
+
orientation = "horizontal",
)),
('state', DropdownChoice(
@@ -2769,7 +2770,7 @@ register_check_parameters(
( "levels_shm", UpperMemoryLevels(_("Shared
Memory"), ( 20.0, 30.0), _("RAM"))),
( "levels_pagetables", UpperMemoryLevels(_("Page
tables"), ( 8.0, 16.0), _("RAM"))),
( "levels_writeback", UpperMemoryLevels(_("Disk
Writeback"))),
- ( "levels_committed", UpperMemoryLevels(_("Committed
memory"), ( 80.0, 90.0), _("RAM + Swap"))),
+ ( "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"))),
],