Get CPU,Memory utilization by process id | Unix Linux Forums | HP-UX

  Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Get CPU,Memory utilization by process id

HP-UX


Tags
cpu and memory usage, unix

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-10-2011
suresh_g suresh_g is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 11 January 2011, 12:18 AM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Get CPU,Memory utilization by process id

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

Thanks,
Suresh
Sponsored Links
    #2  
Old 01-10-2011
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 672 Times in 642 Posts
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:


Code:
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

Sponsored Links
    #3  
Old 01-11-2011
suresh_g suresh_g is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 11 January 2011, 12:18 AM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re:Get CPU,Memory utilization by process id

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"

Please let me know how to check this

Thanks,
Suresh
    #4  
Old 01-11-2011
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 672 Times in 642 Posts
Quote:
"ps: illegal option -- 0"
There is no character zero in any line I posted. There is a lower case "o".

If it isn't just a typo, please post the exact line which fails (in code tags). The "UNIX95= " prefix is part of the line you type.


On your other problem, there is no "-p" switch to "top". See "man top".

Last edited by methyl; 01-11-2011 at 10:35 AM..
Sponsored Links
    #5  
Old 01-13-2011
vishal.bordia vishal.bordia is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 18 January 2011, 12:06 AM EST
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Hi Suresh,
If you know the process id you can use the following command for getting the process by process id

ps -ef |grep <process id>
Sponsored Links
    #6  
Old 01-13-2011
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 672 Times in 642 Posts
@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:

Code:
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.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Get CPU,Memory utilization by process id suresh_g UNIX for Dummies Questions & Answers 1 01-10-2011 09:15 AM
How to monitor a process memory utilization? vij_krr Emergency UNIX and Linux Support 9 12-22-2009 12:10 PM
How to check Memory Utilization by each process bryanabhay SuSE 5 11-30-2009 09:22 AM
Getting CPU utilization and memory for a process radiatejava UNIX for Dummies Questions & Answers 5 03-03-2009 12:47 PM
Memory and CPU utilization process learnbash Shell Programming and Scripting 4 05-21-2008 02:21 PM



All times are GMT -4. The time now is 01:05 AM.