Module: check_mk
Branch: master
Commit: daf0ccb716b68de360db486cd0fc08847f61536d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=daf0ccb716b68d…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Sep 13 11:21:25 2018 +0200
6593 FIX sylo: Fixed missing performance data 'IN' and 'OUT' rates
Change-Id: I7deba2bd3e64cd6abe30dd4bf5ed20faf4c6afe3
---
.werks/6593 | 10 ++++++++++
checks/sylo | 19 ++++---------------
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/.werks/6593 b/.werks/6593
new file mode 100644
index 0000000..cd26b43
--- /dev/null
+++ b/.werks/6593
@@ -0,0 +1,10 @@
+Title: sylo: Fixed missing performance data 'IN' and 'OUT' rates
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1536830433
+Class: fix
+
+
diff --git a/checks/sylo b/checks/sylo
index 325a5e3..ed43e3c 100644
--- a/checks/sylo
+++ b/checks/sylo
@@ -86,30 +86,19 @@ def check_sylo(item, params, info):
used_mb = bytesUsed / (1024 * 1024.0)
# Rates for input and output
- rate_output = ''
- rate_perfdata = [ ('in', 0.0), ('out', 0.0) ]
-
in_rate = get_rate("sylo.in", mtime, inOffset)
out_rate = get_rate("sylo.out", mtime, outOffset)
- rate_output = ', (in %.1f B/s, out %.1f B/s)' % (in_rate, out_rate)
- rate_pefdata = [ ('in', '%f' % in_rate ),
- ('out', '%f' % out_rate ) ]
-
- msg += "Silo is filled %.1fMB (%.1f%%)%s" % \
- (bytesUsed / (1024*1024.0), percUsed, rate_output)
+ msg += "Silo is filled %.1fMB (%.1f%%), in %.1f B/s, out %.1f B/s" % \
+ (bytesUsed / (1024*1024.0), percUsed, in_rate, out_rate)
- # CRIT/WARN: Filled up
status = 0
if percUsed >= crit and status < 2:
status = 2
elif percUsed >= warn and status < 1:
status = 1
- perfdata = rate_perfdata + [
- ('used', '%f' % used_mb, warn_mb, crit_mb, 0, size_mb)
- ]
-
- return (status, msg, perfdata)
+ return status, msg, [('in', '%f' % in_rate), ('out',
'%f' % out_rate),
+ ('used', '%f' % used_mb, warn_mb, crit_mb,
0, size_mb)]
return (3, "Invalid hint file contents: " % info)