Bill Whillers wrote:
Thanks for your excellent resource.

As a stop-gap (for now) the following script is cron'd every minute on the server to log basic load profile and to email `top` snapshot if things get out of hand.

-----monitor-----------

uptime>>/jobs/monitor.log;
temp=$(cat /proc/loadavg);
if [ $(echo -e "scale=0 \n ${temp%% *}/0.01 \nquit \n" | bc) -gt 100 ]
then
  file="/jobs/monitor.peak_`date '+%m-%d-%y-%H:%M:%S'`";
  `top -b -n 1 > ${file}`;
   mail root -s "Load Warning: ${temp}" < ${file};
fi

----------------

Better ideas are always appreciated.

Bill, please read the information at the URL that I've sent before: http://modperlbook.org/html/part2.html In particular: http://modperlbook.org/html/ch14_01.html

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to