Module: check_mk
Branch: master
Commit: 4f421dddbfea7f343aad09a2c4b72002e28e6b58
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4f421dddbfea7f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 6 11:55:13 2013 +0200
vsphere ramdisk monitoring: Added new ramdisk "snmptraps"
---
checks/esx_vsphere_counters | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/checks/esx_vsphere_counters b/checks/esx_vsphere_counters
index 6ef4406..a7b9dcd 100644
--- a/checks/esx_vsphere_counters
+++ b/checks/esx_vsphere_counters
@@ -287,6 +287,7 @@ esx_vsphere_counters_ramdisk_sizes = {
'etc': 28,
'tmp': 192,
'hostdstats': 319,
+ 'snmptraps': 1,
}
def inventory_esx_vsphere_counters_ramdisk(info):
@@ -304,7 +305,10 @@ def check_esx_vsphere_counters_ramdisk(item, params, info):
if name == 'sys.resourceMemConsumed' \
and instance.startswith('host/system/kernel/kmanaged/visorfs/'):
name = instance.split('/')[-1]
- size_mb = esx_vsphere_counters_ramdisk_sizes[name]
+ try:
+ size_mb = esx_vsphere_counters_ramdisk_sizes[name]
+ except KeyError:
+ return 3, 'Unhandled ramdisk found (%s)' % name
used_mb = float(counter) / 1000
avail_mb = size_mb - used_mb
ramdisks.append((name, size_mb, avail_mb))