ntc-templates
ntc-templates copied to clipboard
cisco_nxos_show_ip_bgp output misaligns for next-hop length >= 14 characters and no metric
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 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!
@chuckysap - Would you please provide sample output? Thank you!
@chuckysap can you assist?
@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!
This should have been fixed by https://github.com/networktocode/ntc-templates/pull/1383/files