ntc-templates icon indicating copy to clipboard operation
ntc-templates copied to clipboard

cisco_nxos_show_ip_bgp output misaligns for next-hop length >= 14 characters and no metric

Open chuckysap opened this issue 2 years ago • 2 comments

ISSUE TYPE
  • Template Issue with error and raw data
TEMPLATE USING
Value STATUS ([bceEisS*>#?])
Value PATH_SELECTION ([bceEisS*>#? ])
Value ROUTE_SOURCE ([bceEisS*>#? ])
Value NETWORK (\S+)
Value NEXT_HOP (\S+)
Value METRIC (\S+)
Value LOCAL_PREF (\S+)
Value WEIGHT (\S+)
Value AS_PATH (.*?)
Value ORIGIN ([ie\?])

Start
  # Since using mostly position, play it safe and ensure we see header first
  ^AS Path Attributes.+ -> Bgp_table

Bgp_table
  # Example:
  # *     0.0.0.0/0           100.100.10.226   0       350     0       65000 65000 65000 64810 64800 i
  ^\s${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s+${NETWORK}\s+${NEXT_HOP}\s+${METRIC}\s+${LOCAL_PREF}\s+${WEIGHT}\s+${AS_PATH}\s+${ORIGIN}$$ -> Record

EOF
SAMPLE COMMAND OUTPUT

SUMMARY

Bug in show ip bgp textfsm template under very specific conditions (listed below).

BGP table entry that has a prefix with a next-hop length of more than 14 characters AND does NOT have a metric.

STEPS TO REPRODUCE
EXPECTED RESULTS
as_path: '65555 65554 65553'
local_pref: '100'
metric: ''
network: 0.0.0.0/0
next_hop: 10.255.255.254
origin: i
path_selection: ' '
route_source: l
status: ' '
weight: '0'
ACTUAL RESULTS
as_path: '65554 65553'
local_pref: '0'
metric: '100'
network: 0.0.0.0/0
next_hop: 10.255.255.254
origin: i
path_selection: ' '
route_source: l
status: ' '
weight: '65555'

chuckysap avatar Mar 13 '23 21:03 chuckysap

@chuckysap I'm a community member volunteering to work on a solution for this. In order to solve for this specific condition, I need you to please provide sample output from the CLI (please include any sort of headers, but otherwise can be truncated to just the problematic BGP entry).

Thank you!

mjbear avatar Jan 07 '24 17:01 mjbear

@chuckysap - Would you please provide sample output? Thank you!

mjbear avatar Feb 27 '24 11:02 mjbear

@chuckysap can you assist?

ryanmerolle avatar Jun 19 '24 03:06 ryanmerolle

@chuckysap Would you be able to provide sample raw output?

This would be far better than me incorrectly attempt to artificially mock the output. Or attempting to mock lab the "very specific [BGP] condition".

Thank you!

mjbear avatar Jul 15 '24 01:07 mjbear

This should have been fixed by https://github.com/networktocode/ntc-templates/pull/1383/files

jmcgill298 avatar Jul 16 '24 12:07 jmcgill298