diff --git a/templates/cisco_nxos_show_interface.template b/templates/cisco_nxos_show_interface.template index 37c374a6f2..ca3b9868ab 100644 --- a/templates/cisco_nxos_show_interface.template +++ b/templates/cisco_nxos_show_interface.template @@ -1,6 +1,6 @@ Value Required INTERFACE (\S+) -Value LINK_STATUS (\w+) -Value ADMIN_STATE (\S+) +Value LINK_STATUS (.+?) +Value ADMIN_STATE (.+?) Value HARDWARE_TYPE (.*) Value ADDRESS ([a-zA-Z0-9]+.[a-zA-Z0-9]+.[a-zA-Z0-9]+) Value BIA ([a-zA-Z0-9]+.[a-zA-Z0-9]+.[a-zA-Z0-9]+) @@ -14,7 +14,8 @@ Value DELAY (\d+\s+\w+) Value ENCAPSULATION (\w+) Start - ^${INTERFACE}\s+is\s+${LINK_STATUS} + ^${INTERFACE}\s+is\s+${LINK_STATUS},\sline\sprotocol\sis\s${ADMIN_STATE}$$ + ^${INTERFACE}\s+is\s+${LINK_STATUS}$$ ^admin\s+state\s+is\s+${ADMIN_STATE}, ^\s+Hardware(:|\s+is)\s+${HARDWARE_TYPE},\s+address(:|\s+is)\s+${ADDRESS}(.*bia\s+${BIA})* ^\s+Description:\s+${DESCRIPTION} @@ -22,5 +23,4 @@ Start ^\s+${DUPLEX}, ${SPEED}(,|$$) ^\s+MTU\s+${MTU}.*BW\s+${BANDWIDTH}.*DLY\s+${DELAY} ^\s+Encapsulation\s+${ENCAPSULATION} - ^\s+Last -> Record - ^\s+Rx -> Record + ^\s*$$ -> Record diff --git a/tests/cisco_nxos/show_interface/cisco_nxos_show_interface.parsed b/tests/cisco_nxos/show_interface/cisco_nxos_show_interface.parsed index dc75c5269a..113d9f4629 100644 --- a/tests/cisco_nxos/show_interface/cisco_nxos_show_interface.parsed +++ b/tests/cisco_nxos/show_interface/cisco_nxos_show_interface.parsed @@ -2,7 +2,7 @@ parsed_sample: - address: 5087.89a1.d8d5 - admin_state: '' + admin_state: down bandwidth: 1000000 Kbit bia: '' delay: 10 usec @@ -12,7 +12,7 @@ parsed_sample: hardware_type: EtherSVI interface: Vlan20 ip_address: 10.1.20.3/24 - link_status: down + link_status: down (VLAN/BD is down) mtu: '1500' speed: '' - address: 5087.89a1.d8ce diff --git a/tests/cisco_nxos/show_interface/cisco_nxos_show_interface2.parsed b/tests/cisco_nxos/show_interface/cisco_nxos_show_interface2.parsed new file mode 100644 index 0000000000..9b9abad225 --- /dev/null +++ b/tests/cisco_nxos/show_interface/cisco_nxos_show_interface2.parsed @@ -0,0 +1,87 @@ +--- +parsed_sample: + +- address: 00de.fb01.c9bc + admin_state: down + bandwidth: 1000000 Kbit + bia: '' + delay: 10 usec + description: '' + duplex: '' + encapsulation: '' + hardware_type: EtherSVI + interface: Vlan1 + ip_address: '' + link_status: down (Administratively down) + mtu: '1500' + speed: '' +- address: 00de.fb01.c921 + admin_state: up + bandwidth: 1000000 Kbit + bia: '' + delay: 10 usec + description: '' + duplex: '' + encapsulation: '' + hardware_type: EtherSVI + interface: Vlan330 + ip_address: 192.168.1.3/24 + link_status: up + mtu: '1500' + speed: '' +- address: 00de.fb01.c933 + admin_state: up + bandwidth: 1000000 Kbit + bia: '' + delay: 10 usec + description: '' + duplex: '' + encapsulation: '' + hardware_type: EtherSVI + interface: Vlan336 + ip_address: 192.168.2.3/24 + link_status: up + mtu: '1500' + speed: '' +- address: 00de.fb01.c9ab + admin_state: up + bandwidth: 1000000 Kbit + bia: '' + delay: 10 usec + description: '' + duplex: '' + encapsulation: '' + hardware_type: EtherSVI + interface: Vlan339 + ip_address: 192.168.3.3/24 + link_status: up + mtu: '1500' + speed: '' +- address: 00de.fb01.c9ef + admin_state: up + bandwidth: 1000000 Kbit + bia: '' + delay: 10 usec + description: '' + duplex: '' + encapsulation: '' + hardware_type: EtherSVI + interface: Vlan300 + ip_address: 192.168.24.1/24 + link_status: up + mtu: '1500' + speed: '' +- address: 0000.d200.0000 + admin_state: '' + bandwidth: 23 Kbit + bia: 0000.d200.0000 + delay: 10 usec + description: '' + duplex: auto-duplex + encapsulation: ARPA + hardware_type: 10/100/1000 Ethernet + interface: Ethernet106/1/1 + ip_address: '' + link_status: down (Link not connected) + mtu: '1500' + speed: auto-speed diff --git a/tests/cisco_nxos/show_interface/cisco_nxos_show_interface2.raw b/tests/cisco_nxos/show_interface/cisco_nxos_show_interface2.raw new file mode 100644 index 0000000000..7850922742 --- /dev/null +++ b/tests/cisco_nxos/show_interface/cisco_nxos_show_interface2.raw @@ -0,0 +1,58 @@ +Vlan1 is down (Administratively down), line protocol is down + Hardware is EtherSVI, address is 00de.fb01.c9bc + MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec + +Vlan330 is up, line protocol is up + Hardware is EtherSVI, address is 00de.fb01.c921 + Internet Address is 192.168.1.3/24 + MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec + +Vlan336 is up, line protocol is up + Hardware is EtherSVI, address is 00de.fb01.c933 + Internet Address is 192.168.2.3/24 + MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec + +Vlan339 is up, line protocol is up + Hardware is EtherSVI, address is 00de.fb01.c9ab + Internet Address is 192.168.3.3/24 + MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec + +Vlan300 is up, line protocol is up + Hardware is EtherSVI, address is 00de.fb01.c9ef + Internet Address is 192.168.24.1/24 + MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec + +Ethernet106/1/1 is down (Link not connected) + Hardware: 10/100/1000 Ethernet, address: 0000.d200.0000 (bia 0000.d200.0000) + MTU 1500 bytes, BW 23 Kbit, DLY 10 usec + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation ARPA + Port mode is access + auto-duplex, auto-speed + Beacon is turned off + Input flow-control is off, output flow-control is on + Switchport monitor is off + EtherType is 0x8100 + Last link flapped 14week(s) 5day(s) + Last clearing of "show interface" counters never + 9 interface resets + 30 seconds input rate 0 bits/sec, 0 packets/sec + 30 seconds output rate 0 bits/sec, 0 packets/sec + Load-Interval #2: 5 minute (300 seconds) + input rate 0 bps, 0 pps; output rate 0 bps, 0 pps + RX + 18476 unicast packets 506094 multicast packets 362760 broadcast packets + 887330 input packets 70500074 bytes + 2 jumbo packets 0 storm suppression bytes + 0 runts 0 giants 0 CRC 0 no buffer + 0 input error 0 short frame 0 overrun 0 underrun 0 ignored + 0 watchdog 0 bad etype drop 0 bad proto drop 0 if down drop + 0 input with dribble 0 input discard + 0 Rx pause + TX + 17841 unicast packets 5660600 multicast packets 339717 broadcast packets + 6018158 output packets 711823811 bytes + 0 jumbo packets + 0 output error 0 collision 0 deferred 0 late collision + 0 lost carrier 0 no carrier 0 babble 0 output discard + 0 Tx pause