1833059 Members
2371 Online
110049 Solutions
New Discussion

CPU/PROCESS

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

CPU/PROCESS

Ok,
I am very familiar with glance plus, mwa and sar. I am trying to monitor cpu percentage for a specific process. Is there a command or set of commands tha I can pump into a script to track cpu % for a specific process?
UNIX IS GOOD
3 REPLIES 3
Steve Steel
Honored Contributor
Solution

Re: CPU/PROCESS

Hi

UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|head -n1
UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|grep -v %CPU| sort -nr|tail
-n +2|head -n 20

2 lines . Top 20 cpu

Or second line and grep process


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
RAC_1
Honored Contributor

Re: CPU/PROCESS

you can use UNIX95
as follows

UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|grep "your process"

or use top
top -d2 -f /tmp/test

then strings /tmp/test|grep "your process"

There is no substitute to HARDWORK
Bill McNAMARA_1
Honored Contributor

Re: CPU/PROCESS

apart from ps as mentioned above,
top also should tell you..

Later,
Bill
It works for me (tm)