Module: check_mk
Branch: master
Commit: 7aa4bb0d1f46450c1be08608467e7fa9c821ccc0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7aa4bb0d1f4645…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 24 10:52:53 2012 +0200
FIX: fixed outgoing bandwidth in fc port perfometer
---
ChangeLog | 1 +
web/plugins/perfometer/check_mk.py | 28 ++++++++++++++++++++--------
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dda48f1..7a0f24e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
Multisite:
* FIX: remove refresh button from dashboard.
* FIX: remove use of old option defaults.checkmk_web_uri
+ * FIX: fixed outgoing bandwidth in fc port perfometer
* New display type 'boxes-omit-root' for BI views
* Hostgroup view BI Boxes omits the root level
* Finalized layout if view options and commands/filters/painteroptions.
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index b6bda11..9ae4df9 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -211,15 +211,13 @@ perfometers["check_mk-ipmi_sensors"] =
perfometer_check_mk_ipmi_sensors
perfometers["check_mk-nvidia.temp"] = perfometer_check_mk_ipmi_sensors
perfometers["check_mk-cisco_temp_sensor"] = perfometer_check_mk_ipmi_sensors
-def perfometer_check_mk_if(row, check_command, perf_data):
+def perfometer_bandwidth(in_bytes, out_bytes, in_bw, out_bw):
txt = []
have_bw = True
h = '<table><tr>'
- for name, perf, color in [
- ("in", perf_data[0], "#0e6"),
- ("out", perf_data[5], "#2af") ]:
- bytes = savefloat(perf[1])
- bw = savefloat(perf[6])
+ for name, bytes, bw, color in [
+ ("in", in_bytes, in_bw, "#0e6"),
+ ("out", out_bytes, out_bw, "#2af") ]:
if bw > 0.0:
rrate = bytes / bw
else:
@@ -240,8 +238,6 @@ def perfometer_check_mk_if(row, check_command, perf_data):
return " ".join(txt), h
# make logarithmic perf-o-meter
- in_bytes = savefloat(perf_data[0][1])
- out_bytes = savefloat(perf_data[5][1])
MB = 1000000.0
text = "%s/s %s/s" % (
number_human_readable(in_bytes), number_human_readable(out_bytes))
@@ -249,6 +245,22 @@ def perfometer_check_mk_if(row, check_command, perf_data):
return text, perfometer_logarithmic_dual(
in_bytes, "#0e6", out_bytes, "#2af", 1000000, 5)
+def perfometer_check_mk_if(row, check_command, perf_data):
+ return perfometer_bandwidth(
+ in_bytes = savefloat(perf_data[0][1]),
+ out_bytes = savefloat(perf_data[5][1]),
+ in_bw = savefloat(perf_data[0][6]),
+ out_bw = savefloat(perf_data[5][6]),
+ )
+
+def perfometer_check_mk_brocade_fcport(row, check_command, perf_data):
+ return perfometer_bandwidth(
+ in_bytes = savefloat(perf_data[0][1]),
+ out_bytes = savefloat(perf_data[1][1]),
+ in_bw = savefloat(perf_data[0][6]),
+ out_bw = savefloat(perf_data[1][6]),
+ )
+
perfometers["check_mk-if"] = perfometer_check_mk_if
perfometers["check_mk-if64"] = perfometer_check_mk_if
perfometers["check_mk-if_lancom"] = perfometer_check_mk_if