Module: check_mk
Branch: master
Commit: 329dd8911fab013106e20ead75103db4438128fe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=329dd8911fab01…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jul 31 08:29:02 2012 +0200
Separated Disk und IO Pool in cisco_mem
---
checks/cisco_mem | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/checks/cisco_mem b/checks/cisco_mem
index 2dba01c..ec439e9 100644
--- a/checks/cisco_mem
+++ b/checks/cisco_mem
@@ -25,16 +25,24 @@
# Boston, MA 02110-1301 USA.
# .1.3.6.1.4.1.9.9.48.1.1.1.7.1 ciscoMemoryPoolLargestFree CPU Pool
-# .1.3.6.1.4.1.9.9.48.1.1.1.7.2 ciscoMemoryPoolLargestFree I/O Pool
-# .1.3.6.1.4.1.9.9.48.1.1.1.6.1 ciscoMemoryPoolUsed CPU Pool
+# .1.3.6.1.4.1.9.9.48.1.1.1.7.2 ciscoMemoryPoolLargestFree CPU Pool
+# .1.3.6.1.4.1.9.9.48.1.1.1.6.1 ciscoMemoryPoolUsed I/0 Pool
# .1.3.6.1.4.1.9.9.48.1.1.1.6.2 ciscoMemoryPoolUsed I/0 Pool
cisco_mem_default_levels = (80.0, 90.0)
def check_cisco_mem(item, params, info):
- mem_free = saveint(info[0][0]) + saveint(info[0][1])
- mem_used = saveint(info[0][2]) + saveint(info[0][3])
+ if item == 'cpu':
+ mem_free = saveint(info[0][0])
+ mem_used = saveint(info[0][1])
+ elif item == 'io':
+ mem_free = saveint(info[0][2])
+ mem_used = saveint(info[0][3])
+
mem_total = mem_free + mem_used
+ return check_cisco_mem_sub(params, mem_used, mem_total)
+
+def check_cisco_mem_sub(params, mem_used, mem_total):
perc_used = 100 * (float(mem_used) / float(mem_total))
warn, crit = params
perfdata = [("mem_used", perc_used, warn, crit, 0, 100)]
@@ -61,8 +69,8 @@ def check_cisco_mem(item, params, info):
check_info["cisco_mem"] = {
"check_function" : check_cisco_mem,
- "inventory_function" : lambda info: [(None,
"cisco_mem_default_levels")],
- "service_description" : "Mem used",
+ "inventory_function" : lambda info: [("cpu",
"cisco_mem_default_levels"), ("io",
"cisco_mem_default_levels")],
+ "service_description" : "Mem used %s pool",
"has_perfdata" : True,
"group" : "memory",
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.9.9.48.1.1.1.6.1"),