From 56f2560089fa8d38f07c07075d77ae8aa20c2cb5 Mon Sep 17 00:00:00 2001 From: Micheal Asik <37921102+asik8888@users.noreply.github.com> Date: Tue, 29 Oct 2024 08:24:13 -0500 Subject: [PATCH] FIX: Account for additional lines in cisco_nxos_bgp_summary (#1877) Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com> --- .../cisco_nxos_show_ip_bgp_summary.textfsm | 10 +- .../cisco_nxos_show_ip_bgp_summary2.raw | 26 +++++ .../cisco_nxos_show_ip_bgp_summary2.yml | 101 ++++++++++++++++++ 3 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.raw create mode 100644 tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.yml diff --git a/ntc_templates/templates/cisco_nxos_show_ip_bgp_summary.textfsm b/ntc_templates/templates/cisco_nxos_show_ip_bgp_summary.textfsm index b5873c3139..3963c3f04c 100644 --- a/ntc_templates/templates/cisco_nxos_show_ip_bgp_summary.textfsm +++ b/ntc_templates/templates/cisco_nxos_show_ip_bgp_summary.textfsm @@ -17,10 +17,14 @@ Start ^${BGP_NEIGH}\s+\d+\s+${NEIGH_AS}\s+${MSG_RCVD}\s+${MSG_SENT}\s+\d+\s+${IN_QUEUE}\s+${OUT_QUEUE}\s+${UP_DOWN}\s+${STATE_PFXRCD}\s*$$ -> Record ^${BGP_NEIGH}\s+\d+\s+${NEIGH_AS} ^\s+${MSG_RCVD}\s+${MSG_SENT}\s+\d+\s+${IN_QUEUE}\s+${OUT_QUEUE}\s+${UP_DOWN}\s+${STATE_PFXRCD}\s*$$ -> Record + # ignoring all lines ending in bytes of memory + ^.*\s+bytes\s+of\s+memory ^BGP\s+table\s+version ^\d+\s+network\s+entries - ^BGP attribute entries - ^BGP community entries + ^BGP\s+attribute\s+entries + ^BGP\s+community\s+entries ^\d+\s+(received|identical) + ^BGP\s+activity + ^\d+\s+networks\s+peaked\s+at ^\s*$$ - ^. -> Error + ^. -> Error \ No newline at end of file diff --git a/tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.raw b/tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.raw new file mode 100644 index 0000000000..bc1e76c2df --- /dev/null +++ b/tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.raw @@ -0,0 +1,26 @@ +BGP router identifier 10.0.0.1, local AS number 6230 +BGP table version is 39619, main routing table version 39619 +972 network entries using 241056 bytes of memory +2762 path entries using 375632 bytes of memory +124/52 BGP path/bestpath attribute entries using 34720 bytes of memory +48 BGP AS-PATH entries using 1888 bytes of memory +4 BGP community entries using 144 bytes of memory +1 BGP extended community entries using 24 bytes of memory +0 BGP route-map cache entries using 0 bytes of memory +0 BGP filter-list cache entries using 0 bytes of memory +BGP using 653464 total bytes of memory +905 received paths for inbound soft reconfiguration +BGP attribute entries [9/3240], BGP AS path entries [1/6] +BGP community entries [0/0], BGP clusterlist entries [0/0] +BGP activity 2303/1331 prefixes, 43670/40908 paths, scan interval 60 secs + +Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd +10.0.0.81 4 132 0 0 1 0 0 never Idle (Admin) +10.0.0.66 4 6230 363273 392165 39619 0 0 6w1d 9 +10.0.0.67 4 6230 363277 392110 39619 0 0 6w1d 9 +10.0.0.74 4 6230 363274 392168 39619 0 0 6w1d 10 +10.0.0.75 4 6230 363277 392137 39619 0 0 6w1d 10 +10.0.0.82 4 6230 363272 392239 39619 0 0 6w1d 2 +10.0.0.83 4 6230 363274 392149 39619 0 0 6w1d 2 +10.0.0.90 4 6230 363272 392205 39619 0 0 6w1d 1 +10.0.0.91 4 6230 363274 392176 39619 0 0 6w1d 1 diff --git a/tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.yml b/tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.yml new file mode 100644 index 0000000000..3393c5ed41 --- /dev/null +++ b/tests/cisco_nxos/show_ip_bgp_summary/cisco_nxos_show_ip_bgp_summary2.yml @@ -0,0 +1,101 @@ +--- +parsed_sample: + - bgp_neigh: "10.0.0.81" + in_queue: "0" + local_as: "6230" + msg_rcvd: "0" + msg_sent: "0" + neigh_as: "132" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "Idle (Admin)" + up_down: "never" + vrf: "" + - bgp_neigh: "10.0.0.66" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363273" + msg_sent: "392165" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "9" + up_down: "6w1d" + vrf: "" + - bgp_neigh: "10.0.0.67" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363277" + msg_sent: "392110" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "9" + up_down: "6w1d" + vrf: "" + - bgp_neigh: "10.0.0.74" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363274" + msg_sent: "392168" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "10" + up_down: "6w1d" + vrf: "" + - bgp_neigh: "10.0.0.75" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363277" + msg_sent: "392137" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "10" + up_down: "6w1d" + vrf: "" + - bgp_neigh: "10.0.0.82" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363272" + msg_sent: "392239" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "2" + up_down: "6w1d" + vrf: "" + - bgp_neigh: "10.0.0.83" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363274" + msg_sent: "392149" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "2" + up_down: "6w1d" + vrf: "" + - bgp_neigh: "10.0.0.90" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363272" + msg_sent: "392205" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "1" + up_down: "6w1d" + vrf: "" + - bgp_neigh: "10.0.0.91" + in_queue: "0" + local_as: "6230" + msg_rcvd: "363274" + msg_sent: "392176" + neigh_as: "6230" + out_queue: "0" + router_id: "10.0.0.1" + state_pfxrcd: "1" + up_down: "6w1d" + vrf: ""