Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[determine-reboot-cause] Support 'Kernel Panic' reboot cause (sonic-n…
…et#7153) Signed-off-by: Yong Zhao yozhao@microsoft.com Why I did it If device reboot was caused by kernel panic, then we need retrieve and store the key information into the symbol file previous-reboot-cause.json. The CLI show reboot-cause will read this file to get the reason of previous reboot. This PR is related to PR in sonic-utilities repo: sonic-net/sonic-utilities#1486 How I did it The string variable previous_reboot_cause will be parsed to check whether it contains the keyword Kernel Panic. If it did, then store the keyword and time information into a dictionary. How to verify it I verified this change on a virtual testbed. admin@vlab-01:/host/reboot-cause$ more previous-reboot-cause.json {"gen_time": "2021_03_24_23_22_35", "cause": "Kernel Panic", "user": "N/A", "time": "Wed 24 Mar 2021 11:22:03 PM UTC", "comment": "N/A"} admin@vlab-01:/host/reboot-cause$ show reboot-cause Kernel Panic [Time: Wed 24 Mar 2021 11:22:03 PM UTC]
- Loading branch information