Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update nxos show interface to capture discards #819

Closed
foats opened this issue Oct 27, 2020 · 3 comments
Closed

update nxos show interface to capture discards #819

foats opened this issue Oct 27, 2020 · 3 comments

Comments

@foats
Copy link

foats commented Oct 27, 2020

ISSUE TYPE
  • Feature Idea
TEMPLATE USING
cisco_nxos_show_interface.textfsm
SAMPLE COMMAND OUTPUT
Ethernet1/1 is up
admin state is up, Dedicated Interface
  Hardware: 1000/10000 Ethernet, address: 5087.89a1.d8d6 (bia 5087.89a1.d8d6)
  MTU 1500 bytes, BW 10000000 Kbit, DLY 10 usec
  reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, medium is broadcast
  Port mode is access
  full-duplex, 10 Gb/s, media type is 10G
  Beacon is turned off
  Auto-Negotiation is turned on
  Input flow-control is off, output flow-control is off
  Auto-mdix is turned off
  Rate mode is dedicated
  Switchport monitor is off
  EtherType is 0x8100
  EEE (efficient-ethernet) : n/a
  Last link flapped 2week(s) 1day(s)
  Last clearing of "show interface" counters 2w1d
  111 interface resets
  30 seconds input rate 80 bits/sec, 0 packets/sec
  30 seconds output rate 256 bits/sec, 0 packets/sec
  Load-Interval #2: 5 minute (300 seconds)
    input rate 112 bps, 0 pps; output rate 248 bps, 0 pps
  RX
    0 unicast packets  68448 multicast packets  0 broadcast packets
    68448 input packets  19188106 bytes
    0 jumbo packets  0 storm suppression packets
    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
    0 unicast packets  754962 multicast packets  0 broadcast packets
    754962 output packets  62262008 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
SUMMARY

Current template does not gather input discards or output discards. Those counters do not feed the input error or output error counters.

PROPOSED CHANGE
Value Required INTERFACE (\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]+)
Value DESCRIPTION (.*)
Value IP_ADDRESS (\d+\.\d+\.\d+\.\d+\/\d+)
Value MTU (\d+)
Value MODE (\S+)
Value DUPLEX (.+duplex?)
Value SPEED (.+?)
Value INPUT_PACKETS (\d+)
Value OUTPUT_PACKETS (\d+)
Value INPUT_ERRORS (\d+)
Value INPUT_DISCARDS (\d+)
Value OUTPUT_ERRORS (\d+)
Value OUTPUT_DISCARDS (\d+)
Value BANDWIDTH (\d+\s+\w+)
Value DELAY (\d+\s+\w+)
Value ENCAPSULATION (\w+)
Value LAST_LINK_FLAPPED (.+?)

Start
  ^\S+\s+is.+ -> Continue.Record
  ^${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}
  ^\s+Internet\s+Address\s+is\s+${IP_ADDRESS}
  ^\s+Port\s+mode\s+is\s+${MODE}
  ^\s+${DUPLEX}, ${SPEED}(,|$$)
  ^\s+MTU\s+${MTU}.*BW\s+${BANDWIDTH}.*DLY\s+${DELAY}
  ^\s+Encapsulation\s+${ENCAPSULATION}
  ^\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+\d+\s+input\s+with\s+dribble\s+${INPUT_DISCARDS}\s+input\s+discard\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+\d+\s+lost\s+carrier\s+\d+\s+no\s+carrier\s+\d+\s+babble\s+${OUTPUT_DISCARDS}\s+output\s+discard\s*$$
  ^\s+Last\s+link\s+flapped\s+${LAST_LINK_FLAPPED}\s*$$
@itdependsnetworks
Copy link
Contributor

  1. On Github Create a Fork (see here: https://guides.github.com/activities/forking/)
  2. Make sure you have git installed locally (follow your OS's installation instructions)
  3. Clone from your fork, created in previous step
    1. git clone https://github.com/foats/ntc-templates/
  4. Create a branch for your repo
    1. git checkout -b <your_branch> e.g. git checkout -b cisco_nxos_show_interface
  5. Update the files required, which is the template, xxxx and the expected files
    1. Update the template, by updating templates/cisco_nxos_show_interface.textfsm
    2. Update the raw file: tests/cisco_nxos/show_interface/*.raw (this should include the new use case you are showing in a new file, if not all ready captured)
    3. Update the expected file: tests/cisco_nxos/show_interface/*.yml, to reflect the changes your updates created to the raw file
  6. Stage the changes
    1. git add -A
  7. Commit changes with message
    1. git commit -m 'Updates to show interfaces template'
  8. Push the change
    1. git push origin <feature>, e.g. git push origin cisco_nxos_show_interface
  9. Follow steps for adding PR to GitHub. https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork

If you have issues you can feel free to ask on the #networktocode channel on Slack.

@itdependsnetworks
Copy link
Contributor

Going to close, let us know on slack is you have any questions.

@foats
Copy link
Author

foats commented Nov 18, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants