Module: check_mk
Branch: master
Commit: ceecd53b700149907bb69cce9adc7c41e2bda3da
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ceecd53b700149…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Sep 21 13:36:34 2016 +0200
3812 FIX winperf_phydisk: reintroduced read and write queue length performance data
These values were lost due to a recent code refactoring.
---
.werks/3812 | 10 ++++++++++
ChangeLog | 1 +
checks/diskstat.include | 15 +++++++++++++++
checks/winperf_phydisk | 13 ++++++++++++-
web/plugins/metrics/check_mk.py | 20 ++++++++++++++++++++
5 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/.werks/3812 b/.werks/3812
new file mode 100644
index 0000000..67a4ad3
--- /dev/null
+++ b/.werks/3812
@@ -0,0 +1,10 @@
+Title: winperf_phydisk: reintroduced read and write queue length performance data
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1474457752
+Class: fix
+
+These values were lost due to a recent code refactoring.
+
diff --git a/ChangeLog b/ChangeLog
index 3277607..ba7a5c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -401,6 +401,7 @@
* 3807 FIX: mssql_counters: fixed crash when the check is unable to parse a timestamp
provided by the plugin
* 3808 FIX: df.include: fixed incorrect levels calculations on very small
filesystems...
* 3810 FIX: windows agent: no longer truncates plugin output, no longer freezes when
plugin produces too much output...
+ * 3812 FIX: winperf_phydisk: reintroduced read and write queue length performance
data...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/diskstat.include b/checks/diskstat.include
index 1c0cc08..52f0a6e 100644
--- a/checks/diskstat.include
+++ b/checks/diskstat.include
@@ -308,6 +308,8 @@ def diskstat_select_disk(disks, item):
# "average_write_wait" : 0.0,
# "average_write_request_size" : 0.0,
# "queue_length" : 0.0,
+ # "read_ql" : 0.0,
+ # "write_ql" : 0.0,
}
if disks:
@@ -360,6 +362,8 @@ def diskstat_select_disk(disks, item):
# 'write_ios' : 1.6153846153846154,
# 'write_throughput' : 65536.0,
# 'queue_length' : 0.0,
+# 'read_ql' : 0.0,
+# 'write_ql' : 0.0,
# }}
def check_diskstat_dict(item, params, disks):
# Take care of previously discovered services
@@ -373,6 +377,7 @@ def check_diskstat_dict(item, params, disks):
if not disk:
return
+
# Averaging
# Note: this check uses a simple method of averaging: As soon as averaging
# is turned on the actual metrics are *replaced* by the averaged ones. No
@@ -423,6 +428,16 @@ def check_diskstat_dict(item, params, disks):
unit = "ms", scale = 0.001,
statemarkers=False)
yield state, "Latency: %.2f ms%s" % (latency * 1000.0, text),
extraperf
+ # Queue lengths
+ for what, plugin_text in [ ("queue_length", "Queue Length"),
+ ("read_ql", "Read Queue
Length"),
+ ("write_ql", "Write Queue Length")
]:
+ if what in disk:
+ ql = disk[what]
+ state, levels_text, extraperf = check_levels(ql, what, params.get(what),
+ statemarkers=False)
+ yield state, "Average %s: %.2f%s" % (plugin_text, ql, levels_text),
extraperf
+
# All the other metrics are currently not output in the plugin output - simply
because
# of their amount. They are present as performance data and will shown in graphs.
diff --git a/checks/winperf_phydisk b/checks/winperf_phydisk
index 580bc8e..927e82b 100644
--- a/checks/winperf_phydisk
+++ b/checks/winperf_phydisk
@@ -60,7 +60,7 @@
# 1248 2664021277 2664021277 type(40030500)
# 1250 1330 1330 counter
-check_includes['winperf_phydisk'] = [ "diskstat.include" ]
+
def winperf_phydisk_convert(info):
# node_info has been activated. This check simply ignores this
@@ -182,6 +182,16 @@ def check_winperf_phydisk(item, params, info):
'average_write_wait' : (sec_per_write_counter / frequency) /
sec_per_write_base,
})
+
+ # Queue Lengths (currently only Windows). Windows uses counters here.
+ # I have not understood, why....
+ for what, ctr in [ ("read_ql", disk[7]),
+ ("write_ql", disk[8]) ]:
+ qlx = get_rate("%s_%s" % (what, disk_id) , this_time,
int(ctr))
+ ql = qlx / 10000000.0
+ result[disk[1]].update({what: ql})
+
+
return result
return check_diskstat_dict(item, params, dictify(winperf_phydisk_convert(info)))
@@ -194,5 +204,6 @@ check_info["winperf_phydisk"] = {
'service_description': 'Disk IO %s',
'node_info': True,
'has_perfdata': True,
+ 'includes': [ "diskstat.include" ],
'group': 'disk_io',
}
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 5269624..de564b3 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -1614,6 +1614,18 @@ metric_info["write_latency"] = {
metric_info["disk_queue_length"] = {
"title" : _("Average disk I/O-queue length"),
"unit" : "",
+ "color" : "35/a",
+}
+
+metric_info["disk_read_ql"] = {
+ "title" : _("Average disk read queue length"),
+ "unit" : "",
+ "color" : "45/a",
+}
+
+metric_info["disk_write_ql"] = {
+ "title" : _("Average disk write queue length"),
+ "unit" : "",
"color" : "#7060b0",
}
@@ -5813,6 +5825,14 @@ graph_info.append({
})
graph_info.append({
+ "title" : _("Read / Write queue length"),
+ "metrics" : [
+ ( "disk_read_ql", "area" ),
+ ( "disk_write_ql", "-area" )
+ ],
+})
+
+graph_info.append({
"title" : _("Backup time"),
"metrics" : [
( "checkpoint_age", "area" ),