[SOLVED] Logging of hardware temperature

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Logging of hardware temperature

Postby bots4ever » Aug 14th, '14, 16:27

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 :( )
Last edited by bots4ever on Aug 15th, '14, 03:50, edited 1 time in total.
bots4ever
 
Posts: 35
Joined: May 4th, '14, 03:13
Location: Philippines

Re: Logging of hardware temperature

Postby doktor5000 » Aug 14th, '14, 17:34

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
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Logging of hardware temperature

Postby bots4ever » Aug 15th, '14, 03:50

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!
bots4ever
 
Posts: 35
Joined: May 4th, '14, 03:13
Location: Philippines


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest