- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Top 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
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
08-31-2004 01:39 AM
08-31-2004 01:39 AM
Top process
In my application, I have to get a list of the top 10 processes and their following values:-
NAME,PID,PPID,%CPU,REAL UID,PRI,STARTTIME,USERTIME,EFF.UID,EFF.GID,STATUS,SOCK.REQ.RECVD,SOCK.REQ.SENT,SIG.RECVD,RPAGES FOR MM,VPAGES FOR MM,RPAGES FOR IO,VPAGES FOR IO
Anybody know how to retrieve these values in a simple manner(i.e. using the command top with any options) ?
Regards,
Sathish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 01:42 AM
08-31-2004 01:42 AM
Re: Top process
#!/bin/sh
# memtop - show top memory users and pid
# VSZ is in KB
echo "VSZ(KB) PID RUSER COMMAND"
UNIX95= ps -e -o 'vsz pid ruser args' |sort -nr|head -30
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 01:45 AM
08-31-2004 01:45 AM
Re: Top process
man ps, checl XPG4 conformance details.
UNIX95= ps -ef -C "process_name" -o "vsz,arg,ruser,stime,time" Will give
memory used by process - vsz
Arguments - arg
ruser - owner of the process
stime - start time(if more than 24 hrs, just the date)
time - time used. There are lot of options. check man page of ps
For information on syscalls made by process, sockets, you may use tusc tool(trace unix system calls)
You can get tusc at http://hpux.connect.uk.of
tusc -vfp "process_id"
lsof tool(list open files) will also give some details.
lsof "process_id"
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 01:47 AM
08-31-2004 01:47 AM
Re: Top process
With 'top' you can use -n option to display the number of processes you want them to appear. Use -f option to redirect it to a file. However, you will not be able to get all these stats with top.
You can use XPG4 version of 'ps' to get some more of the ones you want.
For ex.,
UNIX95= ps -e -o 'pcpu pid ppid args' |sort -n
will sort the output by percentage CPU. change the first field to whatever you want to get sorted. Again, you may not get all the stats that you need from ps.
Look at the man pages of top and ps on what you can do with them.
Stats related to SOCKETS are to be obtained from netstat which may have to be done seperately but you won't get them on per process basis.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 01:59 AM
08-31-2004 01:59 AM
Re: Top process
the "top" command implies the -n option for displaying only n lines
HTH
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 02:41 AM
08-31-2004 02:41 AM
Re: Top process
Thanks for ur suggestions Sri, Franky, Rac and Geoff
I've got all but the below information:
USERTIME
STATUS
SOCK.REQ.RECVD
SOCK.REQ.SENT
SIG.RECVD
RPAGES FOR MM
VPAGES FOR MM
RPAGES FOR IO
VPAGES FOR IO
Kindly share from your knowledge.
TIA,
Sathish