- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- track CPU usage for specific process?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 02:08 AM
03-23-2007 02:08 AM
I commonly use top to view high resource consumers on my rp8400 (HPUX 11.11). I am interested though in watching some specific jobs (by name) and periodically saving their weighted CPU usage over time. Is there a ps command (or another method) I could use to show the weighted CPU usage for those processes? Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 02:29 AM
03-23-2007 02:29 AM
SolutionSomething like this:
# UNIX95= ps -ef -o pid,ppid,pcpu,args | sort -nbk 3 | tail -10
would give you the top 10, you would probably want to pipe to grep to select particular processes.
Pete
P.S. Note the space after "UNIX95= "
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 02:29 AM
03-23-2007 02:29 AM
Re: track CPU usage for specific process?
here is an example script with 9869 as pid
UNIX95=1 /usr/bin/ps -e -o pcpu,pid,args | grep 9869 | grep -v grep | sed -e 's/\.[0-9][0-9]/&\%/g' |awk '{ print $1 } '
hope this helps
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 02:39 AM
03-23-2007 02:39 AM
Re: track CPU usage for specific process?
Glance is always a good option, remember if you do not have it you could always get a trial version,
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 02:46 AM
03-23-2007 02:46 AM
Re: track CPU usage for specific process?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:10 AM
03-23-2007 03:10 AM
Re: track CPU usage for specific process?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:18 AM
03-23-2007 03:18 AM
Re: track CPU usage for specific process?
On 11.11 you absolutely do have the XPG4 options. You need to cut and paste this line exactly as it stands:
UNIX95= ps -ef -o pid,ppid,pcpu,args
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:22 AM
03-23-2007 03:22 AM
Re: track CPU usage for specific process?
so:
export UNIX95=1
ps -o pid,...
-- will work or you can define UNIX95 for a single command:
UNIX95=1 ps -o pid,...
works as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:23 AM
03-23-2007 03:23 AM
Re: track CPU usage for specific process?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:23 AM
03-23-2007 03:23 AM
Re: track CPU usage for specific process?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:27 AM
03-23-2007 03:27 AM
Re: track CPU usage for specific process?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:31 AM
03-23-2007 03:31 AM
Re: track CPU usage for specific process?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 03:32 AM
03-23-2007 03:32 AM
Re: track CPU usage for specific process?
try this from a shell prompt:
unset X # make sure that X is not already defined
X=1 sh 'echo ${X}' # Note that sh is a separate process
echo ${X} # back in parent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2007 05:04 PM
03-23-2007 05:04 PM
Re: track CPU usage for specific process?
It may be dangerous to set this variable, rather than invoke it just on ps(1).
Patches may fail to unshar due to bugs/fixes in shar(1) and wc(1).
>Clay: X=1 sh 'echo ${X}'
Note this is completely different (in most cases if X isn't exported) than:
$ X=1; sh 'echo ${X}'