anatol/smart.go

new ReadGenericAttributes() api is missing attribute id 190 "Temperature_Celsius"

rare-magma opened this issue · 2 comments

I think the new ReadGenericAttributes() api is not handling correctly devices that don't provide an Airflow_Temperature_Cel attribute.
The SSDs and HDDs in my machines only provide Attr ID 194 "Temperature_Celsius":

sudo smartctl -a /dev/sdc | grep 'ID#\|Temp'
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
194 Temperature_Celsius     0x0002   175   175   000    Old_age   Always       -       37 (Min/Max 24/59)`

Running the latest gotop release that makes use of the ReadGenericAttributes() api fails to display the temps correctly:
image

Relevant code: https://github.com/anatol/smart.go/blob/main/sata.go#L468

The latest commit should fix this problem.

If you have a chance, could you please update smart.go dependency for gotop and check if it works correctly.

@anatol I've updated the smart.go dependency for gotop, tested it and your commit fixed the issue.
Thanks!