linux-nvme / nvme-cli

NVMe management command line interface.
https://nvmexpress.org
GNU General Public License v2.0
1.45k stars 650 forks source link

nvme smart-log does not show temps in Celsius #2456

Closed Strykar closed 1 month ago

Strykar commented 1 month ago

Temps in Fahrenheit and Kelvin but not Celsius?

$ sudo nvme smart-log /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning            : 0
temperature             : 91 °F (306 K)
available_spare             : 100%
available_spare_threshold       : 5%
percentage_used             : 1%
endurance group critical warning summary: 0
Data Units Read             : 42,210,392 (21.61 TB)
Data Units Written          : 20,246,705 (10.37 TB)
host_read_commands          : 2,247,662,721
host_write_commands         : 1,572,136,596
controller_busy_time            : 150
power_cycles                : 111
power_on_hours              : 5,221
unsafe_shutdowns            : 78
media_errors                : 0
num_err_log_entries         : 1,124
Warning Temperature Time        : 0
Critical Composite Temperature Time : 0
Thermal Management T1 Trans Count   : 0
Thermal Management T2 Trans Count   : 0
Thermal Management T1 Total Time    : 0
Thermal Management T2 Total Time    : 0

$ sudo nvme version 
nvme version 2.10.2 (git 2.10.2)
libnvme version 1.10 (git 1.10)

$ uname -a
Linux r912 6.10.3-arch1-2 #1 SMP PREEMPT_DYNAMIC Tue, 06 Aug 2024 07:21:19 +0000 x86_64 GNU/Linux
igaw commented 1 month ago

The unit type is chosen depending of your locale settings, so if you use US locales you get Fahrenheit.

Strykar commented 1 month ago

The unit type is chosen depending of your locale settings, so if you use US locales you get Fahrenheit.

Thanks for clearing that up, setting LC_MEASUREMENT=metric in /etc/locale.conf works along side LANG=en_US.UTF-8,

igaw commented 1 month ago

Oh, we might also need to extend our check, though. I don't think we are actually looking at LC_MEASURMENT instead just on the country. This is wrong I think.