[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Thermal Monitor & automatic shutdown on over temperature event



David A. wrote:
On Mar 9, 9:10 am, Bob <s...@homeurl.co.uk> wrote:
Hi, I'm trying to get my etch MythTV Backend to shutdown automatically
if either the CPU or the Hard drives overheat.
8< snip
I've seen people recommend using sensord to shutdown on overheat but
can't see howto, also this wouldn't do anything for the hard drives,
similarly hddtemp seems to just do reporting with no option to shutdown.

collectd has options to monitor both but no tools that I can see to do
anything if an error condition arises.

My reading has led me to believe that the kernel can do at least the CPU
part of this for you, if you've got a better supported sensor chip,
which I don't, but I can't be alone, so what do others do in this situation?

> Hi all, I have similar worries since I run a fanless EPIA. If load
> gets to high and I'm not at home, or asleep I want the system to shut
> down.
> I wrote this small script using sensors to detect and warn high temps.
> At  very high temps execute shutdown.
>
> A wall-message and a 30 sek timeout is good if I'm at the desk and can
> connect a fan and abort the shutdown. I run the script with nohup.
>
> regards, David.

Hi David
A shell script did occur to me, but I thought with so many hardware monitoring daemons, and so many hardware monitor logging daemons, and so many GUI widgets for outputting the results of the previous 2 in practically every desktop environment ever conceived, some of which allow you to automate tasks on event conditions, there *MUST* be an option for headless systems other than some loopy shell script. (pun intended, not offense)

Have you tried to get sensord to control your fans? I tried this first, have the fans off until the CPU hits 50 or whatever, sadly doesn't work with my MB (which was very cheap 4~5 years ago) but you may have more luck.

> #!/bin/sh
>
> HIGH=70
> SHUTDOWN_TEMP=85
> export HIGH
> export SHUTDOWN_TEMP
>
> while true
> do
>
>   # read temp
>   TEMP=`sensors|grep 'CPU Temp'|cut -d+ -f2|cut -d. -f1`
>
>   if [ "$TEMP" -gt "$HIGH" ];
>   then
>     echo "High temp: $TEMP > $HIGH" | wall
>     sleep 2
>   else
>     if [ "$TEMP" -gt "$SHUTDOWN_TEMP" ];
>     then
>       echo "To hot, shutting down in 30 sek.!" | wall
>       sleep 30
>       sudo shutdown now
>     else
>       echo temp OK: $TEMP
>       sleep 5
>     fi
>   fi
>
> done

Nice script though, short, obvious, to the point, I may well end up nicking it and adding an hddtemp call.

Sorry for relaying out your email, some people get really narky about top posting.



Reply to: