Module: check_mk
Branch: master
Commit: 318c8416ee9f9b932fc9e7bc15897d2b11518247
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=318c8416ee9f9b…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jul 11 13:36:02 2014 +0200
FIX fc_port: several fixes for the perfometer to display the right values
The perfometer for this check did not display the out traffic, did not use the
maximum bandwith to display throuput in percent, and did not work when
averaging was switched on. These problems have been fixed in this werk.
---
.werks/631 | 10 ++++++++++
ChangeLog | 1 +
checks/fc_port | 8 ++++++--
web/plugins/perfometer/check_mk.py | 6 +++---
4 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/.werks/631 b/.werks/631
new file mode 100644
index 0000000..b352f48
--- /dev/null
+++ b/.werks/631
@@ -0,0 +1,10 @@
+Title: fc_port: several fixes for the perfometer to display the right values
+Level: 1
+Component: checks
+Version: 1.2.5i5
+Date: 1405078401
+Class: fix
+
+The perfometer for this check did not display the out traffic, did not use the
+maximum bandwith to display throuput in percent, and did not work when
+averaging was switched on. These problems have been fixed in this werk.
diff --git a/ChangeLog b/ChangeLog
index 10c6a99..82a6979 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
* 1072 FIX: printer_supply: fix colors of Perf-O-Meter on HP OfficeJet...
* 0950 FIX: check_mkevents: now able to resolve the hostname of the remote hosts...
* 0177 FIX: esx_vsphere_hostsystem.multipath: Fixed return state in case of paths in
standby...
+ * 0631 FIX: fc_port: several fixes for the perfometer to display the right values...
Multisite:
* 1013 Sort host names naturally, e.g. foobar11 comes after foobar2...
diff --git a/checks/fc_port b/checks/fc_port
index beda840..a251ee8 100644
--- a/checks/fc_port
+++ b/checks/fc_port
@@ -141,6 +141,7 @@ def check_fc_port(item, params, info):
summarystate = 0
output = []
perfdata = []
+ perfaverages = []
wirespeed = savefloat(portinfo[0][4]) * 1000.0 # speed in Bytes/sec, 0 if unknown
if wirespeed == 0:
@@ -187,7 +188,7 @@ def check_fc_port(item, params, info):
if average:
timedif, value = get_average("fc_port.%s.%s.avg" % (what,
item), this_time, value, average)
output.append("Avg(%dmin): %s/s" % (average,
get_bytes_human_readable(value)))
- perfdata.append( ("%s_avg" % what.lower(), value, warn_bytes,
crit_bytes, 0, wirespeed))
+ perfaverages.append( ("%s_avg" % what.lower(), value,
warn_bytes, crit_bytes, 0, wirespeed))
# handle levels for in/out
if crit_bytes != None and value >= crit_bytes:
@@ -197,6 +198,9 @@ def check_fc_port(item, params, info):
summarystate = max(1, summarystate)
output.append(" >= %s/s(!!)" %
(get_bytes_human_readable(warn_bytes)))
+ # put perfdata of averages after perfdata for in and out in order not to confuse
the perfometer
+ perfdata.extend(perfaverages)
+
# R X O B J E C T S & T X O B J E C T S
# Put number of objects into performance data (honor averaging)
timedif, rxobjects_rate = get_counter("fc_port.rxobjects.%s" \
@@ -313,7 +317,7 @@ check_info["fc_port"] = {
'has_perfdata' : True,
'group' : 'fc_port',
'default_levels_variable': 'fc_port_default_levels',
- 'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1588.2.1.1"),
+ 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.1.0") ==
"Fibre Channel Switch.",
'snmp_info' : ( ".1.3.6.1.3.94", [
"1.10.1.2", # connUnitPortIndex
# 0
"1.10.1.3", # connUnitPortType
# 1
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index d2e85c5..beaecce 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -459,12 +459,12 @@ perfometers["check_mk-esx_vsphere_counters.if"] =
perfometer_check_mk_if
perfometers["check_mk-hitachi_hnas_fc_if"] = perfometer_check_mk_if
def perfometer_check_mk_fc_port(row, check_command, perf_data):
- unit = "B"
+ unit = "B"
return perfometer_bandwidth(
in_traffic = savefloat(perf_data[0][1]),
- out_traffic = savefloat(perf_data[5][1]),
+ out_traffic = savefloat(perf_data[1][1]),
in_bw = savefloat(perf_data[0][6]),
- out_bw = savefloat(perf_data[5][6]),
+ out_bw = savefloat(perf_data[1][6]),
unit = unit
)
perfometers["check_mk-fc_port"] = perfometer_check_mk_fc_port