How to Identify long running unix processes


 
Thread Tools Search this Thread
Operating Systems AIX How to Identify long running unix processes
# 1  
Old 04-05-2012
How to Identify long running unix processes

Hi All, Need an urgent help, I have a requirement to find long running unix processes.. I have tried the below commands, but not succeed. I need to arrange the unix processess in an order of elapsed time (high to low) that runs in a system.
For Eg:
Consider we have 3 processes,
Pid 1
pid 2
pid 3
pid 1 is running for past 3 hours
pid 2 is running for past 5 hours
pid 3 is running for past 1 hour
The output of the command should be like this..
Descending order based on how long it runs...
pid 2 (5 hours)
pid 1 (3 hours)
pid 3 (1 hour)
# 2  
Old 04-05-2012
Tried what commands?
# 3  
Old 04-05-2012
How to Identify long running unix processes

Thanks for the quick response... BTW we are using AIX UNIX - Version 6.1.0.0.

1. Top is not supporting..
Code:
$ top -d 1 -o time | awk 'NR > 7 && int($9) > 12'
ksh: top:  not found.

2. This command is arranging the processes only minutes level and hours are not coming in the top..
Code:
ps -A -o user,pid,etime,args | grep normetl | awk '{print $1":"$2":"$3"-"$4"-"$5"-"$6"-"$7}' | sort -r -t: +2 | head

3.
Code:
ps -ef|grep normetl|cut -c1-15,42-79|sort -rn +2

4.
Code:
ps -ef | sort -n -k 5,5

None of the above is helpful..

Thanks in advance..
Irfan.

Moderator's Comments:
Mod Comment Welcome to the UNIX and Linux Forums. Please use code tags. Video tutorial on how to use them
# 4  
Old 04-05-2012
Couldn't you run the output through tr -d ':-' , so you can sort -rn on the column of etime ?
# 5  
Old 04-05-2012
Please post sample (abridged and relevant) output from options 2) 3) and 4).


Quote:
None of the above is helpful.
Too true.

Please post man ps from your system (or prefarably a link to an online manual) and sample lines from ps -ef for representative processes and define in words (not code) what constitutes a "long running unix process". For example processes such as "syslogd" will keep running from the moment the system boots.


Because the ps command has so much variation, please post some base facts:
Operating System and version uname-a (blot anything confidential with X's). Shell: echo $SHELL.

Last edited by methyl; 04-05-2012 at 06:46 PM.. Reason: assorted typos
# 6  
Old 04-13-2012
How to Identify long running unix processes

Hi methyl,

Thanks for your response, I am using AIX server unix K shell. following are the things you asked.

Unix Man page :
http://publib.boulder.ibm.com/infoce...ixcmds4/ps.htm
ps -ef command:

Code:
0413021901 ReadyJob.GetJobDetails 1 0/0/1 
etlusr 5113116 1 0 03:15:45 - 0:00 /home/db2clip/sqllib/bin/db2bp 21235292A55544 5 A 
etlusr 16385286 47187580 0 02:19:08 - 0:02 phantom DSD.StageRun TrnSchedulerMaxRun.20120413021902 MaxRun.TraGetInvID 1 0/0/1 
etlusr 36046106 16385286 0 02:19:11 - 0:00 phantom DSD.RUN ReadyJob.20120413021902 0/0/1/0/0

$ uname -a
Code:
AIX TESTSERV 1 6 00F625964C00

Moderator's Comments:
Mod Comment Please use code tags. Video tutorial on how to use them

Last edited by Scrutinizer; 04-13-2012 at 06:44 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Need to check long running processes on the database server and the os is AIX

Hello, Please help me with a script with which I can check long running processes on the database server and the os is AIX. Best regards, Vishal (5 Replies)
Discussion started by: Vishal_dba
5 Replies

2. AIX

Identify All Processes memory and cpu usage.

Hi All, Anyone has script to monitor AIX total processes memory and cpu usage that contribute to the total memory and CPU utilize so far ? The purpose of this is to analyze process memory trend. Thanks. Best Regards, ckwan (2 Replies)
Discussion started by: ckwan
2 Replies

3. Shell Programming and Scripting

Quick question about finding the PID of long-running processes

The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l.exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20... (2 Replies)
Discussion started by: Bolanok
2 Replies

4. UNIX for Dummies Questions & Answers

Need Unix command to get all processes running on a port

Hi, Can someone provide me the Linux command to get the list of all processes running on a particular port. Thanks, Sandy (1 Reply)
Discussion started by: sandy8765
1 Replies

5. UNIX for Dummies Questions & Answers

How do you print the number of processes that each user is currently running in Unix?

Ok, so I know there's a way to do this, but I've been trying to find out all afternoon with no luck. I think it should print out something like this: 1 bin 2 daemon 6 duo Where the numbers on the left are the number of processes being run by the user whose name is listed on the right. Is... (4 Replies)
Discussion started by: Duo11
4 Replies

6. AIX

Script to identify high CPU usage processes

Hi Guys, I need to write a script capable of identifying when a high cpu utilitzation process. It sounds simple but we are on a AIX 5.3 environment with Virtual CPU's (VP's) and logical CPU's. Please any ideas or tips would be highly appreciated. Thanks. Harby. (6 Replies)
Discussion started by: arizah
6 Replies

7. Shell Programming and Scripting

determine the active processes on the system which are running since long time

Hi , Please help me shell script to determine the active processes on the system which are running since long time (2 Replies)
Discussion started by: itian2010
2 Replies

8. Shell Programming and Scripting

Script for long running processes....

I searched the forums but didn't see anything related to what I'm looking for. I need a script that would give me a listing of jobs running longer than, for example, 12 hours or so. Thanks in advance for your assistance!! (2 Replies)
Discussion started by: CyberOptiq
2 Replies

9. Shell Programming and Scripting

identify the unix processes performing high disk i/o reads and writes

I would like to write shell/perl script which identifies the top unix processes that are performing high disk I/O's or/and writes If any one knows the solution please help me? -Swamy (0 Replies)
Discussion started by: avsswamy
0 Replies

10. Shell Programming and Scripting

Identify specific processes from different Machine

Hi, i;m getting a hard time on how to have this kind of script. 1. ssh on another machine and check if a specific process is running and notify in there is a problem. SOS!!!!!!!!!!!!! :( (2 Replies)
Discussion started by: tungaw2004
2 Replies
Login or Register to Ask a Question