[checkmk-commits] Check_MK Git: check_mk: #0648 brocade_fcport: new speed calculation of isl_ports

Goetz Golla gg at mathias-kettner.de
Thu Aug 21 14:50:38 CEST 2014


Module: check_mk
Branch: master
Commit: 4a3d81aca762df7cc4296ee7e569125b28d77490
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a3d81aca762df7cc4296ee7e569125b28d77490

Author: Goetz Golla <gg at mathias-kettner.de>
Date:   Thu Aug 21 14:49:18 2014 +0200

#0648 brocade_fcport: new speed calculation of isl_ports

Since Brocade firmware 7, the possible baud rate parameters of isl ports given in swNbBaudRate have been
extended. To account for this the calculation of the real baud rates from swNbBaudRate has been updated.

---

 .werks/648            |   11 +++++++++++
 ChangeLog             |    2 +-
 checks/brocade_fcport |   15 ++++++++++++++-
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/.werks/648 b/.werks/648
new file mode 100644
index 0000000..7219e21
--- /dev/null
+++ b/.werks/648
@@ -0,0 +1,11 @@
+Title: brocade_fcport: new speed calculation of isl_ports
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1408625154
+Class: feature
+
+Since Brocade firmware 7, the possible baud rate parameters of isl ports given in swNbBaudRate have been
+extended. To account for this the calculation of the real baud rates from swNbBaudRate has been updated.
+
diff --git a/ChangeLog b/ChangeLog
index 5ed2703..61ca0d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
     * 1006 printer_pages: add Perf-O-Meter and PNP template
     * 0646 brocade_fcport: the administrative states for which ports are inventorized can now be configured in WATO
     * 1010 chrony: new check for NTP synchronization via chrony on Linux...
+    * 0648 brocade_fcport: new speed calculation of isl_ports...
     * 1051 FIX: tcp_conn_stats: fix missing performance data...
     * 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
     * 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
@@ -50,7 +51,6 @@
     * 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after editing availability options...
 
     WATO:
-    * 1095 New WATO Web-API: Now able to manage hosts via web automation calls
     * 1096 New WATO webservices: manage hosts via webinterface...
     * 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different OS versions)...
     * 1089 FIX: Snapshot restore: fixed exception during exception handling......
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index 6cecd89..32590e7 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -35,6 +35,19 @@ brocade_fcport_admstates = [ '', 'online', 'offline', 'testing', 'faulty' ]
 # Taken from swFCPortSpeed
 brocade_fcport_speed     = [ 'unknown', '1Gbit', '2Gbit', 'auto-Neg', '4Gbit', '8Gbit', '10Gbit', 'unknown', '16Gbit' ]
 
+# Taken from swNbBaudRate
+isl_speed = {
+        "1": 0, # other (1) - None of the following.
+        "2": 0.155, # oneEighth (2) - 155 Mbaud.
+        "4": 0.266, #•quarter (4) - 266 Mbaud.
+        "8": 0.532, # half (8) - 532 Mbaud.
+        "16": 1, #•full (16) - 1 Gbaud.
+        "32": 2, # double (32) - 2 Gbaud.
+        "64": 4, # quadruple (64) - 4 Gbaud.
+        "128": 8, # octuple (128) - 8 Gbaud.
+        "256": 10, # decuple (256) - 10 Gbaud.
+        "512": 16, # sexdecuple (512) - 16 Gbaud
+}
 
 # settings for inventory: which ports should be inventorized
 brocade_fcport_inventory_phystates = [ 3, 4, 5, 6, 7, 8, 9, ]
@@ -120,7 +133,7 @@ def check_brocade_fcport(item, params, info):
     # information in the normal table)
     isl_ports = dict(info[1])
     if str(index) in isl_ports:
-        gbit = float(int(isl_ports.get(str(index))) / 16)
+        gbit = isl_speed.get( isl_ports.get( str(index) ) )
         speedmsg = ("ISL at %.0fGbit/s"  % gbit)
     else: # no ISL port
         if brocade_fcport_speed[speed] in [ "auto-Neg", "unknown" ]:



More information about the checkmk-commits mailing list