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

[show][interfaces] Add proposal for show interfaces flap #3627

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Nov 22, 2024

The show interfaces flap command provides detailed insights into interface events, including the timestamp of the last link down event and the total flap count (number of times the link has gone up and down). This helps in diagnosing stability and connectivity issues.

What I did

How I did it

How to verify it

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: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 changed the title [show][interfaces] Add proposal for show interfaces history [show][interfaces] Add proposal for show interfaces flap Nov 22, 2024
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
- Example:
```
admin@sonic:~$ show interfaces flap
Interface Last Link Down Flap Count
Copy link
Contributor

@qinchuanares qinchuanares Nov 22, 2024

Choose a reason for hiding this comment

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

Could we show interface current admin and oper status in an additional column?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add

- Example:
```
admin@sonic:~$ show interfaces flap
Interface Last Link Down Flap Count
Copy link
Contributor

Choose a reason for hiding this comment

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

Will last link down time stamp be a bit ambiguous? since we don't know when is the counter be calculated without start point, and down time will not show gap between down to up.

Below is some sample from Junos cli maybe referenced:

Physical interface: ge-0/0/1, Enabled, Physical link is Up
Interface index: 137, SNMP ifIndex: 515
...
Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps, Loopback: Disabled,
...
Last flapped : 2022-10-01 10:00:00 UTC (00:01:23 ago)
Statistics last cleared: Never
Traffic statistics:
Input bytes : 1234567890
Output bytes : 9876543210
Input packets: 12345
Output packets: 54321
...
Input errors: 0, Output errors: 0, Input drops: 0, Output drops: 0
...
Protocol eth-switch, MTU: 1514
Flags: None
...
Link is Up
Interface has been up 5 days, 2 hours, 30 minutes, 15 seconds
...
Last flap event: None
Flap statistics:
Since 2022-09-01 00:00:00 UTC
Link flaps: 2
Up transitions: 3
Down transitions: 2

Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 can you check if we can show the number of up and down events separately? if not we can take that has next enhancement.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 can

  1. Link down timestamp as "Last flapped : 2024-10-01 10:00:00 UTC (0 days 00:01:23 ago)
  2. Link up timestamp as "Last Link up: 2024-10-05 10:01:03 UTC (5 days 02:30 :15 ago)

Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 you can specify the column for timestamp (UTC).

Copy link
Contributor Author

@vdahiya12 vdahiya12 Dec 2, 2024

Choose a reason for hiding this comment

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

I did not understand the logic here, do we want one or two columns? If we say just one column then how will both last flap and last link up be supported.
Also if we support both, the first time switch boots up and the link never comes up, then last link down should be boot time ? and last link up be never ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this what is expected ?

admin@sonic:~$ show interfaces flap
Interface       Link Down TimeStamp (UTC)                                      Link Up TimeStamp (UTC)                                       Flap Count  
---------       -------------------------------------------------------        -----------------------------------------------------------   ----------
Ethernet0       Last flapped : 2024-10-01 10:00:00 (0 days 00:01:23 ago)       Last Link up: 2024-09-30 10:01:03 UTC (1 days 02:30 :15 ago)  5
Ethernet4       Never                                                          Last Link up: 2024-09-30 10:01:03 UTC (1 days 02:30 :15 ago)  Never
Ethernet8       Last flapped : 2024-10-01 10:01:00 (0 days 00:00:23 ago)       Last Link up: 2024-10-02 10:01:03 UTC (5 days 02:30 :15 ago)  1

@prgeor
Copy link
Contributor

prgeor commented Dec 2, 2024

@vdahiya12 If the link down count = 0 or the link up count = 0 then the timestamp should show "never". can you capture these?

--------- ------------------- ----------
Ethernet0 2024-11-21 14:32:12 5
Ethernet4 2024-11-20 08:15:04 2
Ethernet8 2024-11-19 23:45:16 8
Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 show one example where link never flapped

Copy link
Contributor

@prgeor prgeor left a comment

Choose a reason for hiding this comment

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

@vdahiya12 can you address comments please

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.

4 participants