Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use vtysh in the show ip bgp summary command #1137

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

arlakshm
Copy link
Contributor

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan arlakshm@microsoft.com

- What I did
call the vtysh script to get the information from Bgp container, instead of directly executing the docker commands

- How I did it
Modify the run_bgp_command function to call vtysh with correct instance_id and vtysh cmd.
The vtysh script is modified to take the namespace id in this PR sonic-net/sonic-buildimage#5479

- How to verify it

  • On Multi ASIC
    `admin@str-acs-2:~$ show ip bgp summary

IPv4 Unicast Summary:
asic0: BGP router identifier 8.0.0.0, local AS number 65100 vrf-id 0
BGP table version 12826
asic1: BGP router identifier 8.0.0.1, local AS number 65100 vrf-id 0
BGP table version 8913
asic2: BGP router identifier 8.0.0.2, local AS number 65100 vrf-id 0
BGP table version 76
asic3: BGP router identifier 8.0.0.3, local AS number 65100 vrf-id 0
BGP table version 69
RIB entries 25940, using 4772960 bytes of memory
Peers 32, using 669440 KiB of memory
Peer groups 16, using 1024 bytes of memory

Neighbhor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd NeighborName


10.0.0.1 4 65200 87666 88720 0 0 0 2d22h23m 6402 ARISTA01T2
10.0.0.5 4 65200 87669 88719 0 0 0 2d22h23m 6402 ARISTA03T2
10.0.0.9 4 65200 87668 87673 0 0 0 2d22h23m 6402 ARISTA05T2
10.0.0.13 4 65200 87664 87673 0 0 0 2d22h23m 6402 ARISTA07T2
10.0.0.33 4 64001 84472 84506 0 0 0 2d22h23m 6 ARISTA01T0
10.0.0.35 4 64002 84465 84509 0 0 0 2d22h23m 6 ARISTA02T0
10.0.0.37 4 64003 84462 84506 0 0 0 2d22h23m 7 ARISTA03T0
10.0.0.39 4 64004 84474 84509 0 0 0 2d22h23m 6 ARISTA04T0
10.0.0.41 4 64005 84466 84506 0 0 0 2d22h23m 7 ARISTA05T0
10.0.0.43 4 64006 84466 84509 0 0 0 2d22h23m 6 ARISTA06T0
10.0.0.45 4 64007 84462 84509 0 0 0 2d22h23m 6 ARISTA07T0
10.0.0.47 4 64008 84468 84506 0 0 0 2d22h23m 6 ARISTA08T0
10.0.0.49 4 64009 84461 84506 0 0 0 2d22h23m 6 ARISTA09T0
10.0.0.51 4 64010 84464 84509 0 0 0 2d22h23m 6 ARISTA10T0
10.0.0.53 4 64011 84472 84504 0 0 0 2d22h23m 6 ARISTA11T0
10.0.0.55 4 64012 84471 84502 0 0 0 2d22h23m 6 ARISTA12T0
10.0.0.57 4 64013 84471 84501 0 0 0 2d22h23m 6 ARISTA13T0
10.0.0.59 4 64014 84469 84501 0 0 0 2d22h23m 6 ARISTA14T0
10.0.0.61 4 64015 84464 84502 0 0 0 2d22h23m 6 ARISTA15T0
10.0.0.63 4 64016 84467 84504 0 0 0 2d22h23m 6 ARISTA16T0
10.0.0.65 4 64017 84470 84502 0 0 0 2d22h23m 6 ARISTA17T0
10.0.0.67 4 64018 84466 84501 0 0 0 2d22h23m 6 ARISTA18T0
10.0.0.69 4 64019 84465 84502 0 0 0 2d22h23m 6 ARISTA19T0
10.0.0.71 4 64020 0 0 0 0 0 never Active ARISTA20T0

Total number of neighbors 24
admin@str-acs-2:~$ show ip bgp summary -n asic0

IPv4 Unicast Summary:
asic0: BGP router identifier 8.0.0.0, local AS number 65100 vrf-id 0
BGP table version 12826
RIB entries 12833, using 2361272 bytes of memory
Peers 4, using 83680 KiB of memory
Peer groups 4, using 256 bytes of memory

Neighbhor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd NeighborName


10.0.0.1 4 65200 87670 88723 0 0 0 2d22h23m 6402 ARISTA01T2
10.0.0.5 4 65200 87673 88722 0 0 0 2d22h23m 6402 ARISTA03T2

Total number of neighbors 2
admin@str-acs-2:~$ show ip bgp summary -n asic0 -d all

IPv4 Unicast Summary:
asic0: BGP router identifier 8.0.0.0, local AS number 65100 vrf-id 0
BGP table version 12826
RIB entries 12833, using 2361272 bytes of memory
Peers 4, using 83680 KiB of memory
Peer groups 4, using 256 bytes of memory

Neighbhor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd NeighborName


10.0.0.1 4 65200 87672 88726 0 0 0 2d22h23m 6402 ARISTA01T2
10.0.0.5 4 65200 87675 88725 0 0 0 2d22h23m 6402 ARISTA03T2
10.1.0.0 4 65100 6414 3325 0 0 0 2d22h23m 6417 ASIC4
10.1.0.2 4 65100 4056 3211 0 0 0 2d22h23m 6417 ASIC5

Total number of neighbors 4
admin@str-acs-2:~$ `

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arlakshm arlakshm merged commit f692e1e into sonic-net:master Sep 29, 2020
abdosi pushed a commit that referenced this pull request Sep 29, 2020
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>

Modify the run_bgp_command function to call vtysh with correct instance_id and vtysh cmd.
The vtysh script is modified to take the namespace id in this PR sonic-net/sonic-buildimage#5479
@arlakshm arlakshm deleted the show_bgp_fix branch September 29, 2020 19:43
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
[cli][bgp]use vtysh in the show ip bgp summary command (sonic-net#1137)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants