Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 22513

Re: Automatically shutdown server on temperature threshold?

$
0
0

With a little work, it should be possible.  You don't mention what the target OS is, so I'm going to assume Windows for now, but if it's another platform, it shouldn't be too hard to figure out what I did, and adjust from there. The way I'd do this is to create an alert in "Advanced Alert Manager", with a trigger condition that looked something like this:

 

thwack_temp_shutdown.png

 

Property to Monitor: Hardware Type

- Hardware Type Name is equal to Temperature

- Hardware Type Status is equal to Critical

 

You might need to add other conditions, such as getting it to exclude certain hardware depending on known criteria.  Once you have identified your criteria, next is the trigger action.  Click on the "Add New Action", and select "Execute an external program", this is where you can get it to do all shutdown steps.  Because I'm using Windows as an example, I'd use psshutdown to do the work.  Assuming I put psshutdown in c:\utils\ then the command would look something like this:

 

c:\utils\psshutdown -f -k -t 30 -m "Shutdown due to Temperature issues" \\${DNS}

 

Using psshutdown, you may need to specify credentials, in which case, you'd either adjust the command here, or look into triggering the action some other way.

 

As a side note, if you want it to react at a certain temperature, rather than the hardware telling you it's at a dangerous temperature, change the property to monitor to Hardware Sensor, remove the "hardware type status" option, and use "Hardware Sensor Value".

 

I'd strongly recommend using a dummy script for a while instead of the real shut down script, just to verify your alerting criteria are in fact correct, and you don't go shutting down your infrastructure by accident.  You should also consider setting it so that the alert trigger doesn't go off until X minutes have passed, this is to avoid fluctuating temperatures or values.  You can also use a reset action to stop the shutdown, for example with psshutdown you pass in -a and it'll abort the shutdown.

 

This is a rough idea, I've not tested it, but should give you some ideas to work from.  Have fun! Let me know how it goes.


Viewing all articles
Browse latest Browse all 22513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>