Display All CPU(s) With the top Command
As you know, the top command displays All CPU(s) so it is
difficult to identify if All CPU(s) are pegged.
Interactively, you can toggle top by pressing the Number 1 on the
keyboard, however that toggle cannot be scripted.
The work around is to create a .toprc file in your home directory
by pressing the W key (capital W) while top is running. If
you are paying attention, you will see a message that the .toprc
file was just created. From there on out, typing top will
display All CPU(s).
Below is a script I run to capture top activity during peak
loads. Make sure you have enough disk space!
vi run_top.sh
#!/bin/sh
#Syntax Below
#./run_top.sh > TOP_UNDER_LOAD.doc
x=1
while [ $x -le 4000 ] #Run 4000 Times
…
[Read more]