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

[sonic-utilities] : Refactoring interfaces status to interfaces status brief/details #552

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

Conversation

prprakas
Copy link
Contributor

Following features are added as the part of this PR-

  1. Show number of flap counts
  2. Show last flap time stamp
  3. Clear the flap counts using sudo sonic-clear counters
  4. When interface name was given with show interface status command it was failing, fixed it as the part of this PR.
  5. Refactored show interface status to show interface status brief and show interface status details, where optic details and flap details will be available in details option only.
  6. Backend changes for this are included in [sonic-swss]: Added flap counter and last flap time functionality. sonic-swss#928

Signed-off-by: Prem Prakash prprakash@linkedin.com

- What I did
Refactored show interfaces status to show interfaces status brief/details with other enhancements like flap counter and last flap time and clearing flap counter.

- How to verify it
After the code changes python-sonic-utilities debian package had to be built, copied it on the switch and installed (along with this had to install the docker-orchagent.gz to test the functionality of flap counter and last flap time)

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

Previous Output-

admin@lnos-x1-a-fab01:~$ show interfaces status
Interface Lanes Speed MTU Alias Vlan Oper Admin Type Asym PFC


Ethernet0 65,66,67,68 100G 9100 Eth1 routed up up QSFP28 or later N/A
Ethernet4 69,70,71,72 100G 9100 Eth2 routed up up N/A N/A

per interface-

admin@lnos-x1-a-fab01:$ show interfaces status Ethernet4
Traceback (most recent call last):
File "/usr/bin/intfutil", line 424, in
main(sys.argv[1:])
File "/usr/bin/intfutil", line 417, in main
interface_stat = IntfStatus(intf_name)
File "/usr/bin/intfutil", line 337, in init
appl_db_keys = appl_db_keys_get(self.appl_db, self.front_panel_ports_list, intf_name)
File "/usr/bin/intfutil", line 90, in appl_db_keys_get
appl_db_keys = db.keys(appl_db.APPL_DB, "PORT_TABLE:%s" % intf_name)
NameError: global name 'db' is not defined
admin@lnos-x1-a-fab01:
$

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

-->
admin@lnos-x1-a-csw02:~$ show interfaces status
Usage: show interfaces status [OPTIONS] COMMAND [ARGS]...

Show interface status information

Options:
-?, -h, --help Show this message and exit.

Commands:
brief Show Interface status brief information
details Show Interface status details information
admin@lnos-x1-a-csw02:~$

admin@lnos-x1-a-csw02:~$ show interfaces status bri
Last cached time was 2019-06-12 09:06:58.306766
Interface Lanes Speed MTU Alias Vlan Oper Admin


Ethernet0 65,66,67,68 100G 9100 Eth1 routed down up
Ethernet4 69,70,71,72 100G 9100 Eth2 routed up up

admin@lnos-x1-a-csw02:~$ show interfaces status bri Ethernet4
Last cached time was 2019-06-12 09:06:58.306766
Interface Lanes Speed MTU Alias Vlan Oper Admin


Ethernet4 69,70,71,72 100G 9100 Eth2 routed up up
admin@lnos-x1-a-csw02:~$

admin@lnos-x1-a-csw02:~$ show interfaces status details
Last cached time was 2019-06-12 09:06:58.306766
Interface Lanes Speed MTU Alias Vlan Oper Admin Type Asym PFC Flaps Last Flap (in UTC)


Ethernet0 65,66,67,68 100G 9100 Eth1 routed down up QSFP28 or later N/A 0 N/A
Ethernet4 69,70,71,72 100G 9100 Eth2 routed up up QSFP28 or later N/A 0 Wed Jun 12 06:46:18 2019

admin@lnos-x1-a-csw02:~$ show interfaces status details Ethernet4
Last cached time was 2019-06-12 09:06:58.306766
Interface Lanes Speed MTU Alias Vlan Oper Admin Type Asym PFC Flaps Last Flap (in UTC)


Ethernet4 69,70,71,72 100G 9100 Eth2 routed up up QSFP28 or later N/A 0 Wed Jun 12 06:46:18 2019
admin@lnos-x1-a-csw02:$ sudo config interface shutdown Ethernet4
admin@lnos-x1-a-csw02:
$ show interfaces status details Ethernet4
Last cached time was 2019-06-12 09:06:58.306766
Interface Lanes Speed MTU Alias Vlan Oper Admin Type Asym PFC Flaps Last Flap (in UTC)


Ethernet4 69,70,71,72 100G 9100 Eth2 routed down down QSFP28 or later N/A 1 Wed Jun 12 09:21:45 2019
admin@lnos-x1-a-csw02:$ sudo config interface startup Ethernet4
admin@lnos-x1-a-csw02:
$ show interfaces status details Ethernet4
Last cached time was 2019-06-12 09:06:58.306766
Interface Lanes Speed MTU Alias Vlan Oper Admin Type Asym PFC Flaps Last Flap (in UTC)


Ethernet4 69,70,71,72 100G 9100 Eth2 routed up up QSFP28 or later N/A 2 Wed Jun 12 09:22:01 2019
admin@lnos-x1-a-csw02:~$ sudo sonic-clear counters
Cleared counters

admin@lnos-x1-a-csw02:~$ show interfaces status details Ethernet4
Last cached time was 2019-06-12 09:22:19.263575
Interface Lanes Speed MTU Alias Vlan Oper Admin Type Asym PFC Flaps Last Flap (in UTC)


Ethernet4 69,70,71,72 100G 9100 Eth2 routed up up QSFP28 or later N/A 0 Wed Jun 12 09:22:01 2019
admin@lnos-x1-a-csw02:~$

@stcheng
Copy link
Contributor

stcheng commented Jun 13, 2019

retest this please

1 similar comment
@zhenggen-xu
Copy link
Collaborator

retest this please

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

As part of this PR, please also update the documentation at https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md to reflect these changes.

@prprakas
Copy link
Contributor Author

As part of this PR, please also update the documentation at https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md to reflect these changes.

Updated the PR with documentation.

@prprakas prprakas changed the title [sonic-utilities] : Refactaring interfaces status to interfaces status brief/details [sonic-utilities] : Refactoring interfaces status to interfaces status brief/details Jun 15, 2019
@prprakas
Copy link
Contributor Author

retest this please

5 similar comments
@prprakas
Copy link
Contributor Author

retest this please

@prprakas
Copy link
Contributor Author

retest this please

@prprakas
Copy link
Contributor Author

retest this please

@prprakas
Copy link
Contributor Author

retest this please

@prprakas
Copy link
Contributor Author

retest this please

@prprakas
Copy link
Contributor Author

Retest this please

@prprakas
Copy link
Contributor Author

retest this please

@prprakas
Copy link
Contributor Author

@jleveque @stcheng console output (https://sonic-jenkins.westus2.cloudapp.azure.com/job/common/job/sonic-utilities-build-pr/76/console) says operation not permitted for last 3-4 builds I have tried, is there any issue with the jenkin server ?

@prprakas
Copy link
Contributor Author

retest this please

1 similar comment
@prprakas
Copy link
Contributor Author

retest this please

@prprakas
Copy link
Contributor Author

prprakas commented Jun 26, 2019

@jleveque Please help reviewing the changes. Also the backend changes sonic-net/sonic-swss#928 to reflect it on the show commands

Thanks,
Prem

@jleveque jleveque requested a review from lguohan June 28, 2019 17:59
@prprakas
Copy link
Contributor Author

Any update on this one @lguohan @jleveque how to proceed with this one?

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.

4 participants