Module: check_mk
Branch: master
Commit: 720e3f6d980a153b1cd646da1e6c793c34737756
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=720e3f6d980a15…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Feb 11 11:22:17 2014 +0100
FIX cisco_sys_mem: check now has a man page and a new WATO integration
---
.werks/582 | 8 ++++++++
ChangeLog | 1 +
checkman/cisco_sys_mem | 25 +++++++++++++++++++++++++
checks/cisco_sys_mem | 19 ++++++-------------
web/plugins/wato/check_parameters.py | 15 +++++++++++++++
5 files changed, 55 insertions(+), 13 deletions(-)
diff --git a/.werks/582 b/.werks/582
new file mode 100644
index 0000000..1199ed2
--- /dev/null
+++ b/.werks/582
@@ -0,0 +1,8 @@
+Title: cisco_sys_mem: check now has a man page and a new WATO integration
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392114071
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 91c8aec..c41c048 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -171,6 +171,7 @@
* 0277 FIX: solaris agent: ntp now able to work with ntpd and xntpd...
* 0279 FIX: check_mk_agent.solaris: removed proc section from statgrab...
* 0281 FIX: statgrab_net.ctr: only inventorize interfaces with actual traffic...
+ * 0582 FIX: cisco_sys_mem: check now has a man page and a new WATO integration
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checkman/cisco_sys_mem b/checkman/cisco_sys_mem
new file mode 100644
index 0000000..ba04422
--- /dev/null
+++ b/checkman/cisco_sys_mem
@@ -0,0 +1,25 @@
+title: Cisco Nexus Supervisor Memory
+agents: snmp
+catalog: hw/network/cisco
+license: GPL
+distribution: check_mk
+description:
+
+ This check monitors the average utilization of memory on the active supervisor
+ of Cisco Nexus devices as given by the {cseSysMemoryUtilization} parameter in
+ the {CISCO-SYSTEM-EXT-MIB}. The device gives the utilization in precent,
+ so that handling of absolute values is not available.
+
+perfdata:
+ The memory utilization in percent
+
+[parameters]
+parameters (tuple): A tuple with the following values
+
+ {warn}: (int) The warning level in percent
+
+ {crit}: (int) The critical level in percent
+
+[configuration]
+cisco_sys_mem_default_levels (tuple): This variable is preset to { (80.0,90.0) }
+
diff --git a/checks/cisco_sys_mem b/checks/cisco_sys_mem
index f3791b9..dbbe71f 100644
--- a/checks/cisco_sys_mem
+++ b/checks/cisco_sys_mem
@@ -27,31 +27,24 @@
# cseSysMemoryUtilization .1.3.6.1.4.1.9.9.305.1.1.2.0
#
-cisco_mem_default_levels = (80.0, 90.0)
+cisco_sys_mem_default_levels = (80.0, 90.0)
def inventory_cisco_sys_mem(info):
if info:
- return [ (None, "cisco_mem_default_levels") ]
+ return [ (None, "cisco_sys_mem_default_levels") ]
else:
return []
def check_cisco_sys_mem(_no_item, params, info):
- # This check does not yet support averaging. We need to
- # convert it to mem.include
- if type(params) == dict:
- params = params["levels"]
-
warn, crit = params
if info[0][0]:
mem_used = float(info[0][0])
perfdata = [("mem_used", mem_used, warn, crit, 0, 100)]
infotext = "%2.1f%% of supervisor memory used" % mem_used
- if type(warn) == int or type(crit) == int:
- return (3, infotext + "no limits applied, must be given in precent",
perfdata)
if mem_used >= crit:
- return (2, infotext + " (critical at %2.1f%% MB)" % crit, perfdata)
+ return (2, infotext + " (critical at %2.1f%%)" % crit, perfdata)
elif mem_used >= warn:
- return (1, infotext + " (warning at %2.1f%% MB)" % warn, perfdata)
+ return (1, infotext + " (warning at %2.1f%%)" % warn, perfdata)
else:
return (0, infotext, perfdata)
@@ -61,7 +54,7 @@ check_info["cisco_sys_mem"] = {
"inventory_function" : inventory_cisco_sys_mem,
"service_description" : "Supervisor Mem Used",
"has_perfdata" : True,
- "group" : "memory",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.9.9.305.1.1.2.0"),
+ "group" : "cisco_supervisor_mem", # seperate
group since only percentage
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").startswith("Cisco NX-OS"),
"snmp_info" : ( ".1.3.6.1.4.1.9.9.305.1.1.2", "0"
),
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 05dd01c..a58bcb1 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1997,6 +1997,21 @@ register_check_parameters(
register_check_parameters(
subgroup_os,
+ "cisco_supervisor_mem",
+ _("Cisco Nexus Supervisor Memory Usage"),
+ Tuple(
+ title = _("The average utilization of memory on the active
supervisor"),
+ elements = [
+ Percentage(title = _("Warning at a usage of"), default_value = 80.0,
maxvalue = 100.0 ),
+ Percentage(title = _("Critical at a usage of"), default_value = 90.0,
maxvalue = 100.0 )
+ ]
+ ),
+ None,
+ None
+)
+
+register_check_parameters(
+ subgroup_os,
"memory",
_("Main memory usage (Linux / UNIX / Other Devices)"),
Transform(