Module: check_mk
Branch: master
Commit: 5e41130dc7d6371f603551d5f064fe94dc32b030
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5e41130dc7d637…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 28 12:25:37 2013 +0200
FIX: hr_mem: handle virtual memory correct on some devices
---
ChangeLog | 1 +
checks/hr_mem | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4b3701e..d4382f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,7 @@
* cisco_wlc_clients: New check for the nummber of clients in a wlc wifi
* df: Negative integer levels for MB left on a device
* win_printers: Monitoring of printer queue on a windows printserver
+ * FIX: hr_mem: handle virtual memory correct on some devices
Notifications:
* notify.py: Matching service level: Use the hosts service level if a
diff --git a/checks/hr_mem b/checks/hr_mem
index ddfb601..7c37e4c 100644
--- a/checks/hr_mem
+++ b/checks/hr_mem
@@ -37,7 +37,7 @@ def inventory_hr_mem(info):
if saveint(hrsize) > 0: # some device have zero (broken) values
return [(None, "memused_default_levels")]
-def check_hr_mem(item, params, info):
+def check_hr_mem(_no_item, params, info):
usage = {}
for hrtype, hrdescr, hrunits, hrsize, hrused in info:
if hrtype in [ ".1.3.6.1.2.1.25.2.1.2",
@@ -47,7 +47,7 @@ def check_hr_mem(item, params, info):
# We use only the first entry of each type. We have
# seen devices (pfSense), that have lots of additional
# entries that are not useful.
- if hrtype not in usage:
+ if hrtype not in usage and hrdescr != "Virtual memory":
usage[hrtype] = (size, used)
# Account for cached memory (this works at least for systems using