EXCELLENT - thanks! - John >On Sat, Jun 14, 2003 at 08:43:20PM -0400, John May wrote: > >> Right - but I want one that I can use in a shell script to set a >> variable to the current processor usage value, not one that I have to >> manually read myself. Trying to construct a general processor-usage >> monitoring script for a server. > >quick and dirtry: > >PERC_CPU=`ps -ax -o %cpu="" | perl -ne 'END {print "$tot\n"} $tot+=$_;'` > >-- >~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-., \|/ (___) \|/ _,.-=~'`^` > Brian Medley @~./'O o`\.~@ >"Knowledge is Power" brian.medley at verizon.net /__( \___/ )__\ *PPPFFBT!* > -- Francis Bacon `\__`U_/' > _,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~= <____|' ^^`'~=-.,__,.-= >~`'^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-==--^'~=-.,__,.-=~'`^` -- ------------------------------------------------------------------- John May : President <http://www.pointinspace.com> Point In Space Internet Solutions jmay at pointinspace.com LPA Corporate Partner / FSA Associate / ACN Member Lasso 5 + 6 / PHP / MySQL / FileMaker Pro Hosting Now Available!