Skip to content

Commit

Permalink
Add fields to IOS/NXOS show int (#1769)
Browse files Browse the repository at this point in the history
* Add HPE templates (#1246)

* Fix case sensitivity for HP Comware (#1272)

* Update cisco_nxos_show_interface.textfsm

adding additional parameters to be retrieved :
- PKT_INPUT_RATE
- PKT_OUTPUT_RATE
- BW_INPUT_RATE
- BW_OUTPUT_RATE

* Update cisco_ios_show_interfaces.textfsm

* Fix test cases

---------

Co-authored-by: Andrea Dainese <[email protected]>
Co-authored-by: Ardeck <[email protected]>
  • Loading branch information
3 people authored Jul 20, 2024
1 parent 558dd69 commit cdddb7c
Show file tree
Hide file tree
Showing 12 changed files with 594 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ntc_templates/templates/cisco_ios_show_interfaces.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Value OUTPUT_ERRORS (\d+)
Value VLAN_ID (\d+)
Value VLAN_ID_INNER (\d+)
Value VLAN_ID_OUTER (\d+)
Value QUEUE_SIZE (\d+)
Value QUEUE_MAX (\d+)
Value QUEUE_DROPS (\d+)
Value QUEUE_FLUSHES (\d+)
Value QUEUE_OUTPUT_DROPS (\d+)

Start
^\S+\s+is\s+.+?,\s+line\s+protocol.*$$ -> Continue.Record
Expand All @@ -48,6 +53,7 @@ Start
^\s+Encapsulation\s+${ENCAPSULATION}, outer ID\s+${VLAN_ID_OUTER}, inner ID\s+${VLAN_ID_INNER}.+$$
^\s+Encapsulation\s+${ENCAPSULATION},.+$$
^\s+Last\s+input\s+${LAST_INPUT},\s+output\s+${LAST_OUTPUT},\s+output\s+hang\s+${LAST_OUTPUT_HANG}\s*$$
^\s+Input\s+queue:\s+${QUEUE_SIZE}\/${QUEUE_MAX}\/${QUEUE_DROPS}\/${QUEUE_FLUSHES}\s+\(size\/max\/drops\/flushes\);\s+Total output\s+drops:\s+${QUEUE_OUTPUT_DROPS}\s*$$
^\s+Queueing\s+strategy:\s+${QUEUE_STRATEGY}\s*$$
^\s+${DUPLEX},\s+${SPEED},.+media\stype\sis\s${MEDIA_TYPE}$$
^\s+${DUPLEX},\s+${SPEED},.+TX/FX$$
Expand Down
9 changes: 8 additions & 1 deletion ntc_templates/templates/cisco_nxos_show_interface.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Value DELAY (\d+\s+\w+)
Value ENCAPSULATION ([\w\.]+)
Value LAST_LINK_FLAPPED (.+?)
Value VLAN_ID (\d+)
Value PACKET_INPUT_RATE (.+?)
Value PACKET_OUTPUT_RATE (.+?)
Value BANDWIDTH_INPUT_RATE (.+?)
Value BANDWIDTH_OUTPUT_RATE (.+?)
Value MEDIA_TYPE (.+?)

Start
^\S+\s+is.+ -> Continue.Record
Expand All @@ -30,11 +35,13 @@ Start
^\s+Description:\s+${DESCRIPTION}\s*$$
^\s+Internet\s+Address\s+is\s+${IP_ADDRESS}\/${PREFIX_LENGTH}
^\s+Port\s+mode\s+is\s+${MODE}
^\s+${DUPLEX}, ${SPEED}(,|$$)
^\s+${DUPLEX}, ${SPEED}(,\s+media\s+type\s+is\s+${MEDIA_TYPE})?\s*$$
^\s+MTU\s+${MTU}.*BW\s+${BANDWIDTH}.*DLY\s+${DELAY}
^\s+Encapsulation\s+${ENCAPSULATION}(,)?(\s+Virtual\s+LAN,\s+Vlan\s+ID\s+${VLAN_ID},)?
^\s+${INPUT_PACKETS}\s+input\s+packets\s+\d+\s+bytes\s*$$
^\s+${INPUT_ERRORS}\s+input\s+error\s+\d+\s+short\s+frame\s+\d+\s+overrun\s+\d+\s+underrun\s+\d+\s+ignored\s*$$
^\s+${OUTPUT_PACKETS}\s+output\s+packets\s+\d+\s+bytes\s*$$
^\s+${OUTPUT_ERRORS}\s+output\s+error\s+\d+\s+collision\s+\d+\s+deferred\s+\d+\s+late\s+collision\s*$$
^\s+Last\s+link\s+flapped\s+${LAST_LINK_FLAPPED}\s*$$
^\s+\d+\s+seconds\s+input\s+rate\s+${BANDWIDTH_INPUT_RATE}\s+bits/sec,\s+${PACKET_INPUT_RATE}\s+packets/sec
^\s+\d+\s+seconds\s+output\s+rate\s+${BANDWIDTH_OUTPUT_RATE}\s+bits/sec,\s+${PACKET_OUTPUT_RATE}\s+packets/sec
45 changes: 45 additions & 0 deletions tests/cisco_ios/show_interfaces/cisco_ios_show_interfaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "down (notconnect)"
queue_drops: "0"
queue_flushes: "0"
queue_max: "75"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: "Auto-speed"
Expand Down Expand Up @@ -68,6 +73,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "up (connected)"
queue_drops: "0"
queue_flushes: "0"
queue_max: "75"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: "Auto-speed"
Expand Down Expand Up @@ -105,6 +115,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "up (connected)"
queue_drops: "0"
queue_flushes: "0"
queue_max: "75"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: "Auto-speed"
Expand Down Expand Up @@ -142,6 +157,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "up (connected)"
queue_drops: "0"
queue_flushes: "0"
queue_max: "75"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: "Auto-speed"
Expand Down Expand Up @@ -179,6 +199,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "up (connected)"
queue_drops: "0"
queue_flushes: "0"
queue_max: "75"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: "Auto-speed"
Expand Down Expand Up @@ -216,6 +241,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "down (notconnect)"
queue_drops: "0"
queue_flushes: "0"
queue_max: "2000"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: "Auto-speed"
Expand Down Expand Up @@ -253,6 +283,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "up"
queue_drops: "0"
queue_flushes: "0"
queue_max: "75"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: ""
Expand Down Expand Up @@ -290,6 +325,11 @@ parsed_sample:
overrun: "0"
prefix_length: "16"
protocol_status: "up"
queue_drops: "0"
queue_flushes: "0"
queue_max: "75"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: ""
Expand Down Expand Up @@ -327,6 +367,11 @@ parsed_sample:
overrun: "0"
prefix_length: ""
protocol_status: "down"
queue_drops: "0"
queue_flushes: "0"
queue_max: "375"
queue_output_drops: "0"
queue_size: "0"
queue_strategy: "fifo"
runts: "0"
speed: "1000Mbps"
Expand Down
Loading

0 comments on commit cdddb7c

Please sign in to comment.