CPU usage per user

Hello everybody,
How can we proceed to measure the CPU used par a user on unix HPUX ?
there some commands or tools ?

Thank you in advance.

Something like:
ant:/home/vbe $ ./user_ps patrol
144 patrol 14347 1 0.15 vmstat 5 2
216 patrol 1292 0 0.02 ds_listener -port=50005 -hosts= -period=3:00 -interval=1440 -lo
268 patrol 12379 0 0.02 /usr/bin/ksh
268 patrol 3638 0 0.02 /usr/bin/ksh
16692 patrol 1369 19 1.24 PatrolAgent
patrol PID 12379 %CPU = 0
TOTCPU = 0
patrol PID 14347 %CPU = 1
TOTCPU = 1
patrol PID 1369 %CPU = 19
TOTCPU = 20
patrol PID 1292 %CPU = 0
TOTCPU = 20
patrol PID 3638 %CPU = 0
TOTCPU = 20
total cpu load for patrol = 5

?
As you can (not really...) see, I wrote a script... running PA-RISC HPUX 11.11 using ps (XPG4...)

but in my server I don't have the evoqued script :
/home/vbe/user_ps patrol
Could you please send it to me ?
Thank you in advance.

And we dont know on what you are running...
The script I wrote is just an idea using UNIX95 syntax (XPG4) of ps, so do a man of ps to see what can be done, then there is maybe more simple: the command top has a -f option for putting in a file rather than displaying..You could write a script using the file, by grep the user and totalize the %CPU , you could maybe use glance...

Now if you want to bring some ameliorations my first script for the community (I lack of time lately...), and at the same time see what can be done using XPG4, then I will gladly share here...

All the best

Hey !! U can use the top command to check the cpu usage of all users separately ..

Thanks :slight_smile: