Module: check_mk
Branch: master
Commit: 3c990b2b65ca08fc7a11ea89ee2bbf386313e950
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3c990b2b65ca08…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 26 17:27:12 2015 +0200
#2424 esx_vsphere_counters: improved handling when data is missing
A few times per day, the ESX system reports invalid counter values.
This is an ESX issue and can't be fixed. The esx_vsphere_counter checks were unable
to work with this invalid/missing data. This has been fixed.
---
.werks/2424 | 12 ++++++++++++
ChangeLog | 3 ++-
checks/esx_vsphere_counters | 16 +++++++---------
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/.werks/2424 b/.werks/2424
new file mode 100644
index 0000000..eda935a
--- /dev/null
+++ b/.werks/2424
@@ -0,0 +1,12 @@
+Title: esx_vsphere_counters: improved handling when data is missing
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1440602655
+Class: feature
+
+A few times per day, the ESX system reports invalid counter values.
+This is an ESX issue and can't be fixed. The esx_vsphere_counter checks were unable
+to work with this invalid/missing data. This has been fixed.
+
diff --git a/ChangeLog b/ChangeLog
index 9887eba..b55dbc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@
* 2422 winperf_mem: new check to monitor memory pages per second...
* 2423 interface checks: now able to configure absolute levels for error packets...
* 1286 blade_bx_powerfan: Discovery ignores not present fans now
+ * 2424 esx_vsphere_counters: improved handling when data is missing...
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
@@ -139,8 +140,8 @@
* 1282 FIX: win_printers: Not longer discover offline printers
* 1284 FIX: symantec_av_progstate: Now Supports the current version of Symantec AV
* 1285 FIX: blade_bx_powerfan: Fixed exception in case of fan failure
- * 1287 FIX: akcp_temperature: Fixed interpretation of device levels...
* 2522 FIX: check_mk_agent.aix: now handles different output formats of the uptime
function
+ * 1287 FIX: akcp_temperature: Fixed interpretation of device levels...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/esx_vsphere_counters b/checks/esx_vsphere_counters
index 28631ce..dcc3f85 100644
--- a/checks/esx_vsphere_counters
+++ b/checks/esx_vsphere_counters
@@ -51,6 +51,7 @@
# sys.uptime||630664|second
+
# .--Disk IO-------------------------------------------------------------.
# | ____ _ _ ___ ___ |
# | | _ \(_)___| | __ |_ _/ _ \ |
@@ -74,7 +75,7 @@ def inventory_esx_vsphere_counters_diskio(parsed):
return [("SUMMARY", {})]
def check_esx_vsphere_counters_diskio(item, params, parsed):
- if not parsed:
+ if "disk.read" not in parsed:
raise MKCounterWrapped("Counter data is missing")
values = {}
@@ -147,7 +148,7 @@ def inventory_esx_vsphere_counters_datastoreio(parsed):
esx_vsphere_counters_get_item_mapping(parsed).values()))
def check_esx_vsphere_counters_datastoreio(item, params, parsed):
- if not parsed:
+ if "datastore.read" not in parsed:
raise MKCounterWrapped("Counter data is missing")
datastores = {}
@@ -314,7 +315,7 @@ def inventory_esx_vsphere_counters_if(parsed):
return inventory_if_common(converted)
def check_esx_vsphere_counters_if(item, params, parsed):
- if not parsed:
+ if "net.bytesRx" not in parsed:
raise MKCounterWrapped("Counter data is missing")
converted = convert_esx_counters_if(parsed)
@@ -345,13 +346,10 @@ def inventory_esx_vsphere_counters_uptime(parsed):
return [ (None, {}) ]
def check_esx_vsphere_counters_uptime(_no_item, params, parsed):
- if not parsed:
+ if "sys.uptime" not in parsed:
raise MKCounterWrapped("Counter data is missing")
- if "sys.uptime" in parsed:
- return check_uptime_seconds(params,
int(parsed["sys.uptime"][""][0][0]))
- else:
- return 3, "No uptime information found in agent output"
+ return check_uptime_seconds(params,
int(parsed["sys.uptime"][""][0][0]))
check_info['esx_vsphere_counters.uptime'] = {
@@ -397,7 +395,7 @@ def inventory_esx_vsphere_counters_ramdisk(parsed):
return df_inventory(ramdisks)
def check_esx_vsphere_counters_ramdisk(item, params, parsed):
- if not parsed:
+ if "sys.resourceMemConsumed" not in parsed:
raise MKCounterWrapped("Counter data is missing")
ramdisks = []