Module: check_mk
Branch: master
Commit: 6579c24c81a63a7e15d9b57611fee35b3e9ae690
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6579c24c81a63a…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Oct 14 13:09:20 2014 +0200
statgrab_mem: Added Wato configuration
---
checks/statgrab_mem | 11 ++++++-----
web/plugins/wato/check_parameters.py | 26 ++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/checks/statgrab_mem b/checks/statgrab_mem
index f3465e8..2d1a3ed 100644
--- a/checks/statgrab_mem
+++ b/checks/statgrab_mem
@@ -30,7 +30,7 @@ def inventory_statgrab_mem(info):
if len(info) > 0:
return [(None, 'memused_default_levels')]
-def check_statgrab_mem(item, params, info):
+def check_statgrab_mem(_no_item, params, info):
for var, value in info:
if var == 'mem.used': memused_kb = int(value) / 1024
elif var == 'mem.total': totalmem_kb = int(value) / 1024
@@ -79,8 +79,9 @@ def check_statgrab_mem(item, params, info):
check_info["statgrab_mem"] = {
- 'check_function': check_statgrab_mem,
- 'inventory_function': inventory_statgrab_mem,
- 'service_description': 'Memory used',
- 'has_perfdata': True,
+ 'check_function' : check_statgrab_mem,
+ 'inventory_function' : inventory_statgrab_mem,
+ 'service_description' : 'Memory used',
+ 'has_perfdata' : True,
+ 'group' : "statgrab_mem",
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index a8f7f27..88a4371 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2393,6 +2393,32 @@ register_check_parameters(
register_check_parameters(
subgroup_os,
+ "statgrab_mem",
+ _("Statgrab Memory Usage"),
+ Alternative(
+ elements = [
+ Tuple(
+ title = _("Specify levels in percentage of total RAM"),
+ elements = [
+ Percentage(title = _("Warning at a usage of"), unit =
_("% of RAM"), maxvalue = None),
+ Percentage(title = _("Critical at a usage of"), unit =
_("% of RAM"), maxvalue = None)
+ ]
+ ),
+ Tuple(
+ title = _("Specify levels in absolute usage values"),
+ elements = [
+ Integer(title = _("Warning if above"), unit =
_("MB")),
+ Integer(title = _("Critical if above"), unit =
_("MB"))
+ ]
+ ),
+ ]
+ ),
+ None,
+ "first"
+)
+
+register_check_parameters(
+ subgroup_os,
"cisco_mem",
_("Cisco Memory Usage"),
Alternative(