From f2cc1c88ccaf092d2e44ab9b8a11f0d5e8427115 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Tue, 1 Dec 2020 00:25:17 +0100 Subject: [PATCH] New template: Vyatta/VyOS BGP summary (#828) --- templates/index | 1 + .../vyatta_vyos_show_ip_bgp_summary.textfsm | 23 ++++++++++++++++ .../vyatta_vyos_show_ip_bgp_summary.raw | 13 ++++++++++ .../vyatta_vyos_show_ip_bgp_summary.yml | 26 +++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 templates/vyatta_vyos_show_ip_bgp_summary.textfsm create mode 100644 tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.raw create mode 100644 tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.yml diff --git a/templates/index b/templates/index index 8460f77632..8e80913455 100644 --- a/templates/index +++ b/templates/index @@ -436,6 +436,7 @@ ubiquiti_edgeswitch_show_arp.textfsm, .*, ubiquiti_edgeswitch, sh[[ow]] ar[[p]] vmware_nsxv_show_ip_bgp_neighbors.textfsm, .*, vmware_nsxv, sh[[ow]] ip b[[gp]] n[[eighbors]] vmware_nsxv_show_ip_route.textfsm, .*, vmware_nsxv, sh[[ow]] ip r[[oute]] +vyatta_vyos_show_ip_bgp_summary.textfsm, .*, .*vyos.*, sh[[ow]] ip bgp sum[[mary]] vyatta_vyos_show_interfaces.textfsm, .*, .*vyos.*, sh[[ow]] int[[erfaces]] vyatta_vyos_show_arp.textfsm, .*, .*vyos.*, sh[[ow]] a[[rp]] diff --git a/templates/vyatta_vyos_show_ip_bgp_summary.textfsm b/templates/vyatta_vyos_show_ip_bgp_summary.textfsm new file mode 100644 index 0000000000..2b2cff42bb --- /dev/null +++ b/templates/vyatta_vyos_show_ip_bgp_summary.textfsm @@ -0,0 +1,23 @@ +Value Filldown ROUTER_ID (\S+) +Value Filldown LOCAL_AS (\d+) +Value BGP_NEIGH (\d+?\.\d+?\.\d+?\.\d+?) +Value NEIGH_AS (\d+) +Value MSG_RCVD (\d+) +Value MSG_SENT (\d+) +Value UP_DOWN (\S+?) +Value STATE_PFXRCD (\S+?\s+\S+?|\S+?) + +Start + ^IPv4\s+Unicast\s+Summary:$$ + ^BGP\s+router\s+identifier\s+${ROUTER_ID},\s+[Ll]ocal\s+[Aa][Ss]\s+number\s+${LOCAL_AS}\s+vrf-id\s+\d+$$ + ^BGP\s+table\s+version\s+\d+$$ + ^RIB\s+entries\s+\d+,\s+using\s+\d+\s+MiB\s+of\s+memory$$ + ^Peers\s+\d+,\s+using\s+\d+\s+KiB\s+of\s+memory$$ + ^Peer\s+groups\s+\d+,\s+using\s+\d+\s+bytes\s+of\s+memory$$ + ^Neighbor\s+V\s+AS\s+MsgRcvd\s+MsgSent\s+TblVer\s+InQ\s+OutQ\s+Up/Down\s+State/PfxRcd$$ + ^${BGP_NEIGH}\s+\S+\s+${NEIGH_AS}\s+${MSG_RCVD}\s+${MSG_SENT}(\s+\d+?){3}\s+${UP_DOWN}\s+${STATE_PFXRCD}\s*$$ -> Record + ^Total\s+number\s+of\s+neighbors\s+\d+$$ + ^\s*$$ + ^. -> Error + +EOF diff --git a/tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.raw b/tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.raw new file mode 100644 index 0000000000..8cb99f2dfa --- /dev/null +++ b/tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.raw @@ -0,0 +1,13 @@ +IPv4 Unicast Summary: +BGP router identifier 10.10.10.1, local AS number 123456 vrf-id 0 +BGP table version 50711224 +RIB entries 1537189, using 270 MiB of memory +Peers 3, using 593 KiB of memory +Peer groups 4, using 256 bytes of memory + +Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd +10.10.10.10 4 1234 71460 69353 0 0 0 5d13h10m 0 +123.123.123.123 4 345612 450590 34688 0 0 0 1d00h18m 0 +193.189.82.105 4 12365 0 0 0 0 0 never Active + +Total number of neighbors 3 diff --git a/tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.yml b/tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.yml new file mode 100644 index 0000000000..fe5b33b6d1 --- /dev/null +++ b/tests/vyatta_vyos/show_ip_bgp_summary/vyatta_vyos_show_ip_bgp_summary.yml @@ -0,0 +1,26 @@ +--- +parsed_sample: + - router_id: "10.10.10.1" + local_as: "123456" + bgp_neigh: "10.10.10.10" + neigh_as: "1234" + msg_rcvd: "71460" + msg_sent: "69353" + up_down: "5d13h10m" + state_pfxrcd: "0" + - router_id: "10.10.10.1" + local_as: "123456" + bgp_neigh: "123.123.123.123" + neigh_as: "345612" + msg_rcvd: "450590" + msg_sent: "34688" + up_down: "1d00h18m" + state_pfxrcd: "0" + - router_id: "10.10.10.1" + local_as: "123456" + bgp_neigh: "193.189.82.105" + neigh_as: "12365" + msg_rcvd: "0" + msg_sent: "0" + up_down: "never" + state_pfxrcd: "Active"