sonic-net / sonic-platform-common

Python packages which provide a common interface to platform-specific hardware peripherals in SONiC
Other
46 stars 175 forks source link

Fix the temperature parsing in virtium nvme disks #475

Closed vivekrnv closed 5 months ago

vivekrnv commented 5 months ago

Description

Fix https://github.com/sonic-net/sonic-buildimage/issues/19020

If the vendor utility couldn't infer the temperature, display the temperature inferred from smartctl utility

Motivation and Context

How Has This Been Tested?

Temperature can be read from smartctl utility

root@sonic:/home/admin# smartctl /dev/nvme0n1 -a 
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.1.0-11-2-amd64] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       Virtium VTPM24CEXI080-BM110006
SMART/Health Information (NVMe Log 0x02)
Temperature:                        39 Celsius
Before this change
root@sonic:/home/admin# show platform ssdhealth
Device Model : Virtium VTPM24CEXI080-BM110006
Health       : 100.0%
Temperature  : N/A

After this change
root@sonic:/home/admin# show platform ssdhealth
Device Model : Virtium VTPM24CEXI080-BM110006
Health       : 100.0%
Temperature  : 39.0C

Additional Information (Optional)

prgeor commented 4 months ago

@bingwang-ms can you cherry pick to 202405

mssonicbld commented 2 months ago

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-platform-common/pull/498