sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[master] [show] Option to add subcommands to show techsupport

Open gvlaemyn opened this issue 1 year ago • 5 comments

What I did

Implement option to add subcommands to "show techsupport", e.g. "show techsupport npu" to have to possibility of restricting the collected data to a subset of the full techsupport data.

How I did it

* replace techsupport click command in show/main.py with click group to support subcommands
* update show/plugins/cisco-8000.py to support vendor specific commands
* subcommand functionality itself (e.g. npu) is implemented in a vendor specific repository and requires no further changes in sonic-utilities

How to verify it

E.g. for the "show techsupport npu" command on a cisco-8000 platform:

  1. Check if the "npu" subcommand is available: root@sonic:~# show techsupport -h Usage: show techsupport [OPTIONS] COMMAND [ARGS]...

Gather information for troubleshooting

Options: --since TEXT Collect logs and core files since given date -g, --global-timeout INTEGER Global timeout in minutes. WARN: Dump might be incomplete if enforced -c, --cmd-timeout INTEGER Individual command timeout in minutes. Default 5 mins --verbose Enable verbose output --allow-process-stop Dump additional data which may require system interruption --silent Run techsupport in silent mode --debug-dump Collect Debug Dump Output -r, --redirect-stderr Redirect an intermediate errors to STDERR -?, -h, --help Show this message and exit.

Commands: npu Gather platform npu information

  1. Run "show techsupport npu" and verify an archive with the collected data is created: root@sonic:~# show techsupport npu . . . /var/dump/sonic_npu_dump_hostname_20230828_105958.tar.gz

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)

gvlaemyn avatar Sep 08 '23 07:09 gvlaemyn

Thanks @kevinskwang ! Please help to rerun the build pipeline. Thanks

anamehra avatar Sep 27 '23 19:09 anamehra

@kevinskwang Thanks for your previous review and approval. Merging was blocked because of a code coverage issue. This has been addressed in a test case in my latest commit. Could you review and approve if appropriate?

gvlaemyn avatar Oct 24 '23 08:10 gvlaemyn

Hi @abdosi , @rlhui , could you please help with this PR?

anamehra avatar Dec 14 '23 20:12 anamehra

Hi @abdosi , @rlhui , could you please help with this PR for serviceability improvements?

jamesan47 avatar Mar 05 '24 17:03 jamesan47

Hi @abdosi , @kevinskwang Please help with review, approval, and merge if no concerns. We would like to have it included in 202405.

jamesan47 avatar Aug 14 '24 21:08 jamesan47