Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Temperature Monitoring script

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I've had a few problems with the AC in the past month and for some reason even when the boards are registering 54 degrees the server's aren't shutting down. I thought 49 was the failsafe where the systems start panicking? Anyway I had the bright idea to write a script to monitor the temperature of the system and page me when it registers 50 or above. I figure I can put it in a crontab and have it check every minute. I started off with this for my first line

#!/bin/ksh
prtdiag -v | grep stable | awk '{print $3}' > /tmp/CURRENT_TEMP
for var in $(cat /tmp/CURRENT_TEMP)
do
if ["$var" => "50"]
then
echo warning its hot in here | mailx mypagerinformation
done


I have a problem with this. Is there a better way to get the temperature from the system? I am not sure that the board's temperature will be listed as stable. I've seen it listed as falling and rising before. I'm not sure what else it can be. Are there any helpful suggestions on my script?
 
The prtdiag output is different for different machine models, and maybe even differnt OS levels. My solaris 8 E450 shows the temps like this:

System Temperatures (Celsius):
------------------------------
AMBIENT 19
CPU 0 43
CPU 1 40
CPU 2 45
CPU 3 50

The point is, you're script is going to have to be taylored to the specific prtdiag output (and I don't know of any other command to get temps). Is there anything else in the temp line that you can grep on?
 
I've used prtdiag -v on 2.6 and on 2.7 and haven't noticed a difference in the output. I am using the script on E4500s as well as a 450. I noticed the difference of display on the different architecture as I was scripting it. I've taylor this script to only send two pages and then keep a log of whats happening. I'm pretty sure I have the script finished with the exception of it won't run correctly from the crontab which I am convinced will be fixed once I put the absolute paths in for certain commands. I guess the only thing I need to know is if anyone out there knows of another command to find internal temperatures on E4500/450s? Oh it would be nice to know what temperature I should set to shutdown the server. I think if it gets above 50 degrees celcius it is time to consider powering off hardware.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top