Skip to content

Commit

Permalink
Merge pull request #1442 from PavloSkliarenko/cisco_ios_show_ip_bgp_s…
Browse files Browse the repository at this point in the history
…ummary

Cisco ios show ip bgp summary
  • Loading branch information
pszulczewski authored Apr 8, 2024
2 parents 615b8d8 + 597f742 commit de85102
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 63 deletions.
20 changes: 13 additions & 7 deletions ntc_templates/templates/cisco_ios_show_ip_bgp_summary.textfsm
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
Value Filldown,Required ROUTER_ID ([0-9a-f:\.]+)
Value Filldown LOCAL_AS (\d+(\.\d+)?)
Value Filldown ADDR_FAMILY (.+?)
Value BGP_NEIGH (\d+?\.\d+?\.\d+?\.\d+?)
Value NEIGH_AS (\d+)
Value Filldown ADDRESS_FAMILY (.+?)
Value BGP_NEIGHBOR (\d+?\.\d+?\.\d+?\.\d+?)
Value BGP_VERSION (\d+)
Value NEIGHBOR_AS (\d+)
Value MESSAGES_RECEIVED (\d+)
Value MESSAGES_SENT (\d+)
Value TABLE_VERSION (\d+)
Value INPUT_QUEUE (\d+)
Value OUTPUT_QUEUE (\d+)
Value UP_DOWN (\S+?)
Value STATE_PFXRCD (\S+?\s+\S+?|\S+?)
Value STATE_OR_PREFIXES_RECEIVED (\S+?\s+\S+?|\S+?)

Start
^For\s+address\s+family:\s+${ADDR_FAMILY}$$
^For\s+address\s+family:\s+${ADDRESS_FAMILY}$$
^BGP\s+router\s+identifier\s+${ROUTER_ID},\s+local\s+AS\s+number\s+${LOCAL_AS}\s*$$
^${BGP_NEIGH}\s+\S+\s+${NEIGH_AS}(\s+\d+?){5}\s+${UP_DOWN}\s+${STATE_PFXRCD}\s*$$ -> Record
^${BGP_NEIGHBOR}\s+${BGP_VERSION}\s+${NEIGHBOR_AS}\s+${MESSAGES_RECEIVED}\s+${MESSAGES_SENT}\s+${TABLE_VERSION}\s+${INPUT_QUEUE}\s+${OUTPUT_QUEUE}\s+${UP_DOWN}\s+${STATE_OR_PREFIXES_RECEIVED}\s*$$ -> Record
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is

EOF
EOF
140 changes: 100 additions & 40 deletions tests/cisco_ios/show_ip_bgp_summary/cisco_ios_show_ip_bgp_summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,131 @@
parsed_sample:
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.1"
neigh_as: "65000"
address_family: ""
bgp_neighbor: "10.0.0.1"
bgp_version: "4"
neighbor_as: "65000"
messages_received: "2746767"
messages_sent: "2396274"
table_version: "512185206"
input_queue: "0"
output_queue: "0"
up_down: "3w0d"
state_pfxrcd: "558720"
state_or_prefixes_received: "558720"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.2"
neigh_as: "65001"
address_family: ""
bgp_neighbor: "10.0.0.2"
bgp_version: "4"
neighbor_as: "65001"
messages_received: "2855873"
messages_sent: "2409742"
table_version: "512185206"
input_queue: "0"
output_queue: "0"
up_down: "3w0d"
state_pfxrcd: "558720"
state_or_prefixes_received: "558720"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.3"
neigh_as: "65002"
address_family: ""
bgp_neighbor: "10.0.0.3"
bgp_version: "4"
neighbor_as: "65002"
messages_received: "695143"
messages_sent: "689871"
table_version: "512185203"
input_queue: "0"
output_queue: "0"
up_down: "1y10w"
state_pfxrcd: "0"
state_or_prefixes_received: "0"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.4"
neigh_as: "65003"
address_family: ""
bgp_neighbor: "10.0.0.4"
bgp_version: "4"
neighbor_as: "65003"
messages_received: "1030294"
messages_sent: "1220041"
table_version: "512185206"
input_queue: "0"
output_queue: "0"
up_down: "1y50w"
state_pfxrcd: "1351"
state_or_prefixes_received: "1351"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.5"
neigh_as: "65004"
address_family: ""
bgp_neighbor: "10.0.0.5"
bgp_version: "4"
neighbor_as: "65004"
messages_received: "26552304"
messages_sent: "14931352"
table_version: "512185206"
input_queue: "0"
output_queue: "0"
up_down: "19w5d"
state_pfxrcd: "558720"
state_or_prefixes_received: "558720"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.6"
neigh_as: "65005"
address_family: ""
bgp_neighbor: "10.0.0.6"
bgp_version: "4"
neighbor_as: "65005"
messages_received: "26532908"
messages_sent: "14931123"
table_version: "512185206"
input_queue: "0"
output_queue: "0"
up_down: "19w5d"
state_pfxrcd: "558720"
state_or_prefixes_received: "558720"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.7"
neigh_as: "65006"
address_family: ""
bgp_neighbor: "10.0.0.7"
bgp_version: "4"
neighbor_as: "65006"
messages_received: "12245684"
messages_sent: "9181569"
table_version: "512185203"
input_queue: "0"
output_queue: "0"
up_down: "1y10w"
state_pfxrcd: "82"
state_or_prefixes_received: "82"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.8"
neigh_as: "65007"
address_family: ""
bgp_neighbor: "10.0.0.8"
bgp_version: "4"
neighbor_as: "65007"
messages_received: "12250936"
messages_sent: "9181571"
table_version: "512185203"
input_queue: "0"
output_queue: "0"
up_down: "1y10w"
state_pfxrcd: "82"
state_or_prefixes_received: "82"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.9"
neigh_as: "65008"
address_family: ""
bgp_neighbor: "10.0.0.9"
bgp_version: "4"
neighbor_as: "65008"
messages_received: "222146"
messages_sent: "14368489"
table_version: "512185203"
input_queue: "0"
output_queue: "0"
up_down: "22w0d"
state_pfxrcd: "0"
state_or_prefixes_received: "0"
- router_id: "10.0.0.0"
local_as: "65000"
addr_family: ""
bgp_neigh: "10.0.0.10"
neigh_as: "65009"
address_family: ""
bgp_neighbor: "10.0.0.10"
bgp_version: "4"
neighbor_as: "65009"
messages_received: "26930508"
messages_sent: "942614"
table_version: "512185203"
input_queue: "0"
output_queue: "0"
up_down: "1y10w"
state_pfxrcd: "Idle (Admin)"
state_or_prefixes_received: "Idle (Admin)"
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,40 @@
parsed_sample:
- router_id: "1.1.1.1"
local_as: "65000"
addr_family: "IPv4 Unicast"
bgp_neigh: "10.0.14.4"
neigh_as: "65001"
address_family: "IPv4 Unicast"
bgp_neighbor: "10.0.14.4"
bgp_version: "4"
neighbor_as: "65001"
messages_received: "26"
messages_sent: "27"
table_version: "9"
input_queue: "0"
output_queue: "0"
up_down: "00:20:06"
state_pfxrcd: "7"
state_or_prefixes_received: "7"
- router_id: "2.2.2.2"
local_as: "65010"
addr_family: "VPNv4 Unicast"
bgp_neigh: "10.10.13.3"
neigh_as: "65001"
address_family: "VPNv4 Unicast"
bgp_neighbor: "10.10.13.3"
bgp_version: "4"
neighbor_as: "65001"
messages_received: "48"
messages_sent: "48"
table_version: "17"
input_queue: "0"
output_queue: "0"
up_down: "00:40:00"
state_pfxrcd: "5"
state_or_prefixes_received: "5"
- router_id: "2.2.2.2"
local_as: "65010"
addr_family: "VPNv4 Unicast"
bgp_neigh: "10.10.14.4"
neigh_as: "65001"
address_family: "VPNv4 Unicast"
bgp_neighbor: "10.10.14.4"
bgp_version: "4"
neighbor_as: "65001"
messages_received: "0"
messages_sent: "0"
table_version: "1"
input_queue: "0"
output_queue: "0"
up_down: "never"
state_pfxrcd: "Idle"
state_or_prefixes_received: "Idle"
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
parsed_sample:
- router_id: "10.12.0.10"
local_as: "64000.2017"
addr_family: ""
bgp_neigh: "10.20.30.40"
neigh_as: "1234"
address_family: ""
bgp_neighbor: "10.20.30.40"
bgp_version: "4"
neighbor_as: "1234"
messages_received: "511374"
messages_sent: "421210"
table_version: "79022"
input_queue: "0"
output_queue: "0"
up_down: "4w0d"
state_pfxrcd: "6063"
state_or_prefixes_received: "6063"

0 comments on commit de85102

Please sign in to comment.