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

[muxcable][show] enhance show mux status to show last switchover time #2067

Merged
merged 2 commits into from
Mar 2, 2022

Conversation

zjswhhh
Copy link
Contributor

@zjswhhh zjswhhh commented Feb 15, 2022

What I did

Enhance show muxcable status to show last switchover time as well

sign-off: Jing Zhang zhangjing@microsoft.com

How I did it

How to verify it

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

~$ show mux status 
PORT         STATUS    HEALTH
-----------  --------  ---------
Ethernet0    standby   unhealthy
Ethernet4    standby   unhealthy
Ethernet8    standby   unhealthy
Ethernet12   standby   unhealthy
Ethernet16   standby   unhealthy
Ethernet20   standby   unhealthy
Ethernet40   standby   unhealthy
Ethernet44   standby   unhealthy
Ethernet48   standby   unhealthy
Ethernet52   standby   unhealthy
Ethernet56   standby   unhealthy
Ethernet60   standby   unhealthy
Ethernet64   standby   unhealthy
Ethernet68   standby   unhealthy
Ethernet72   standby   unhealthy
Ethernet76   standby   unhealthy
Ethernet80   standby   unhealthy
Ethernet84   standby   unhealthy
Ethernet104  standby   unhealthy
Ethernet108  standby   unhealthy
Ethernet112  standby   unhealthy
Ethernet116  standby   unhealthy
Ethernet120  standby   unhealthy
Ethernet124  standby   unhealthy

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

~$ show mux status
PORT         STATUS    HEALTH     LAST_SWITCHOVER_TIME
-----------  --------  ---------  ---------------------------
Ethernet0    standby   unhealthy  2022-Feb-14 16:47:06.813350
Ethernet4    standby   unhealthy  2022-Feb-14 16:47:07.309137
Ethernet8    standby   unhealthy  2022-Feb-14 16:47:07.373696
Ethernet12   standby   unhealthy  2022-Feb-14 16:47:06.430575
Ethernet16   standby   unhealthy  2022-Feb-14 16:47:08.131454
Ethernet20   standby   unhealthy  2022-Feb-14 16:47:07.180982
Ethernet40   standby   unhealthy  2022-Feb-14 16:47:07.335020
Ethernet44   standby   unhealthy  2022-Feb-14 16:47:07.222463
Ethernet48   standby   unhealthy  2022-Feb-14 16:47:07.354632
Ethernet52   standby   unhealthy  2022-Feb-14 16:47:06.826954
Ethernet56   standby   unhealthy  2022-Feb-14 16:47:07.230414
Ethernet60   standby   unhealthy  2022-Feb-14 16:47:07.235581
Ethernet64   standby   unhealthy  2022-Feb-14 16:47:07.315676
Ethernet68   standby   unhealthy  2022-Feb-14 16:47:08.544206
Ethernet72   standby   unhealthy  2022-Feb-14 16:47:07.325918
Ethernet76   standby   unhealthy  2022-Feb-14 16:47:07.368308
Ethernet80   standby   unhealthy  2022-Feb-14 16:47:08.534758
Ethernet84   standby   unhealthy  2022-Feb-14 16:47:07.824009
Ethernet104  standby   unhealthy  2022-Feb-14 16:47:06.814654
Ethernet108  standby   unhealthy  2022-Feb-14 16:47:07.340556
Ethernet112  standby   unhealthy  2022-Feb-14 16:47:07.361900
Ethernet116  standby   unhealthy  2022-Feb-14 16:47:06.820994
Ethernet120  standby   unhealthy  2022-Feb-14 16:47:07.177181
Ethernet124  standby   unhealthy  2022-Feb-14 16:47:06.837251

wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Feb 24, 2022
What is the motivation for this PR?
Stemming from
sonic-net/sonic-utilities#1961
sonic-net/sonic-utilities#2067

New columns are added to show muxcable status outputp. Update show_cable_status to use --json to avoid parsing error.

Checked other usage of show muxcable status in sonic-mgmt, it's either using --json already, or for logging, or the current parse approach is compatible.

How did you do it?
Update show_cable_status to use --json to avoid parsing error.
@zjswhhh
Copy link
Contributor Author

zjswhhh commented Feb 25, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zjswhhh zjswhhh merged commit f872516 into sonic-net:master Mar 2, 2022
@zjswhhh zjswhhh deleted the showMuxStatusMaster branch March 2, 2022 21:16
qiluo-msft pushed a commit that referenced this pull request Mar 4, 2022
…#2067)

#### What I did
 
Enhance ```show muxcable status``` to show last switchover time as well

sign-off: Jing Zhang zhangjing@microsoft.com

#### Previous command output 
```
~$ show mux status 
PORT         STATUS    HEALTH
-----------  --------  ---------
Ethernet0    standby   unhealthy
Ethernet4    standby   unhealthy
Ethernet8    standby   unhealthy
Ethernet12   standby   unhealthy
Ethernet16   standby   unhealthy
Ethernet20   standby   unhealthy
Ethernet40   standby   unhealthy
Ethernet44   standby   unhealthy
Ethernet48   standby   unhealthy
Ethernet52   standby   unhealthy
Ethernet56   standby   unhealthy
Ethernet60   standby   unhealthy
Ethernet64   standby   unhealthy
Ethernet68   standby   unhealthy
Ethernet72   standby   unhealthy
Ethernet76   standby   unhealthy
Ethernet80   standby   unhealthy
Ethernet84   standby   unhealthy
Ethernet104  standby   unhealthy
Ethernet108  standby   unhealthy
Ethernet112  standby   unhealthy
Ethernet116  standby   unhealthy
Ethernet120  standby   unhealthy
Ethernet124  standby   unhealthy
```
#### New command output 
```
~$ show mux status
PORT         STATUS    HEALTH     LAST_SWITCHOVER_TIME
-----------  --------  ---------  ---------------------------
Ethernet0    standby   unhealthy  2022-Feb-14 16:47:06.813350
Ethernet4    standby   unhealthy  2022-Feb-14 16:47:07.309137
Ethernet8    standby   unhealthy  2022-Feb-14 16:47:07.373696
Ethernet12   standby   unhealthy  2022-Feb-14 16:47:06.430575
Ethernet16   standby   unhealthy  2022-Feb-14 16:47:08.131454
Ethernet20   standby   unhealthy  2022-Feb-14 16:47:07.180982
Ethernet40   standby   unhealthy  2022-Feb-14 16:47:07.335020
Ethernet44   standby   unhealthy  2022-Feb-14 16:47:07.222463
Ethernet48   standby   unhealthy  2022-Feb-14 16:47:07.354632
Ethernet52   standby   unhealthy  2022-Feb-14 16:47:06.826954
Ethernet56   standby   unhealthy  2022-Feb-14 16:47:07.230414
Ethernet60   standby   unhealthy  2022-Feb-14 16:47:07.235581
Ethernet64   standby   unhealthy  2022-Feb-14 16:47:07.315676
Ethernet68   standby   unhealthy  2022-Feb-14 16:47:08.544206
Ethernet72   standby   unhealthy  2022-Feb-14 16:47:07.325918
Ethernet76   standby   unhealthy  2022-Feb-14 16:47:07.368308
Ethernet80   standby   unhealthy  2022-Feb-14 16:47:08.534758
Ethernet84   standby   unhealthy  2022-Feb-14 16:47:07.824009
Ethernet104  standby   unhealthy  2022-Feb-14 16:47:06.814654
Ethernet108  standby   unhealthy  2022-Feb-14 16:47:07.340556
Ethernet112  standby   unhealthy  2022-Feb-14 16:47:07.361900
Ethernet116  standby   unhealthy  2022-Feb-14 16:47:06.820994
Ethernet120  standby   unhealthy  2022-Feb-14 16:47:07.177181
Ethernet124  standby   unhealthy  2022-Feb-14 16:47:06.837251
```
liat-grozovik pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 16, 2022
Advance sonic-utilities submodule to include the following changes

98de850 [muxcable][show] enhance show mux status to show last switchover time sonic-net/sonic-utilities#2067
3da82d1 [show][muxcable] fix the sudo access error for show muxcable metrics sonic-net/sonic-utilities#2083
7acbadb [build] stop vstest in the Azure pipeline sonic-net/sonic-utilities#2098
3fed440 [show][config] add muxcable command line support for retrieve / reset ICMP packet loss data sonic-net/sonic-utilities#2094
aa21e3a [202012] [counterpoll] Display the correct default poll interval for watermark counters sonic-net/sonic-utilities#2091

Signed-off-by: Neetha John <nejo@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