--Another one i cant take credit for as cursor made the fix and it appears to work--
Looking to make this textfsm a bit more robust. I matched the names from show int from cisco ios.
The current template skips the rate and error block after Last clearing of "show interface" counters. Those lines are present on Ethernet, Management, and Port-Channel, but they were unmatched/skip-only, so parsed output had no rates, packets, or errors.
Ethernet49 is up, line protocol is up (connected)
Hardware is Ethernet, address is 985d.82b8.fb26 (bia 985d.82b8.fb26)
Member of Port-Channel1
Ethernet MTU 9214 bytes, BW 10000000 kbit
Full-duplex, 10Gb/s, auto negotiation: off, uni-link: n/a
Up 17 minutes, 32 seconds
Loopback Mode : None
4 link status changes since last clear
Last clearing of "show interface" counters 0:27:02 ago
5 minutes input rate 7.39 kbps (0.0% with framing overhead), 6 packets/sec
5 minutes output rate 15.4 kbps (0.0% with framing overhead), 10 packets/sec
7084 packets input, 1015083 bytes
Received 2180 broadcasts, 2051 multicast
0 runts, 0 giants
0 input errors, 0 CRC, 0 alignment, 0 symbol, 0 input discards
0 PAUSE input
11644 packets output, 2229928 bytes
Sent 1921 broadcasts, 5293 multicast
Loopback0 is administratively down, line protocol is down (disabled)
Hardware is Loopback
Internet address is 44.44.44.44/32
Broadcast address is 255.255.255.255
IP MTU 65535 bytes (default)
Down 4 minutes, 2 seconds
Loopback2 is administratively down, line protocol is down (disabled)
Hardware is Loopback
Internet address is 22.22.22.22/32
Broadcast address is 255.255.255.255
IP MTU 65535 bytes (default)
Down 3 minutes, 55 seconds
Management1 is up, line protocol is up (connected)
Hardware is Ethernet, address is 985d.82b8.faf4 (bia 985d.82b8.faf4)
Internet address is 10.16.100.5/24
Broadcast address is 255.255.255.255
IP MTU 1500 bytes (default), BW 1000000 kbit
Full-duplex, 1Gb/s, auto negotiation: on, uni-link: n/a
Up 8 minutes, 57 seconds
Loopback Mode : None
8 link status changes since last clear
Last clearing of "show interface" counters 0:27:02 ago
5 minutes input rate 12.9 kbps (0.0% with framing overhead), 9 packets/sec
5 minutes output rate 1.67 kbps (0.0% with framing overhead), 1 packets/sec
7444 packets input, 1360817 bytes
Received 2719 broadcasts, 4383 multicast
0 runts, 0 giants
655 input errors, 274 CRC, 248 alignment, 0 symbol, 0 input discards
0 PAUSE input
905 packets output, 167687 bytes
Sent 14 broadcasts, 702 multicast
0 output errors, 0 collisions
0 late collision, 4 deferred, 0 output discards
0 PAUSE output
Port-Channel1 is up, line protocol is up (connected)
Hardware is Port-Channel, address is 985d.82b8.fb26
Ethernet MTU 9214 bytes, BW 10000000 kbit
Full-duplex, 10Gb/s
Active members in this channel: 1
... Ethernet49 , Full-duplex, 10Gb/s
Fallback mode is: off
Up 17 minutes, 30 seconds
2 link status changes since last clear
Last clearing of "show interface" counters never
5 minutes input rate 7.39 kbps (0.0% with framing overhead), 6 packets/sec
5 minutes output rate 15.4 kbps (0.0% with framing overhead), 10 packets/sec
7084 packets input, 1015083 bytes
Received 2180 broadcasts, 2051 multicast
0 input errors, 0 input discards
11644 packets output, 2229928 bytes
Sent 1921 broadcasts, 5293 multicast
0 output errors, 0 output discards 0 output errors, 0 collisions
0 late collision, 0 deferred, 0 output discards
0 PAUSE output
Value Required INTERFACE (\S+)
Value LINK_STATUS (.*)
Value PROTOCOL_STATUS (.*)
Value HARDWARE_TYPE ([\w+-]+)
Value MAC_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]+)
Value DESCRIPTION ([^\"]*)
Value IP_ADDRESS (\d+\.\d+\.\d+\.\d+\/\d+)
Value MTU (\d+)
Value BANDWIDTH (\d+\s+\w+)
Value LAST_LINK_FLAPPED (.*)
Value LINK_STATUS_CHANGE (\d+)
Value INPUT_RATE ([\d.]+\s+\S+)
Value OUTPUT_RATE ([\d.]+\s+\S+)
Value INPUT_PPS (\d+)
Value OUTPUT_PPS (\d+)
Value INPUT_PACKETS (\d+)
Value OUTPUT_PACKETS (\d+)
Value RUNTS (\d+)
Value GIANTS (\d+)
Value INPUT_ERRORS (\d+)
Value CRC (\d+)
Value INPUT_DISCARDS (\d+)
Value RX_PAUSE (\d+)
Value OUTPUT_ERRORS (\d+)
Value COLLISIONS (\d+)
Value LATE_COLLISIONS (\d+)
Value DEFERRED (\d+)
Value OUTPUT_DISCARDS (\d+)
Value TX_PAUSE (\d+)
Start
^\S+\s+is\s+\S+(\s+\S+)?, -> Continue.Record
^${INTERFACE}\s+is\s+${LINK_STATUS},\s+line\s+protocol\s+is\s+${PROTOCOL_STATUS}
^\s+Hardware\s+is\s+${HARDWARE_TYPE}(.*address\s+is\s+${MAC_ADDRESS})*(.*bia\s+${BIA})*
^\s+Description:\s+"?${DESCRIPTION}"?$$
^\s+Internet\s+address\s+is\s+${IP_ADDRESS}
^\s+(Up|Down)\s+${LAST_LINK_FLAPPED}
^\s+${LINK_STATUS_CHANGE}\s+link\s+status\s+changes.*
^.*MTU\s+${MTU}(.*BW\s+${BANDWIDTH})*
^\s+Broadcast\s+address
^\s+Address\s+determined
^\s+\S+(-|\s)duplex,
^\s+Last\s+clearing
^\s+\d+\s+\S+\s+input\s+rate\s+${INPUT_RATE}\s+\([^)]+\),\s+${INPUT_PPS}\s+packets/sec
^\s+\d+\s+\S+\s+output\s+rate\s+${OUTPUT_RATE}\s+\([^)]+\),\s+${OUTPUT_PPS}\s+packets/sec
^\s+${INPUT_PACKETS}\s+packets\s+input,
^\s+${OUTPUT_PACKETS}\s+packets\s+output,
^\s+(Sent|Received)\s+\d+\s+broadcasts,
^\s+${RUNTS}\s+runts,\s+${GIANTS}\s+giants
^\s+${INPUT_ERRORS}\s+input\s+errors,\s+${CRC}\s+CRC,\s+\d+\s+alignment,\s+\d+\s+symbol,\s+${INPUT_DISCARDS}\s+input\s+discards
^\s+${INPUT_ERRORS}\s+input\s+errors,\s+${INPUT_DISCARDS}\s+input\s+discards
^\s+${RX_PAUSE}\s+PAUSE\s+input
^\s+${OUTPUT_ERRORS}\s+output\s+errors,\s+${COLLISIONS}\s+collisions
^\s+${OUTPUT_ERRORS}\s+output\s+errors,\s+${OUTPUT_DISCARDS}\s+output\s+discards
^\s+${LATE_COLLISIONS}\s+late\s+collision,\s+${DEFERRED}\s+deferred,\s+${OUTPUT_DISCARDS}\s+output\s+discards
^\s+${TX_PAUSE}\s+PAUSE\s+output
^\s+Loopback\s+Mode\s*:
^\s+Active\s+members
^\s+Fallback\s+mode
^\s+IPv6\s+link-local
^\s+.+IPv6\s+global\s+unicast
^\s+[\dA-Fa-f:]+,\s+subnet\s+is
^\s+Member\s+of\s+
^\s+...\s+\S+\s+,
^\s+No\s+Internet\s+protocol\s+address\s+assigned
^\s+Source\s+interface\s+is
^\s+Listening\s+on
^\s+Replication/Flood\s+Mode
^\s+Remote\s+MAC\s+learning
^\s+VNI\s+mapping
^\s+\[(\d+(,\s+)?)+\]
^\s+Note:
^\s+Use\s+'show.*'
^\s+Static\s+V(RF|LAN)
^\s+Headend\s+replication
^\s+\d+\s+\S+\s+\S+
^\s+MLAG\s+Shared\s+Router\s+MAC
^\s*$$
^. -> Error
--Another one i cant take credit for as cursor made the fix and it appears to work--
Looking to make this textfsm a bit more robust. I matched the names from show int from cisco ios.
The current template skips the rate and error block after Last clearing of "show interface" counters. Those lines are present on Ethernet, Management, and Port-Channel, but they were unmatched/skip-only, so parsed output had no rates, packets, or errors.
Device: DCS-7010T-48-R running 4.27.0F
Fix: