Page 1 of 1

Reading CPU and HDD temperatures from CLI

Posted: 18 Apr 2024, 05:21
by f18m
Hi all,
I'd like to put in cron a simple script to log CPU and HDD temperatures on my F2-210 (ARM Cortex A53) using TOS 4.
I do have SSH access... I tried to search for some utility in the filesystem to do that, but failed (*)

Is there a path exposed under /proc or /sys with the temperatures?
Or some utility like lm_sensors for TOS4 ?

Thanks!

(*) I did find a /usr/bin/hddtemp utility but that fails to read HDD temperature... which however showsup just fine in the "Hardware Info" panel of TOS4...

Re: Reading CPU and HDD temperatures from CLI

Posted: 18 Apr 2024, 15:28
by TMzethar
TOS uses the SMART tool to obtain the temperature of the hard drive. You can also manually obtain the temperature information of the hard drive through this command:

Code: Select all

smartctl -A /dev/sd? |grep Temperature

Re: Reading CPU and HDD temperatures from CLI

Posted: 18 Apr 2024, 16:47
by f18m
Ok thanks! Good point!
What about the CPU? I found /sys/devices/virtual/thermal/thermal_zone0/temp but how do I convert that number to Celsius degrees?
Thanks!

Re: Reading CPU and HDD temperatures from CLI

Posted: 19 Apr 2024, 21:40
by TMzethar

Code: Select all

ec_stat -rct
(read CPU temperature)

Re: Reading CPU and HDD temperatures from CLI

Posted: 19 Apr 2024, 22:00
by f18m
Actually I don't have that tility ec_stat on my TNAS... where can I grab it ?

Re: Reading CPU and HDD temperatures from CLI

Posted: 22 Apr 2024, 17:02
by TMzethar
Sorry, I just noticed that you are using the F2-210 model with arm architecture.
Please use this to get CPU temperature:

Code: Select all

cat /sys/class/thermal/thermal_zone0/temp | awk '{print ($1 / 1000) - 18}'