Module: check_mk
Branch: master
Commit: d3ba0b9cd5706ab35f5356dafcf2c46b7d79da86
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d3ba0b9cd5706a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Feb 9 14:32:09 2017 +0100
4356 FIX brocade_fcport: since FW 8.0.* tx/rxwords are no longer available, use values
from FCMGMT-MIB instead
Change-Id: I5f59986b451146d4cea530e7062e5d48599f9bf8
---
.werks/4356 | 10 ++++++++++
ChangeLog | 2 ++
checks/brocade_fcport | 44 ++++++++++++++++++++++++++++++++------------
3 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/.werks/4356 b/.werks/4356
new file mode 100644
index 0000000..1769526
--- /dev/null
+++ b/.werks/4356
@@ -0,0 +1,10 @@
+Title: brocade_fcport: since FW 8.0.* tx/rxwords are no longer available, use values from
FCMGMT-MIB instead
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1486646748
+
+
diff --git a/ChangeLog b/ChangeLog
index 1cf52eb..d3dcf83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -95,6 +95,7 @@
* 4335 FIX: perle check and inventory plugins: some updates and improvements...
NOTE: Please refer to the migration notes!
* 4123 FIX: active check check_sql: changed handling of query results and fixed
hostname parameter...
+ * 4190 FIX: mssql_blocked_sessions: Fixed unknown states if only one session is
blocked...
* 4325 FIX: check_cpu_peaks: Make the check working with current Check_MK APi
* 4339 FIX: fixed AtrributeError in oracle sessions ruleset
* 4191 FIX: esx_vsphere_hostsystem.cpu_usage: Fixed wrong total GHz...
@@ -104,6 +105,7 @@
* 4342 FIX: hp_proliant: fixed empty status handling
* 4216 FIX: cmciii.phase: Fix wrong scaling of power and energy values
* 4345 FIX: hp_proliant_temp: Ignore device levels of 0
+ * 4356 FIX: brocade_fcport: since FW 8.0.* tx/rxwords are no longer available, use
values from FCMGMT-MIB instead
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index cb205b4..ee2399b 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -159,11 +159,31 @@ def inventory_brocade_fcport(info):
def check_brocade_fcport(item, params, info):
+ if_info, link_info, speed_info, if64_info = info
+
# Accept item, even if port name or ISL state has changed
- item_index = int(item.split()[0])
- portinfo = [ line for line in info[0] if int(line[0]) == item_index + 1]
+ item_index = int(item.split()[0])
+ portinfo = [ line for line in if_info if int(line[0]) == item_index + 1]
+
+ # Since FW v8.0.1b [rx/tx]words are no longer available
+ fcmgmt_portstats = []
+ if portinfo[0][4] == "" or portinfo[0][5] == "":
+ for oidend, tx_elements, rx_elements, bbcredits in if64_info:
+ if item_index + 1 == int(oidend.split(".")[-1]):
+ fcmgmt_portstats = [ binstring_to_int(tx_elements),
+ binstring_to_int(rx_elements),
+ binstring_to_int(bbcredits) ]
+ break
+ if fcmgmt_portstats:
+ portinfo[0][4] = fcmgmt_portstats[0]
+ portinfo[0][5] = fcmgmt_portstats[1]
+ else:
+ portinfo[0][4] = 0
+ portinfo[0][5] = 0
+
index, phystate, opstate, admstate, txwords, rxwords, txframes, rxframes, \
notxcredits, rxcrcs, rxencinframes, rxencoutframes, c3discards = map(int,
portinfo[0][:-2])
+
speed = saveint(portinfo[0][-2])
summarystate = 0
@@ -173,7 +193,7 @@ def check_brocade_fcport(item, params, info):
# Lookup port speed in ISL table for ISL ports (older switches do not provide this
# information in the normal table)
- isl_ports = dict(info[1])
+ isl_ports = dict(link_info)
if str(index) in isl_ports:
gbit = isl_speed.get( isl_ports.get( str(index) ) )
speedmsg = ("ISL at %.0fGbit/s" % gbit)
@@ -188,7 +208,7 @@ def check_brocade_fcport(item, params, info):
# and assume that the sequence number of the FC port here is the same
# as the sequence number in the borcade MIB (pindex = item_index)
pindex = -1
- for vals in info[2]:
+ for vals in speed_info:
port_type, actual_speed = map(saveint, vals)
if port_type == 56:
pindex += 1
@@ -355,15 +375,14 @@ def check_brocade_fcport(item, params, info):
summarystate = 2
output.append("Adm:%s(%d)%s" % (brocade_fcport_admstates.get(admstate,
"unknown"), admstate, errorflag))
- if info[3]:
- for oidend, bbcredit in info[3]:
- if index == int(oidend.split(".")[-1]):
- bbcredit_rate = get_rate("brocade_fcport.bbcredit.%s" %
(item),
- this_time, binstring_to_int(bbcredit))
- perfdata.append( ("fc_bbcredit_zero", bbcredit_rate) )
+ if fcmgmt_portstats and fcmgmt_portstats[2]:
+ bbcredit_rate = get_rate("brocade_fcport.bbcredit.%s" % (item),
+ this_time, fcmgmt_portstats[2])
+ perfdata.append( ("fc_bbcredit_zero", bbcredit_rate) )
return (summarystate, ', '.join(output), perfdata)
+
check_info["brocade_fcport"] = {
'check_function': check_brocade_fcport,
'inventory_function': inventory_brocade_fcport,
@@ -393,7 +412,6 @@ check_info["brocade_fcport"] = {
2, # swNbMyPort
5, # swNbBaudRate
]),
-
# new way to get port speed supported by Brocade
( ".1.3.6.1.2.1", [
"2.2.1.3", # ifType, needed to extract fibre channel ifs only
(type 56)
@@ -402,7 +420,9 @@ check_info["brocade_fcport"] = {
# Not every device supports that
(".1.3.6.1.3.94.4.5.1", [
OID_END,
- "8", # FCMGMT-MIB::connUnitPortStatCountBBCreditZero
+ "6", # FCMGMT-MIB::connUnitPortStatCountTxElements
+ "7", # FCMGMT-MIB::connUnitPortStatCountRxElements
+ "8", # FCMGMT-MIB::connUnitPortStatCountBBCreditZero
]),
],
'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") \