networktocode/ntc-templates

Cisco NXOS show bgp vrf all ipv4 unicast doesn't support unconfigured vrf

Closed this issue · 1 comments

ISSUE TYPE
  • Template Issue with error and raw data
TEMPLATE USING
# Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Value STATUS ([sxSdh*])
# ? \| multipath
Value PATH_SELECTION ([> |])
# Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Value ROUTE_SOURCE ([ieclarI])
Value Filldown NETWORK ([A-Fa-f0-9:\.]+\/\d+)
Value NEXT_HOP ([A-Fa-f0-9:\.]+)
Value METRIC (\d+)
Value LOCAL_PREF (\d+)
Value WEIGHT (\d+)
Value AS_PATH ((\d+|\{\d+)(\.\d+?|\s.*?)*)
# Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup
Value ORIGIN ([ie\?\|&])


Start
  ^Peer\s+
  ^BGP\s+(routing|table)\s 
  ^Status:
  ^Path type:
  ^Origin codes:
  ^\s*Network\s+Next Hop\s+Metric\s+LocPrf\s+Weight\s+Path -> Bgp_table
  ^. -> Error

Bgp_table
  #
  # Match first when there is no network, since previous line had it already (compliment and filldown below)
  # Older table format, with blank values parsing not reliable. (cisco_nxos_show_ip_bgp.raw)
  #             Network            Next Hop            Metric     LocPrf     Weight Path
  # Example: *>e10.10.101.4/30     10.10.2.1                                      0 64102 i
  # Example: *>e                   10.10.1.1                                      0 64101 64002 i
  ^${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}${NETWORK}(\s{0,12}${NEXT_HOP}\s{4}|\s{20})(\s{2,14}${METRIC}|\s{8})(\s{1,18}${LOCAL_PREF}|\s{8})(\s{1,22}${WEIGHT})(\s${AS_PATH})?\s${ORIGIN}$$ -> Record
  ^${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s\s\s{16}(\s{0,12}${NEXT_HOP}\s{4}|\s{20})(\s{2,14}${METRIC}|\s{8})(\s{1,18}${LOCAL_PREF}|\s{8})(\s{1,22}${WEIGHT})(\s${AS_PATH})?\s${ORIGIN}$$ -> Record
  #
  # Match newer format (cisco_nxos_show_ip_bgp1.raw)
  # Example: * e0.0.0.0/0 1.2.3.4 4294967295 0 12345.102 
  ^${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}${NETWORK}\s${NEXT_HOP}\s${METRIC}\s${LOCAL_PREF}\s${WEIGHT}(\s${AS_PATH})?\s${ORIGIN}$$ -> Record
  ^${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s${NEXT_HOP}\s${METRIC}\s${LOCAL_PREF}\s${WEIGHT}(\s${AS_PATH})?\s${ORIGIN}$$ -> Record
  ^. -> Error

EOF
SAMPLE COMMAND OUTPUT
device1# show bgp vrf all ipv4 unicast neighbor 10.1.1.1 routes
Can't find neighbor 10.1.1.1 in VRF TEST_1

Peer 10.1.1.1 routes for address family IPv4 Unicast:
BGP table version is 401423, Local Router ID is 10.10.10.10
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2

   Network            Next Hop            Metric     LocPrf     Weight Path
*>e10.20.20.0/27     10.1.1.1                      5000          0 100 200 i
SUMMARY

On the first line the device is displaying Can't find neighbor 10.1.1.1 in VRF TEST_1. The template does not accommodate for this.

STEPS TO REPRODUCE

Run the template with an output as described above.

EXPECTED RESULTS

Template to parse.

ACTUAL RESULTS

Template doesn't parse.

Will raise a fix for this myself.