| CPU Temperature Alert | |||||
| CPU Temperature Alert - Home | Part of Home site: http://akakul.co.uk/ Scripts Home |
||||
Welcome to the home of Kuls 'CPU Temperature Alert' scriptThis page deals with CPU Temperature Alert on Cobalt/Sun RaQ3's & RaQ4's [RaQ550?]specifically, though it is EASILY customisable to any Linux machines that has 'hardware' monitoring of the CPU Temperature and the Kernel reports the temperature in a file / pseudo file (i.e. /proc/cpuinfo). I wrote this script to alert me of excessive Temperature rises above a 'normalised' temperature. This can (and did) indicate that the CPU fan had failed on my Sun/Cobalt RaQ3, and subsequently that the PSU fan also later failed - Jinxed RaQ3 :). Though detecting that the PSU fan had died also relied on the fact that one day the temperature rose another 5 degree's C and remained at least 5 degree's C higher than the previous weeks temperatures / based on loading at the time. (No temperature sensor is installed in the RaQ3's Chassis or PSU - so is mostly guess work, but with a History of previous Temperature this is not hard to work out, by just spotting abnormal trends.) I later used this script to monitor when my RaQ3's was around 30 seconds away from crashing, by alerting me when the temperature had reached an unbearable 80 degree's C. Toasty! (80 degree's C is NOT a good Temperature to run your CPU at I'm told :-P) This small script needs to be installed via Shell (Telnet/SSH) and set to run from 'crontab' (or similar) frequently. One of the IMPORTANT features of this script is that it will not constantly keep sending emails/SMS to you every time the CPU is over a predetermined temperature like most other similar types of scripts. This Script will *ONLY* email/SMS you once in any set period (you define this period) so you wont be blasted with hundreds of SMS Messages or E-mails should the Temperature rise too high on your RaQ! InstallingYou can either download your chosen format to the server directly (recommend GZ file), or to your PC and FTP (this is a UNIX file and should be uploaded as BINARY - NOT ASCII) up to a user account, then move the script to somewhere that only 'root' can see / alter it. su - {ENTER YOUR ROOT PASSWORD WHEN PROMPTED} cd /opt/bin wget http://scripts.akakul.co.uk/code/cpu_temp.gz gunzip cpu_temp.gz chown root.root cpu_temp chmod 700 cpu_temp Now you can either run it manually without any parameters, and it will display its usage (help texts), or continue on to setting 'crontab' to run it. */12 * * * * /opt/bin/cpu_temp -w 45.5 -p 360 -e your@email.address -l /home/cpu_info_log Which will tell crontab to run the script every 5 minutes
You can run this script manually if you wish as many times as you like, with the only side-effect being that the LOG (if any) will have extra entries in. NOTE: The LOG file (if enabled) will be rotated during every 'execution' if it is required, ONLY ONE months data will be kept in the log file. :-) References:
|
|||||
| © akaKul.co.uk | |||||