networktocode/ntc-templates

Add errors to cisco_xr_show_interfaces

Closed this issue · 1 comments

ISSUE TYPE
  • Feature Idea
TEMPLATE USING
Value Required INTERFACE (\S+)
Value LINK_STATUS (.+?)
Value ADMIN_STATE (.+?)
Value HARDWARE_TYPE (\S+?(?:\s+Ethernet|))
Value ADDRESS ((?:\w{4}\.){2}\w{4})
Value BIA ((?:\w{4}\.){2}\w{4})
Value DESCRIPTION (.*?)
Value IP_ADDRESS (.*?)
Value MTU (\d+)
Value DUPLEX (.+?)
Value SPEED (.+?b/s)
Value BANDWIDTH (\d+\s+\w+)
Value ENCAPSULATION (\w+)

Start
  ^\S+\s+is -> Continue.Record
  ^${INTERFACE}\sis\s+${LINK_STATUS},\s+line\sprotocol\sis\s+${ADMIN_STATE}\s*$$
  ^\s+Hardware\s+is\s+${HARDWARE_TYPE}(?:\s+interface\(s\)|)(?:,\s+address\s+is\s+${ADDRESS}(?:\s+\(bia\s+${BIA}\)\s*)*$$|\s.+|\s*$$)
  ^\s+Description:\s+${DESCRIPTION}\s*$$
  ^\s+[Ii]nternet\s+[Aa]ddress\s+is\s+${IP_ADDRESS}\s*$$
  ^\s+MTU\s+${MTU}.*BW\s+${BANDWIDTH}
  ^\s+Encapsulation\s+${ENCAPSULATION}
  ^\s+(?:[Dd]uplex\s+|)${DUPLEX}(?:-[Dd]uplex|),\s+${SPEED}
SAMPLE COMMAND OUTPUT
HundredGigE0/0/0/3 is administratively down, line protocol is administratively down 
  Interface state transitions: 0
  Hardware is HundredGigE, address is 0000.0000.0000 (bia 0000.0000.0000)
  Internet address is Unknown
  MTU 1514 bytes, BW 100000000 Kbit (Max: 100000000 Kbit)
     reliability 255/255, txload 0/255, rxload 0/255
  Encapsulation ARPA,
  Full-duplex, 100000Mb/s, link type is force-up
  output flow control is off, input flow control is off
  Carrier delay (up) is 10 msec
  loopback not set,
  Last input never, output never
  Last clearing of "show interface" counters never
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 total input drops
     0 drops for unrecognized upper-level protocol
     Received 0 broadcast packets, 0 multicast packets
              0 runts, 0 giants, 0 throttles, 0 parity
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 packets output, 0 bytes, 0 total output drops
     Output 0 broadcast packets, 0 multicast packets
     0 output errors, 0 underruns, 0 applique, 0 resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
SUMMARY

This template currently doesn't output the input/output errors.

STEPS TO REPRODUCE

The input/output errors would be included in the output.

EXPECTED RESULTS
ACTUAL RESULTS

@PcInfamy
I submitted PR #1792
This should have all the error counter info you were looking for plus a few other things such as input/output rates.
Hope this helps!

Shameless plug for the time I have invested.
If I've helped, you could consider buying me a coffee. 😀