Module: check_mk
Branch: master
Commit: 8dd7419919a3e1610354fbdb633c7c9f903dc4fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8dd7419919a3e1…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Dec 6 09:21:32 2017 +0100
ddn_s2a_statsdelay: Treat read/write wait as 0 if no reads or writes occur within the
check period
Change-Id: Icfc44566e678242bab43a46047a6e020ce7f654f
---
checks/ddn_s2a_statsdelay | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/checks/ddn_s2a_statsdelay b/checks/ddn_s2a_statsdelay
index 32c26ad..c0e220e 100644
--- a/checks/ddn_s2a_statsdelay
+++ b/checks/ddn_s2a_statsdelay
@@ -140,19 +140,23 @@ def check_ddn_s2a_statsdelay(item, params, parsed):
read_min = histogram_min(time_intervals, reads_since_last_check)
read_max = histogram_max(time_intervals, reads_since_last_check)
read_avg = histogram_avg(time_intervals, reads_since_last_check)
+ else:
+ read_min, read_max, read_avg = 0, 0, 0
- yield check_levels("Average read wait: %.2f s", read_avg,
params.get("read_avg"), "disk_average_read_wait")
- yield check_levels("Min. read wait: %.2f s", read_min,
params.get("read_min"), "disk_min_read_wait")
- yield check_levels("Max. read wait: %.2f s", read_max,
params.get("read_max"), "disk_max_read_wait")
+ yield check_levels("Average read wait: %.2f s", read_avg,
params.get("read_avg"), "disk_average_read_wait")
+ yield check_levels("Min. read wait: %.2f s", read_min,
params.get("read_min"), "disk_min_read_wait")
+ yield check_levels("Max. read wait: %.2f s", read_max,
params.get("read_max"), "disk_max_read_wait")
if not is_zero(writes_since_last_check):
write_min = histogram_min(time_intervals, writes_since_last_check)
write_max = histogram_max(time_intervals, writes_since_last_check)
write_avg = histogram_avg(time_intervals, writes_since_last_check)
+ else:
+ read_min, read_max, read_avg = 0, 0, 0
- yield check_levels("Average write wait: %.2f s", write_avg,
params.get("write_avg"), "disk_average_write_wait")
- yield check_levels("Min. write wait: %.2f s", write_min,
params.get("write_min"), "disk_min_write_wait")
- yield check_levels("Max. write wait: %.2f s", write_max,
params.get("write_max"), "disk_max_write_wait")
+ yield check_levels("Average write wait: %.2f s", write_avg,
params.get("write_avg"), "disk_average_write_wait")
+ yield check_levels("Min. write wait: %.2f s", write_min,
params.get("write_min"), "disk_min_write_wait")
+ yield check_levels("Max. write wait: %.2f s", write_max,
params.get("write_max"), "disk_max_write_wait")
check_info['ddn_s2a_statsdelay'] = {