EnderUNIX Team.


EnderUNIX tips

Mail to My Friend , Home Page

[ Console ]

"PARSING AT THE TOP" - Ülkü SAYILAN - (2005-02-01 15:27:16)   [4245]



Here's a little something that I find useful....

while true
do
top -d 2 | col -b | grep states
sleep 300
done

Where -d 2 displays two screens of top, col -b strips the
dodgy control characters out of the screens and grep states
grabs the only bit that was of interest.

Output is as follows -

CPU states: 90.4% idle, 4.1% user, 5.5% kernel, 0.0% iowait, 0.0% swap
CPU states: 94.6% idle, 1.6% user, 3.5% kernel, 0.4% iowait, 0.0% swap

This way, you're not running top all the time and you get the cpu info
you need that xload and uptime don't tell you.

It works on Solaris 2.6 and I suspect it will work on most other
UNIX platforms.

Mail to My Friend , Home Page