Check now uses the default diskstat implementation
Message-ID: <559fb19d.gUUVfWdEQpb+QN8T%bk(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: f8d965e8823e63e8bba321b81b2f73ac2398ea0f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f8d965e8823e63…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jul 10 13:50:44 2015 +0200
#1269 esx_vsphere_counters.diskio: Check now uses the default diskstat implementation
The Check has now more metricts and also levels can be configured now. Sadly a rediscovery
is needed because the internal name has changed
and also the graphs has new names what means that the graphs will start over.
---
.werks/1269 | 11 +++++++++++
ChangeLog | 2 ++
checks/esx_vsphere_counters | 45 +++++++++++++++++++++----------------------
3 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/.werks/1269 b/.werks/1269
new file mode 100644
index 0000000..9049cc7
--- /dev/null
+++ b/.werks/1269
@@ -0,0 +1,11 @@
+Title: esx_vsphere_counters.diskio: Check now uses the default diskstat implementation
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i3
+Date: 1436528825
+Class: feature
+
+The Check has now more metricts and also levels can be configured now. Sadly a
rediscovery is needed because the internal name has changed
+and also the graphs has new names what means that the graphs will start over.
+
diff --git a/ChangeLog b/ChangeLog
index c4bc800..2710c05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
* 2285 Modified checks for printer pages: canon_pages, printer_pages,
printer_pages_ricoh, printer_pages.include...
NOTE: Please refer to the migration notes!
* 2129 db_ checks: new mk_db2.linux agent supporting the existing db2_ checks
+ * 1269 esx_vsphere_counters.diskio: Check now uses the default diskstat
implementation...
+ NOTE: Please refer to the migration notes!
* 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...
diff --git a/checks/esx_vsphere_counters b/checks/esx_vsphere_counters
index 54727da..37ef200 100644
--- a/checks/esx_vsphere_counters
+++ b/checks/esx_vsphere_counters
@@ -72,40 +72,39 @@
def inventory_esx_vsphere_counters_diskio(info):
for counter, item, value, unit in info:
if counter == 'disk.read' and item == '':
- return [(None, None)]
+ return [("SUMMARY", {})]
-def check_esx_vsphere_counters_diskio(_no_item, _no_params, info):
+def check_esx_vsphere_counters_diskio(item, params, info):
if not info:
raise MKCounterWrapped("Counter data is missing")
-
- read_bytes = 0
- write_bytes = 0
- reads = 0
- writes = 0
- latency = 0
- for counter, item, value, unit in info:
- if item == '':
+ values = {}
+ values['read_throughput'] = 0
+ values['write_throughput'] = 0
+ values['read_ios'] = 0
+ values['write_ios'] = 0
+ values['latency'] = 0
+ for counter, esx_item, value, unit in info:
+ if esx_item == '':
if counter == 'disk.read':
- read_bytes = int(value) * 1024
+ values['read_throughput'] = int(value) * 1024
elif counter == 'disk.write':
- write_bytes = int(value) * 1024
+ values['write_throughput'] = int(value) * 1024
elif counter == 'disk.numberRead':
- reads += int(value)
+ values['read_ios'] += int(value)
elif counter == 'disk.numberWrite':
- writes += int(value)
+ values['write_ios'] += int(value)
elif counter == 'disk.deviceLatency':
- latency = max(latency, int(value))
-
- return 0, "%s/sec read, %s/sec write, IOs: %.2f/sec, latency: %d ms" % (
- get_bytes_human_readable(read_bytes), get_bytes_human_readable(write_bytes),
reads + writes, latency), \
- [ ("read", read_bytes), ("write", write_bytes),
("ios", reads + writes), ("latency" , latency) ]
+ values['latency'] = max(values['latency'], int(value))
+ return check_diskstat_dict(item, params, {"SUMMARY" : values})
check_info['esx_vsphere_counters.diskio'] = {
- 'inventory_function' : inventory_esx_vsphere_counters_diskio,
- 'check_function' : check_esx_vsphere_counters_diskio,
- 'service_description': 'Disk IO SUMMARY',
- 'has_perfdata': True,
+ 'inventory_function' : inventory_esx_vsphere_counters_diskio,
+ 'check_function' : check_esx_vsphere_counters_diskio,
+ 'service_description' : 'Disk IO',
+ 'has_perfdata' : True,
+ 'group' : 'diskstat',
+ 'includes' : [ "diskstat.include" ],
}