View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
1421 | RackTables | default | public | 2015-02-13 14:56 | 2015-02-24 11:01 |
Reporter | levi | Assigned To | infrastation | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.20.10 | ||||
Target Version | 0.20.11 | Fixed in Version | 0.20.11 | ||
Summary | 1421: Contribution to enable switches from extreme networks to show link status. | ||||
Description | I was not sure how to contribute code to project so decided to open a case. We have couple of Extreme x650-24 switches. Out of box RackTables is not showing port status at all so i made some changes in wwwroot/inc/deviceconfig.php file to enable this functionality. Diff can be found in attached deviceconfig.diff file. Below is explanation and reasoning of changes made. First of all currently RT uses "show ports information" to get port status from device. Example of output is attached in file show_port_information.txt. There are two problems with this output: 1) Interface name is from IfDescription and is truncated, so exact match is not possible. 2) With extreme switches "Local name" field should be in format of either [port-number] (1-24 for 24 port switch) or in case of stack of switches [number-in-stack]:[port-number] (1:1-24, 2:1-24, etc...) otherwise Live LLDP will fail to identify ports. Considering above i have decided to change command to "show ports no-refresh" which gives output as in file show_port_no-refresh.txt and made changes accordingly. It would be great to include this change in next update so i will not make this changes manually every time. Feel free to ask any additional questions. Thank you. | ||||
Tags | No tags attached. | ||||
deviceconfig.diff (1,684 bytes)
diff --git a/home/levi/RackTables-0.20.10/wwwroot/inc/deviceconfig.php b/opt/racktables/wwwroot/inc/deviceconfig.php index 5879344..a90bdc6 100644 --- a/home/levi/RackTables-0.20.10/wwwroot/inc/deviceconfig.php +++ b/opt/racktables/wwwroot/inc/deviceconfig.php @@ -104,14 +104,14 @@ function xos12ReadInterfaceStatus ($input) { $ret = array(); foreach (explode ("\n", $input) as $line) - if (preg_match('/^(\d+)\s+([ED])[a-zA-Z-]+\s+(active|ready)\s+/', $line, $m)) + if (preg_match('/^(\d+|\d:\d+)\s+.*\s+([ED])\s+([AR])\s+/', $line, $m)) { - $portname = shortenIfName ($m[1]); - if ($m[3] == 'active') + $portname = $m[1]; + if ($m[2] == 'E' and $m[3] == 'A') $status = 'up'; - elseif ($m[2] == 'E') + elseif ($m[2] == 'E' and $m[3] == 'R' ) $status = 'down'; - else + elseif ($m[2] == 'D') $status = 'disabled'; $ret[$portname]['status'] = $status; } @@ -1695,7 +1695,7 @@ function xos12TranslatePushQueue ($dummy_object_id, $queue, $dummy_vlan_names) $ret .= "show configuration\n"; break; case 'getportstatus': - $ret .= "show ports information\n"; + $ret .= "show ports no-refresh\n"; break; case 'getmaclist': $ret .= "show fdb\n"; |
|
show_port_information.txt (3,574 bytes)
# show ports information Port Flags Link ELSM Link Num Num Num Jumbo QOS Load State /OAM UPS STP VLAN Proto Size profile Master ==================================================================================== JUNIPER_> Emjla---e--fMB---x active - / - 2 0 50 0 9216 none 1 a JUNIPER_> Emjla---e--fMB---x active - / - 2 0 50 0 9216 none 1 a JUNIPER_> Emjla---e--fMB---x active - / - 2 0 50 0 9216 none 1 a JUNIPER_> Emjla---e--fMB---x active - / - 2 0 50 0 9216 none 1 a Core1-13> Emjla---e--fMB---x active - / - 6 0 19 0 9216 none 16 a SDN-1_0_> Emjla---e--fMB---x active - / - 15 0 34 0 9216 none 22 a BLM002 Dmj-----e--fMB---x ready - / - 4 0 1 0 9216 none BLM003 Dmj-----e--fMB---x ready - / - 4 0 1 0 9216 none BLM004 Dmj-----e--fMB---x ready - / - 3 0 1 0 9216 none Core1-13> Emjla---e--fMB---x active - / - 6 0 19 0 9216 none 16 a Core2-13> Emjla---e--fMB---x active - / - 2 0 2 0 9216 none 11 a SDN-1_0_> Emjla---e--fMB---x active - / - 1 0 34 0 9216 none 22 a GNC_VAN_> Emj-----e--fMB---x active - / - 2 0 59 0 9216 none GNC_VAN_> Emj-----ev-fMB---x active - / - 2 0 1 1 9216 none Core1-13> Emjla---e--fMB---x active - / - 6 0 19 0 9216 none 16 a Core1-13> Emjla---e--fMB---x active - / - 6 0 19 0 9216 none 16 a Core2-13> Emjla---e--fMB---x active - / - 2 0 2 0 9216 none 11 a FI1500 Emj-----e--fMB---x active - / - 2 0 60 0 9216 none 19 Dmj-----e--fMB---x ready - / - 5 0 0 0 9216 none EXT_3_MA> Emjla---e--fMB---x active - / - 2 0 10 0 9216 none 20 a EXT_3_MA> Emjla---e--fMB---x active - / - 2 0 10 0 9216 none 20 a SDN-1_0_> Emjla---e--fMB---x active - / - 4 0 34 0 9216 none 22 a EXT_3_MA> Emjla---e--fMB---x active - / - 2 0 10 0 9216 none 20 a GNC_BAGR> Emj-----e--fMB---x active - / - 18 0 6 0 9216 none CalixTES> Emj-----ev-fMB---x active - / - 13 0 2 1 9216 none FI1500_1> Emj-----ev-fMB---x active - / - 4 0 1 1 9216 none SDN Emjla---e--fMB---x active - / - 3 0 4 0 9216 none 27 a STB-TEST Dmj-----ev-fMB---x ready - / - 1 0 1 1 9216 none ==================================================================================== > indicates Port Display Name truncated past 8 characters Flags : a - Load Sharing Algorithm address-based, D - Port Disabled, e - Extreme Discovery Protocol Enabled, E - Port Enabled, g - Egress TOS Enabled, j - Jumbo Frame Enabled, l - Load Sharing Enabled, m - MACLearning Enabled, n - Ingress TOS Enabled, o - Dot1p Replacement Enabled, P - Software redundant port(Primary), R - Software redundant port(Redundant), q - Background QOS Monitoring Enabled, s - diffserv Replacement Enabled, v - Vman Enabled, f - Unicast Flooding Enabled, M - Multicast Flooding Enabled, B - Broadcast Flooding Enabled L - Extreme Link Status Monitoring Enabled O - Ethernet OAM Enabled w - MACLearning Disabled with Forwarding b - Rx and Tx Flow Control Enabled, x - Rx Flow Control Enabled p - Priority Flow Control Enabled |
|
show_port_no-refresh.txt (2,579 bytes)
Switch without stack # sho ports no-refresh Port Summary Port Display VLAN Name Port Link Speed Duplex # String (or # VLANs) State State Actual Actual ================================================================== 1 JUNIPER_P_XE-0/0(0050) E A 10G FULL 2 JUNIPER_P_XE-0/2(0050) E A 10G FULL 3 JUNIPER_P_XE-7/1(0050) E A 10G FULL 4 JUNIPER_P_XE-7/2(0050) E A 10G FULL 5 Core1-13/2 (0019) E A 10G FULL 6 SDN-1_0_18 (0034) E A 10G FULL ....... 28 STB-TEST Core-TV-Test D R ================================================================== Port State: D-Disabled, E-Enabled Link State: A-Active, R-Ready, NP-Port not present, L-Loopback, D-ELSM enabled but not up d-Ethernet OAM enabled but not up Stacked switch # show ports no-refresh Port Summary Port Display VLAN Name Port Link Speed Duplex # String (or # VLANs) State State Actual Actual ================================================================== 1:1 Yerevan-R2 (0003) E A 10G FULL 1:2 Sofia_Connect SW1-SOF-SOFIA-CONNE E A 10G FULL 1:3 Sofia-Frankfurt D R 1:4 Yerevan-R2 (0003) E A 10G FULL 1:5 E A 10G FULL 1:6 D R ....... 1:28 D R 2:1 D R 2:2 D R 2:3 Sofia-Frankfurt D R 2:4 D R 2:5 E R 2:6 D R ....... 2:28 D R ================================================================== Port State: D-Disabled, E-Enabled Link State: A-Active, R-Ready, NP-Port not present, L-Loopback, D-ELSM enabled but not up d-Ethernet OAM enabled but not up |
|
Please make a pull request. https://github.com/RackTables/racktables |
|
Release 0.20.11 will have these changes. Thank you! | |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-02-13 14:56 | levi | New Issue | |
2015-02-13 14:56 | levi | File Added: deviceconfig.diff | |
2015-02-13 14:56 | levi | File Added: show_port_information.txt | |
2015-02-13 14:56 | levi | File Added: show_port_no-refresh.txt | |
2015-02-13 16:19 | adoom42 | Note Added: 0002703 | |
2015-02-24 11:01 | infrastation | Note Added: 0002733 | |
2015-02-24 11:01 | infrastation | Assigned To | => infrastation |
2015-02-24 11:01 | infrastation | Status | new => closed |
2015-02-24 11:01 | infrastation | Resolution | open => fixed |
2015-02-24 11:01 | infrastation | Fixed in Version | => 0.20.11 |
2015-02-24 11:01 | infrastation | Target Version | => 0.20.11 |