this post was submitted on 04 Jul 2023
9 points (90.9% liked)

unRAID

1179 readers
1 users here now

A community for unRAID users to discuss their projects.

founded 2 years ago
MODERATORS
 

Got some extreme warm weather coming and I'm going to be out of town for a while. Can't trust the inlaws staying here to do anything server related.

Anyone know of a plugin or script to automatically shutdown if the system temp is too high?

you are viewing a single comment's thread
view the rest of the comments
[–] TheTango 1 points 2 years ago

There are a few ways to do it, but the easiest is to run the 'sensors' command from the lm_sensors package, but I prefer the simplicity of the acpi command

For example,

[fedora ~]$ acpi -t Thermal 0: ok, 20.0 degrees C

So you could do:

#!/usr/bin/bash

if [ $(acpi -t | cut -d" " -f4 | cut -d"." -f1) -gt 80 ]; then
        # halt?  shutdown? reboot?  It's up to you.
fi

The second way is to use your BIOS settings to see if you can adjust the trip temperature. On my system,

[fedora ~]# sensors

which means the system will auto-shutdown at 110.0 degrees.

You can see that this happens at https://elixir.bootlin.com/linux/latest/source/drivers/thermal/thermal_core.c#L316