Skip to content

Commit

Permalink
add speed and duplex
Browse files Browse the repository at this point in the history
  • Loading branch information
itdependsnetworks authored and GGabriele committed May 3, 2017
1 parent 2694b5d commit b438fe3
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 107 deletions.
7 changes: 6 additions & 1 deletion templates/cisco_nxos_show_interface.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Value BIA ([a-zA-Z0-9]+.[a-zA-Z0-9]+.[a-zA-Z0-9]+)
Value DESCRIPTION (.*)
Value IP_ADDRESS (\d+\.\d+\.\d+\.\d+\/\d+)
Value MTU (\d+)
Value DUPLEX (.+duplex?)
Value SPEED (.+?)
Value BANDWIDTH (\d+\s+\w+)
Value DELAY (\d+\s+\w+)
Value ENCAPSULATION (\w+)
Expand All @@ -17,5 +19,8 @@ Start
^\s+Hardware(:|\s+is)\s+${HARDWARE_TYPE},\s+address(:|\s+is)\s+${ADDRESS}(.*bia\s+${BIA})*
^\s+Description:\s+${DESCRIPTION}
^\s+Internet\s+Address\s+is\s+${IP_ADDRESS}
^\s+${DUPLEX}, ${SPEED}(,|$$)
^\s+MTU\s+${MTU}.*BW\s+${BANDWIDTH}.*DLY\s+${DELAY}
^\s+Encapsulation\s+${ENCAPSULATION} -> Record
^\s+Encapsulation\s+${ENCAPSULATION}
^\s+Last -> Record
^\s+Rx -> Record
6 changes: 5 additions & 1 deletion templates/cisco_xr_show_interfaces.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Value BIA ([a-zA-Z0-9]+.[a-zA-Z0-9]+.[a-zA-Z0-9]+)
Value DESCRIPTION (.*)
Value IP_ADDRESS (\d+\.\d+\.\d+\.\d+\/\d+)
Value MTU (\d+)
Value DUPLEX (.+?)
Value SPEED (.+?)
Value BANDWIDTH (\d+\s+\w+)
Value ENCAPSULATION (\w+)

Expand All @@ -16,4 +18,6 @@ Start
^\s+Description:\s+${DESCRIPTION}
^\s+Internet\s+Address\s+is\s+${IP_ADDRESS}
^\s+MTU\s+${MTU}.*BW\s+${BANDWIDTH}
^\s+Encapsulation\s+${ENCAPSULATION} -> Record
^\s+${DUPLEX}, ${SPEED},.+link
^\s+Encapsulation\s+${ENCAPSULATION}
^\s+Last -> Record
81 changes: 42 additions & 39 deletions tests/cisco_nxos/show_interface/cisco_nxos_show_interface.parsed
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
---
parsed_sample:

- address: "5087.89a1.d8d5"
admin_state: ""
bandwidth: "1000000 Kbit"
bia: ""
delay: "10 usec"
description: ""
encapsulation: "ARPA"
hardware_type: "EtherSVI"
interface: "Vlan20"
ip_address: "10.1.20.3/24"
link_status: "down"
mtu: "1500"

- address: "5087.89a1.d8ce"
admin_state: "up"
bandwidth: "100000 Kbit"
bia: "5087.89a1.d8ce"
delay: "10 usec"
description: "out of band mgmt interface"
encapsulation: "ARPA"
hardware_type: "GigabitEthernet"
interface: "mgmt0"
ip_address: "10.1.100.21/24"
link_status: "up"
mtu: "1500"

- address: "5087.89a1.d8d6"
admin_state: "up"
bandwidth: "10000000 Kbit"
bia: "5087.89a1.d8d6"
delay: "10 usec"
description: ""
encapsulation: "ARPA"
hardware_type: "1000/10000 Ethernet"
interface: "Ethernet1/1"
ip_address: ""
link_status: "up"
mtu: "1500"

- address: 5087.89a1.d8d5
admin_state: ''
bandwidth: 1000000 Kbit
bia: ''
delay: 10 usec
description: ''
duplex: ''
encapsulation: ARPA
hardware_type: EtherSVI
interface: Vlan20
ip_address: 10.1.20.3/24
link_status: down
mtu: '1500'
speed: ''
- address: 5087.89a1.d8ce
admin_state: up
bandwidth: 100000 Kbit
bia: 5087.89a1.d8ce
delay: 10 usec
description: out of band mgmt interface
duplex: full-duplex
encapsulation: ARPA
hardware_type: GigabitEthernet
interface: mgmt0
ip_address: 10.1.100.21/24
link_status: up
mtu: '1500'
speed: 100 Mb/s
- address: 5087.89a1.d8d6
admin_state: up
bandwidth: 10000000 Kbit
bia: 5087.89a1.d8d6
delay: 10 usec
description: ''
duplex: full-duplex
encapsulation: ARPA
hardware_type: 1000/10000 Ethernet
interface: Ethernet1/1
ip_address: ''
link_status: up
mtu: '1500'
speed: 10 Gb/s
144 changes: 78 additions & 66 deletions tests/cisco_xr/show_interfaces/cisco_xr_show_interfaces.parsed
Original file line number Diff line number Diff line change
@@ -1,69 +1,81 @@
---
parsed_sample:

- address: ''
admin_state: up
bandwidth: 0 Kbit
bia: ''
description: "$DCI ~Loopback for OSPF/LDP/BGP/TE"
encapsulation: Loopback
hardware_type: Loopback
interface: Loopback5
ip_address: ''
link_status: up
mtu: '1500'
- address: ''
admin_state: up
bandwidth: 0 Kbit
bia: ''
description: ''
encapsulation: 'Null'
hardware_type: 'Null'
interface: Null0
ip_address: ''
link_status: up
mtu: '1500'
- address: ''
admin_state: up
bandwidth: 0 Kbit
bia: ''
description: "$DCI TE Tunnel For REPLICATION to P-YB19-C95"
encapsulation: TUNNEL
hardware_type: Tunnel
interface: tunnel-te300
ip_address: ''
link_status: up
mtu: '1500'
- address: f09e.6340.1420
admin_state: up
bandwidth: 1000000 Kbit
bia: f09e.6340.1420
description: Management Interface
encapsulation: ARPA
hardware_type: Management
interface: MgmtEth0/RSP1/CPU0/0
ip_address: ''
link_status: up
mtu: '1514'
- address: 5087.895f.81a0
admin_state: up
bandwidth: 40000000 Kbit
bia: 5087.895f.81a0
description: "$DCI ~QTS Richmond DCI @CRDC %P-CRDC-C98 +Fort0/0/0/0 !CRIT"
encapsulation: ARPA
hardware_type: FortyGigE
interface: FortyGigE0/0/0/0
ip_address: ''
link_status: up
mtu: '9216'
- address: 5087.8964.53b0
admin_state: up
bandwidth: 10000000 Kbit
bia: 5087.8964.53b0
description: "$DCI ~QTS Richmond Prod @CRDC %Z-CRDC-Dcc001 +Te5/1 !CRIT"
encapsulation: ARPA
hardware_type: TenGigE
interface: TenGigE0/3/0/0
ip_address: ''
link_status: up
mtu: '9216'
- address: ''
admin_state: up
bandwidth: 0 Kbit
bia: ''
description: $DCI ~Loopback for OSPF/LDP/BGP/TE
duplex: ''
encapsulation: Loopback
hardware_type: Loopback
interface: Loopback5
ip_address: ''
link_status: up
mtu: '1500'
speed: ''
- address: ''
admin_state: up
bandwidth: 0 Kbit
bia: ''
description: ''
duplex: ''
encapsulation: 'Null'
hardware_type: 'Null'
interface: Null0
ip_address: ''
link_status: up
mtu: '1500'
speed: ''
- address: ''
admin_state: up
bandwidth: 0 Kbit
bia: ''
description: $DCI TE Tunnel For REPLICATION to P-YB19-C95
duplex: ''
encapsulation: TUNNEL
hardware_type: Tunnel
interface: tunnel-te300
ip_address: ''
link_status: up
mtu: '1500'
speed: ''
- address: f09e.6340.1420
admin_state: up
bandwidth: 1000000 Kbit
bia: f09e.6340.1420
description: Management Interface
duplex: Full-duplex
encapsulation: ARPA
hardware_type: Management
interface: MgmtEth0/RSP1/CPU0/0
ip_address: ''
link_status: up
mtu: '1514'
speed: 1000Mb/s
- address: 5087.895f.81a0
admin_state: up
bandwidth: 40000000 Kbit
bia: 5087.895f.81a0
description: $DCI ~QTS Richmond DCI @CRDC %P-CRDC-C98 +Fort0/0/0/0 !CRIT
duplex: Full-duplex
encapsulation: ARPA
hardware_type: FortyGigE
interface: FortyGigE0/0/0/0
ip_address: ''
link_status: up
mtu: '9216'
speed: 40000Mb/s
- address: 5087.8964.53b0
admin_state: up
bandwidth: 10000000 Kbit
bia: 5087.8964.53b0
description: $DCI ~QTS Richmond Prod @CRDC %Z-CRDC-Dcc001 +Te5/1 !CRIT
duplex: Full-duplex
encapsulation: ARPA
hardware_type: TenGigE
interface: TenGigE0/3/0/0
ip_address: ''
link_status: up
mtu: '9216'
speed: 10000Mb/s

0 comments on commit b438fe3

Please sign in to comment.