Module: check_mk
Branch: master
Commit: 1e34bb4e5fc5477aad19d2eb4e28f863008fe2aa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1e34bb4e5fc547…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jul 4 15:04:56 2014 +0200
fc_port check displays maximum bandwith of port in GBit/sec, but throughput in GByte/sec
---
checks/fc_port | 21 +++++++++++++++------
web/plugins/perfometer/check_mk.py | 12 +++++++++++-
web/plugins/wato/check_parameters.py | 2 +-
3 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/checks/fc_port b/checks/fc_port
index 11129c0..7d14c79 100644
--- a/checks/fc_port
+++ b/checks/fc_port
@@ -144,13 +144,13 @@ def check_fc_port(item, params, info):
wirespeed = savefloat(portinfo[0][4]) * 1000.0 # speed in Bytes/sec, 0 if unknown
if wirespeed == 0:
- # let user specify assumed speed via check parameter, default is 2.0 GByte/sec
- gb = params.get("assumed_speed", 2.0)
- wirespeed = gb * 1000.0 * 1000.0 * 1000.0 # in Bytes/sec
- speedmsg = "assuming %g GB/s" % gb
+ # let user specify assumed speed via check parameter, default is 16.0 GBit/sec
+ gbit = params.get("assumed_speed", 16.0)
+ wirespeed = gb * 1000.0 * 1000.0 * 1000.0 / 8.0 # in Bytes/sec
+ speedmsg = "assuming %g GBit/s" % gbit
else:
- gb = wirespeed / ( 1000.0 * 1000.0 * 1000.0 ) # in GByte/sec
- speedmsg = "%.1f GB/s" % gb
+ gbit = wirespeed * 8.0 / ( 1000.0 * 1000.0 * 1000.0 ) # in GBit/sec
+ speedmsg = "%.1f GBit/s" % gb
output.append(speedmsg)
# Now check rates of various counters
@@ -297,6 +297,15 @@ def check_fc_port(item, params, info):
return (summarystate, ', '.join(output), perfdata)
+check_config_variables.append("fc_port_admstates")
+check_config_variables.append("fc_port_opstates")
+check_config_variables.append("fc_port_phystates")
+check_config_variables.append("fc_port_no_inventory_types")
+check_config_variables.append("fc_port_no_inventory_admstates")
+check_config_variables.append("fc_port_no_inventory_opstates")
+check_config_variables.append("fc_port_no_inventory_phystates")
+check_config_variables.append("fc_port_inventory_use_portname")
+
check_info["fc_port"] = {
'check_function' : check_fc_port,
'inventory_function' : inventory_fc_port,
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index ce4958c..cf8ff84 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -457,7 +457,17 @@ perfometers["check_mk-hpux_if"] = perfometer_check_mk_if
perfometers["check_mk-mcdata_fcport"] = perfometer_check_mk_if
perfometers["check_mk-esx_vsphere_counters.if"] = perfometer_check_mk_if
perfometers["check_mk-hitachi_hnas_fc_if"] = perfometer_check_mk_if
-perfometers["check_mk-fc_port"] = perfometer_check_mk_if
+
+def perfometer_check_mk_fc_port(row, check_command, perf_data):
+ unit = "Byte/s"
+ return perfometer_bandwidth(
+ in_traffic = savefloat(perf_data[0][1]),
+ out_traffic = savefloat(perf_data[5][1]),
+ in_bw = savefloat(perf_data[0][6]),
+ out_bw = savefloat(perf_data[5][6]),
+ unit = unit
+ )
+perfometers["check_mk-fc_port"] = perfometer_check_mk_fc_port
def perfometer_check_mk_brocade_fcport(row, check_command, perf_data):
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 7651d21..a07012f 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -5253,7 +5253,7 @@ register_check_parameters(
title = _("Assumed link speed"),
help = _("If the automatic detection of the link speed does
"
"not work you can set the link speed here."),
- unit = _("GByte/s")
+ unit = _("GBit/s")
)
),
("rxcrcs",