Page 1 of 1

[SOLVED] Logging of hardware temperature

PostPosted: Aug 14th, '14, 16:27
by bots4ever
Hi,

I would like to know if there is a tool, terminal command or a script that I can run to log my laptop's temperature? I believe my laptop reached its trip point / shutdown temperature so I let it cool for a few minutes, turn my laptop back on and logged in as usual. I ran journalctl --since="yyyy-mm-dd hh:tt" but I cannot see any logs that could triggered the shutdown or listed the current temperature before it was forcibly shut down by the hardware.

I'm not even confident that the laptop's hardware can send any signal to the operating system (Linux) that it is forcing the system to poweroff which is similar to holding the power button of your laptop until it goes off so with that in mind, I am looking for something that periodically monitors and saves the value of the CPU temperature into a logfile at regular intervals.

The laptop's BIOS does not have any logging system (as most consumer based laptops do :( )

Re: Logging of hardware temperature

PostPosted: Aug 14th, '14, 17:34
by doktor5000
Check http://superuser.com/questions/25176/ho ... nder-linux or http://askubuntu.com/questions/41794/ho ... tures-load for some easy suggestions. You can put the command you want to run in a simple shell script that does something like
Code: Select all
while true; do sleep 5; sensors >> /tmp/temperature_log; done

Re: Logging of hardware temperature

PostPosted: Aug 15th, '14, 03:50
by bots4ever
Hello doktor5000,

Thank you for your suggestions. I went the script route and modified your suggestion into this format:

Code: Select all
while true; do sleep 15; date >> /home/(username)/Documents/temperature.log; sensors | grep -e Physical -e 'Core 0' -e 'Core 1' >> /home/(username)/Documents/temperature.log; done


It will run date & sensors with an interval of 15 seconds. The result will be outputted to a text file in Documents. This is exactly what I was looking for. I hope other newbies, like me, will find this useful. Many many thanks!