Hi ,
We need to get the CPU% and Memory utilization of process by process id.
Is there any way to do get them ?
I tried few commands like top -p <PID> ,
but am getting error "Quitting top: pset <PID> doesn't exist"
also i tried with ps -eo option but am getting error "ps: illegal option -- o"
when i executed uname -a command i got following as output
"HP-UX servername B.11.23 U ia64 0318662421 unlimited-user license"
we are using hp-ux..Does the above commands doesnt work here?
What are the commands in hp-ux to get the CPU and memory utilization of process
Using the "UNIX95= " prefix (the space after the equals sign is important) you can use the alternative "ps" syntax as described in "man ps". This enables you to choose whatever fields you like in whatever order:
Some examples:
For a single process (in this case PID 4161)
UNIX95= ps -p 4161 -o pid,sz,pcpu,ruser,args
For all processes:
UNIX95= ps -e -o pid,sz,pcpu,ruser,args
Top 5 highest cpu user
UNIX95= ps -e -o pcpu,pid | sort -n -r |grep -v "%CPU"|head -5
Hi methyl,
We are using HP-UX OS.when we executed uname -a command , we got following output
"HP-UX servername B.11.23 U ia64 0318662421 unlimited-user license"
When i tried the options mentioned by you , am getting following error
"ps: illegal option -- 0"
@vishal.bordia
Please read the thread before posting.
You have managed to give a wrong answer to the wrong question.
If you wanted detail for a single process it would be:
ps -fp<process id>
The grep approach gives false hits.
Also the output from the default HP-UX "ps" does not contain the fields which the O/P wanted.
As you mention in another post HP "glance" program (pay software) gives full detail but of course the output is not suitable for processing in Shell.
You can buy full works server monitoring packages from HP.