Better handling for non existant ramdisks
Message-ID: <5296ed9e.LswVwPStO3p8F6Fa%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: ec3a9b11fd5940f293a32bb1c2b21a6ea7b2b9a3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec3a9b11fd5940…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 28 08:01:37 2013 +0100
FIX esx_vsphrere_counters.ramdisk: Better handling for non existant ramdisks
We sadly do not get the total ramdisk sizes from the ESX host, so we need to assume
that equal named ramdisks on the ESX hosts are all of the same size. The known
disks are configured in the check.
In the past, all ramdisks changed to <tt>UNKNOWN</tt>, once at least one
ramdisk
was not known to the check. This has been changed now, to show only the not handled
ramdisk as UNKNOWN.
---
.werks/286 | 14 ++++++++++++++
ChangeLog | 1 +
checks/esx_vsphere_counters | 8 +++++++-
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/.werks/286 b/.werks/286
new file mode 100644
index 0000000..975b0c9
--- /dev/null
+++ b/.werks/286
@@ -0,0 +1,14 @@
+Title: esx_vsphrere_counters.ramdisk: Better handling for non existant ramdisks
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1385621928
+Class: fix
+
+We sadly do not get the total ramdisk sizes from the ESX host, so we need to assume
+that equal named ramdisks on the ESX hosts are all of the same size. The known
+disks are configured in the check.
+
+In the past, all ramdisks changed to <tt>UNKNOWN</tt>, once at least one
ramdisk
+was not known to the check. This has been changed now, to show only the not handled
+ramdisk as UNKNOWN.
diff --git a/ChangeLog b/ChangeLog
index a8cf663..0930012 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
* 0037 FIX: checkman browser (cmk -m) was not working properly in network subtree...
* 0283 FIX: Interface Checks: ignore invalid error counts while interface is down...
* 0081 FIX: Fixed corruption in SNMP walks created with cmk --snmpwalk...
+ * 0286 FIX: esx_vsphrere_counters.ramdisk: Better handling for non existant
ramdisks...
Multisite:
* 0001 New filters for selecting several host/service-groups at once...
diff --git a/checks/esx_vsphere_counters b/checks/esx_vsphere_counters
index fd04735..eaabcbd 100644
--- a/checks/esx_vsphere_counters
+++ b/checks/esx_vsphere_counters
@@ -282,6 +282,8 @@ check_info['esx_vsphere_counters.uptime'] = {
# +----------------------------------------------------------------------+
# We assume that all ramdisks have the same size (in mb) on all hosts
+# -> To get size infos about unknown ramdisks, connect to the ESX host via
+# SSH and check the size of the disk via "du" command
esx_vsphere_counters_ramdisk_sizes = {
'root': 32,
'etc': 28,
@@ -289,6 +291,7 @@ esx_vsphere_counters_ramdisk_sizes = {
'hostdstats': 319,
'snmptraps': 1,
'upgradescratch': 300,
+ #'ibmscratch': ,
}
def inventory_esx_vsphere_counters_ramdisk(info):
@@ -309,7 +312,10 @@ def check_esx_vsphere_counters_ramdisk(item, params, info):
try:
size_mb = esx_vsphere_counters_ramdisk_sizes[name]
except KeyError:
- return 3, 'Unhandled ramdisk found (%s)' % name
+ if item == name:
+ return 3, 'Unhandled ramdisk found (%s)' % name
+ else:
+ continue
used_mb = float(counter) / 1000
avail_mb = size_mb - used_mb
ramdisks.append((name, size_mb, avail_mb))