Module: check_mk
Branch: master
Commit: 5c97b94b3ee367536c23faf325409403e42984b1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5c97b94b3ee367…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Feb 8 14:37:04 2017 +0100
4024 FIX netapp_api_volumes: fixed incorrect computation of read/write latency
Change-Id: Ic8badad9f5675ba161b05d306f34eaad4cdce917
---
.werks/4024 | 9 +++++++++
ChangeLog | 1 +
agents/special/agent_netapp | 4 ++--
checks/netapp_api_volumes | 17 ++++++++++++++---
4 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/.werks/4024 b/.werks/4024
new file mode 100644
index 0000000..fbaa9f5
--- /dev/null
+++ b/.werks/4024
@@ -0,0 +1,9 @@
+Title: netapp_api_volumes: fixed incorrect computation of read/write latency
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1486560986
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index a9052a9..84aabe1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -99,6 +99,7 @@
* 4191 FIX: esx_vsphere_hostsystem.cpu_usage: Fixed wrong total GHz...
* 4340 FIX: blade_bays: cleanup and some improvements...
* 4341 FIX: cisco_wlc: fixed invalid parameters during service discovery
+ * 4024 FIX: netapp_api_volumes: fixed incorrect computation of read/write latency
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 9c27c4b..6948d37 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -1043,7 +1043,7 @@ try:
"volume-inode-attributes.files-used" : "files-used" },
extra_info = create_dict(volume_counters,
custom_key = [ "instance_uuid" ]),
extra_info_report = sum(map(lambda x:
["%s" % x, "nfs_%s" % x, "cifs_%s" % x, "san_%s" %
x, "fcp_%s" % x, "iscsi_%s" % x],
- sum(map(lambda x:
["read_%s" % x, "write_%s" % x], ["data",
"latency"]), [])), []) + [ "instance_name" ],
+ sum(map(lambda x:
["read_%s" % x, "write_%s" % x], ["data",
"latency", "ops"]), [])), []) + [ "instance_name" ],
skip_missing_config_key = True
)
@@ -1209,7 +1209,7 @@ try:
"volumes",
"files-total", "files-used", "state"],
extra_info = create_dict(volume_counters),
extra_info_report = sum(map(lambda x: ["%s" %
x, "nfs_%s" % x, "cifs_%s" % x, "san_%s" % x,
"fcp_%s" % x, "iscsi_%s" % x],
- sum(map(lambda x:
["read_%s" % x, "write_%s" % x], ["data",
"latency"]), [])), []) + [ "instance_name" ])
+ sum(map(lambda x:
["read_%s" % x, "write_%s" % x], ["data",
"latency", "ops"]), [])), []) + [ "instance_name" ])
# Aggregation
diff --git a/checks/netapp_api_volumes b/checks/netapp_api_volumes
index c56a13d..f2f4f46 100644
--- a/checks/netapp_api_volumes
+++ b/checks/netapp_api_volumes
@@ -71,14 +71,17 @@ def check_netapp_api_volumes(item, params, parsed):
counter_wrapped = False
counters = []
- now = time.time()
+ now = time.time()
+ base = {}
perf_protocols = params.get("perfdata", [])
for protocol in ["", "nfs_", "cifs_", "san_",
"fcp_", "iscsi_"]:
if protocol[:-1] not in perf_protocols:
continue
for mode in ["read_", "write_", "other_"]:
- for field, factor, format_text in [ ("data", None, None),
("latency", 10000.0, "%s: %.2f ms")]:
+ for field, factor, format_text in [ ("data", None, None),
+ ("ops", None, "%s: %.2f
1/s"),
+ ("latency", 10000.0, "%s:
%.2f ms")]:
key = protocol + mode + field
value = volume.get(key)
if value != None:
@@ -87,9 +90,17 @@ def check_netapp_api_volumes(item, params, parsed):
delta = get_rate("netapp_api_volumes.%s.%s" % (item,
key), now, value, onwrap=RAISE)
perf.append( (key, delta) )
+ # Quite hacky.. this base information is used later on by the
"latency" field
+ if field == "ops":
+ if delta==0.0:
+ base[key] = 1.0
+ else:
+ base[key] = float(delta)
+
+
if protocol == "" and mode in ["read_",
"write_"]:
if factor:
- delta = delta / factor
+ delta = delta / (factor * base[protocol + mode +
"ops"])
if format_text:
counters.append(format_text % (key, delta))
else: