Module: check_mk
Branch: master
Commit: f2d601aa46f2fb2ce1d7a1b6236f6706108e389b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f2d601aa46f2fb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jan 8 14:46:44 2014 +0100
FIX brocade_fcport: cope with firmware that does not provide speed information
Some newer firmwares of Brocade switches do not output information about the
port speed anymore. That caused the check to fail. We now silently assume
auto negotiation in that case (which means 2Gbit/s if you haven't configured
this otherwise)
---
.werks/443 | 13 +++++++++++++
ChangeLog | 1 +
checks/brocade_fcport | 11 ++++++-----
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/.werks/443 b/.werks/443
new file mode 100644
index 0000000..bff039b
--- /dev/null
+++ b/.werks/443
@@ -0,0 +1,13 @@
+Title: brocade_fcport: cope with firmware that does not provide speed information
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1389188713
+Targetversion: future
+
+Some newer firmwares of Brocade switches do not output information about the
+port speed anymore. That caused the check to fail. We now silently assume
+auto negotiation in that case (which means 2Gbit/s if you haven't configured
+this otherwise)
diff --git a/ChangeLog b/ChangeLog
index 351a08b..97ef9ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,6 +81,7 @@
* 0440 FIX: heartbeat_crm: Inventory more gracefully handles case where agent output
is invalid...
* 0113 FIX: blade_blades: Now only make inventory for blades that are powered on...
* 0442 FIX: dell_om_disks: Treat global host spare disks as OK, instead of WARN...
+ * 0443 FIX: brocade_fcport: cope with firmware that does not provide speed
information...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index 6fef594..42c5f77 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -29,7 +29,7 @@ brocade_fcport_phystates = [ '', 'noCard',
'noTransceiver', 'laserFault', 'noLig
'noSync', 'inSync', 'portFault',
'diagFault', 'lockRef' ]
brocade_fcport_opstates = [ 'unknown', 'online', 'offline',
'testing', 'faulty' ]
brocade_fcport_admstates = [ '', 'online', 'offline',
'testing', 'faulty' ]
-brocade_fcport_speed = [ '', '1Gbit', '2Gbit',
'auto-Neg', '4Gbit', '8Gbit', '10Gbit', ]
+brocade_fcport_speed = [ 'unknown', '1Gbit', '2Gbit',
'auto-Neg', '4Gbit', '8Gbit', '10Gbit', ]
# settings for inventory: which ports should be inventorized
@@ -99,7 +99,8 @@ def check_brocade_fcport(item, params, info):
item_index = int(item.split()[0])
portinfo = [ line for line in info[0] if int(line[0]) == item_index + 1]
index, phystate, opstate, admstate, txwords, rxwords, txframes, rxframes, \
- notxcredits, rxcrcs, rxencoutframes, c3discards, speed = map(int,
portinfo[0][:-1])
+ notxcredits, rxcrcs, rxencoutframes, c3discards = map(int, portinfo[0][:-2])
+ speed = saveint(portinfo[0][-2])
summarystate = 0
output = []
@@ -112,13 +113,13 @@ def check_brocade_fcport(item, params, info):
gbit = float(int(isl_ports.get(str(index))) / 16)
speedmsg = ("ISL at %.0fGbit/s" % gbit)
else: # no ISL port
- if brocade_fcport_speed[speed] == "auto-Neg":
+ if brocade_fcport_speed[speed] in [ "auto-Neg", "unknown" ]:
# let user specify assumed speed via check parameter, default is 2.0
gbit = params.get("assumed_speed")
- speedmsg = ("assuming %gGbit/s" % gbit)
+ speedmsg = "assuming %gGbit/s" % gbit
else:
gbit = float(brocade_fcport_speed[speed].replace("Gbit",
""))
- speedmsg = ("%.0fGbit/s" % gbit)
+ speedmsg = "%.0fGbit/s" % gbit
output.append(speedmsg)