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

Fixed techsupport failure in generate_dump 'show bgp neighbors' #2742

Open
wants to merge 1 commit into
base: 202012
Choose a base branch
from

Conversation

saurabh17g
Copy link
Contributor

What I did

Resolved Techsupport failure upon generate_dump (techsupport gives rc = 1) execution for 'show bgp ipv6 neighbors' and 'show ip bgp neighbors' cli.

How I did it

fgrep returned non 0 RC in case bgp neighbors are not configured or link down/config abscent on peer etc. This results in script failure. So, I replaced fgrep with awk. This returns rc = 0 even when we dont have any results in filter.
In case of ipv4 (show ip bgp neighbors), it is observed that cli also gives v6 peers. Consequently neighbor_list_v4 has v4 and v6 peers. This generates 2 sets of files in techsupport (1 set for v4 and other for v6). however v6 neighbors do not have routes and are empty files. So I added extra filtering here using awk and neighbor_list_v4 will only have v4 neighbors.
How to verify it
case 1 : setup having route. Verified my script does not result any errors by rc checking.
I also checked techsuppport dump and observed no non 0 rc and no files with empty routes.
case 2 : setup not having neigbor/routes. Ensured rc is always 0.

How to verify it

show techsupport -r --since '5 minute ago' -> echo $? gives 1

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

show techsupport -r --since '5 minute ago' -> echo $? gives 0

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

…ing to get only v4 peers in case of show ip bgp neighbors
@linux-foundation-easycla
Copy link

CLA Not Signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants