Opened 14 months ago

Closed 14 months ago

Last modified 13 months ago

#1697 closed task (invalid)

Question on decoding temperature values from csv file

Reported by: Marc Dombrowa Owned by:
Priority: minor Milestone:
Component: smartd Version:
Keywords: ata Cc:

Description

I started looking at the csv files smartd generates and would like some help understanding it.
On some websites ATA drives were said to show a 150 offset to the raw value in Celsius.
A number 187 would translate to 187-150 as a value for degrees celsius.
On some SCSI Enterprise drives the temperature is listed exactly in degrees celsius in the CSV file which is very convenient.

I found a few CSV files with strange output and would like to know how to find the correct decoding. Below is some data of ATA drives CSV output searching for then key 194 aka. Temperature_Celsius, showing the column number in which key=194 is found and the min and max value found in the next column that I think is the temperature.

For some drives the range can not be linear:
minimal value 4, max value 253 would not translate by any linear offset assuming this is a digit and not hex.
Also, min=55 max=79 is likely an offset of possibly 100? Pulling with smartctl shows
194 Temperature_Celsius 0x0022 073 046 --- Old_age Always - 27 (Min/Max 20/46)

key=194 in column=35 min=94 max=145 in /tmp/Temperature_Celsius.WD-WMC1T0306391.raw.csv (Model: WDC WD30EZRX-00DC0B0)
key=194 in column=41 min=4 max=253 in /tmp/Temperature_Celsius.7SGEWP6C.raw.csv (Model: WDC WD80EFAX-68LHPN0)
key=194 in column=53 min=5 max=43 in /tmp/Temperature_Celsius.Z840RT48.raw.csv (Model: ST8000AS0002-1NA17Z)
key=194 in column=41 min=4 max=253 in /tmp/Temperature_Celsius.1SG60K6Z.raw.csv (Model: WDC WD80EMAZ-00WJTA0)
key=194 in column=53 min=5 max=42 in /tmp/Temperature_Celsius.ZCT0EYFR.raw.csv (Model: ST8000DM004-2CX188)
key=194 in column=41 min=104 max=250 in /tmp/Temperature_Celsius.JEGRVHKN.raw.csv (Model: WDC WD100EMAZ-00WJTA0)
key=194 in column=53 min=6 max=42 in /tmp/Temperature_Celsius.ZCT0EQG7.raw.csv (Model: ST8000DM004-2CX188)
key=194 in column=41 min=181 max=253 in /tmp/Temperature_Celsius.2YHZD7WD.raw.csv (Model: HGST HUH721010ALE601)
key=194 in column=50 min=55 max=79 in /tmp/Temperature_Celsius.183584805068.raw.csv (Model: WDC WDS500G2B0A-00SM50)

Is there a magic table for each manufacturer to decode the smart output or syntax to log the raw value only?
Btw: Google has not been my friend yet in finding an answer.

Change History (4)

comment:1 by Christian Franke, 14 months ago

Component: allsmartd
Keywords: ata added; temperature decoding removed
Milestone: unscheduled

One attribute record is printed in the CSV file as ID;VALUE;RAW.

The normalized VALUE does not report the temperature as it should decrease if things get worse. Many drives use 100-temperature here but this is vendor specific. The actual temperature in Celsius is usually reported in the lower byte of the RAW value. The higher bytes might report min/max temperature in a vendor specific way.

Please read the -A, --attributes section on smartctl man page and check the VALUE and RAW columns of smartctl outputs to understand the difference. See also the related FAQ entry.

PS: This is a bug tracker, not a support forum. For future support questions, please use the smartmontools-support mailing list instead. Thanks.

comment:2 by Christian Franke, 14 months ago

Resolution: invalid
Status: newclosed

Support question, no bug report.

comment:3 by Marc Dombrowa, 13 months ago

Thank you for your time and answer despite my ignorant use of this bug tracker.

comment:4 by Christian Franke, 13 months ago

No problem. If you are interested in min/max temperatures, use smartd.conf -W directive as mentioned in the FAQ. In conjunction with state persistence (-s command line option, sometimes enabled by default), min/max values are persistent.

Most drives collect min/max temperature themselves but these values may only appear in SCT Status or Device Statistics page 5. The JSON mode of smartctl combines this info in the temperature node:

# smartctl -j -A -l scttempsts -l devstat,5 /dev/sdc | jq .temperature
{
  "current": 24,
  "power_cycle_min": 18,
  "power_cycle_max": 33,
  "lifetime_min": 15,
  "lifetime_max": 40,
  "op_limit_max": 70
}

# smartctl --json=g -A -l scttempsts -l devstat,5 /dev/sdc | grep '^json\.temperature'
json.temperature = {};
json.temperature.current = 24;
json.temperature.power_cycle_min = 18;
json.temperature.power_cycle_max = 33;
json.temperature.lifetime_min = 15;
json.temperature.lifetime_max = 40;
json.temperature.op_limit_max = 70;

Examine smartctl -x output for more details. Don't use -a as it only shows legacy ATA SMART info.

Note: See TracTickets for help on using tickets.