From 87e91786551f9d9ba00f01582a4ad673d6e8c296 Mon Sep 17 00:00:00 2001 From: Geert Vlaemynck Date: Tue, 12 Sep 2023 11:11:48 +0200 Subject: [PATCH] [generate_dump] call hw-management-generate-dump.sh in collect_cisco_8000 Signed-off-by: Geert Vlaemynck --- scripts/generate_dump | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/generate_dump b/scripts/generate_dump index dd98302a27..0785561162 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -1410,6 +1410,27 @@ collect_cisco_8000() { echo "'/usr/share/sonic/device/${platform}' does not exist" > /tmp/error save_file /tmp/error sai false fi + + save_cmd "show platform versions" "platform.versions" + + # run 'hw-management-generate-dump.sh' script and save the result file + HW_DUMP_FILE=/usr/bin/hw-management-generate-dump.sh + if [[ -x $HW_DUMP_FILE ]]; then + ${CMD_PREFIX} $HW_DUMP_FILE $ALLOW_PROCESS_STOP + ret=$? + if [[ $ret -ne 0 ]]; then + if [[ $ret -eq $TIMEOUT_EXIT_CODE ]]; then + echo "hw-management dump timedout after ${TIMEOUT_MIN} minutes." + else + echo "hw-management dump failed ..." + fi + else + save_file "/tmp/hw-mgmt-dump*" "hw-mgmt" false + rm -f /tmp/hw-mgmt-dump* + fi + else + echo "HW Mgmt dump script $HW_DUMP_FILE does not exist" + fi } ##############################################################################