We don't bite newbies here... much | |
PerlMonks |
Temperature monitoring, againby bronto (Priest) |
on Jan 04, 2005 at 15:49 UTC ( [id://419271]=CUFP: print w/replies, xml ) | Need Help?? |
Same problem again. But this time it was just a bit more complex. This time the platform to be monitored is a Sun Fire 12K. Even for a small configuration like ours, the command showenvironment -p temps returned 198 temperatures from different sensors! Since there are many sensors on the same board, we needed to aggregate the temperatures and report the resulting minimum and maximum. But wait, there is more :-) showenvironment also returns a status code, that indicates if the parameter is in a safe range or if you should start worrying -or if it wasn't simply possible to read the temperature at all. So I came out with the following script, that does the job. The code reads the output of showenvironment -p temps from standard input and outputs in a format suitable for the monitoring tool we currently use. The code could be neither beautiful nor elegant, but I wrote it in a very short time. Feel free to improve it and publish your improvements on PM! Enough talking, here is the code!
Ciao! In theory, there is no difference between theory and practice. In practice, there is.
Back to
Cool Uses for Perl
|
|