sonic-utilities
sonic-utilities copied to clipboard
[master] [show] Option to add subcommands to show techsupport
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:
- 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
- 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)
Thanks @kevinskwang ! Please help to rerun the build pipeline. Thanks
@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?
Hi @abdosi , @rlhui , could you please help with this PR?
Hi @abdosi , @rlhui , could you please help with this PR for serviceability improvements?
Hi @abdosi , @kevinskwang Please help with review, approval, and merge if no concerns. We would like to have it included in 202405.