Run ps aux continuously in AIX


 
Thread Tools Search this Thread
Operating Systems AIX Run ps aux continuously in AIX
# 1  
Old 07-30-2013
Run ps aux continuously in AIX

Requirement is to monitor cpu usage /process for a user given time and record the output.
Code:
topas,topasout,topasrec,tprof

not seems to be working for me. so what i am looking for is to run below command continously till the time limit given by the user who runs the script.since below command is a one iteration , i would like this to run every 2/3 seconds and till the user supplied time. looking for options other than watch.

Code:
ps aux | head -10

# 2  
Old 07-30-2013
Why isn't it possible to put the command into a while-loop, like, i.e. this:

Code:
while : ; do
     ps aux | head -10
     sleep 3
done

Restrict the while-loop somehow if you want it to terminate after some time instead of running forever like now.

I hope this helps.

bakunin
# 3  
Old 07-31-2013
The problem with ps is, that it will show the average CPU-usage since the start of the process. So if it runs already several days and you get a nasty peak for let's say 30 minutes, this will not have the value for CPU-usage rise noticably or maybe even at all.

We had a discussion about this here:
Using "ps" command to find high processes

and this could be a way to try:
Problem with nmon, actual CPU usage per process
# 4  
Old 08-21-2013
@zaxxon

so in general what are the difference b/w ps o/p and
Code:
topas (top or prstat)

in terms of %cpu.

also in an AIX machine what is the better way to monitor cpu utilization for all the process and record this for a time period if needed.
# 5  
Old 08-24-2013
As often in performance related threads/posts in the AIX forum here, it usually tends to have nmon installed and monitor the stuff you need. It monitors more than just CPU and processes, but the other info is usually very helpful too.
Checkout nmon - easy to find via Google on the official IBM sites. In later versions of AIX it is installed by default.

Last edited by zaxxon; 08-25-2013 at 05:54 AM.. Reason: spelling
# 6  
Old 10-08-2013
so in general what are the difference b/w ps o/p and

Code:
topas (top or prstat)

In ps output the cpu percentage is the average percentage since process has started..but the topas output gives the insatantaneous output means at present what is the cpu usage of particular process
# 7  
Old 10-09-2013
Could you pls. wrt. in cmpl. wd.s, not abbr.s? It is quite hard to read and even harder to understand what you mean on one hand and if we all would try to save on keystrokes nobody would even answer you on the other. Thank you for your consideration.

Quote:
Originally Posted by sumanthupar
so in general what are the difference b/w ps o/p and

Code:
topas (top or prstat)

In ps output the cpu percentage is the average percentage since process has started..but the topas output gives the insatantaneous output means at present what is the cpu usage of particular process
Part of the answer you gave already yourself. "In general" the difference is that they show different things. Sorry for the non-answer, but if you want to get specific information you have to ask specific questions.

What exactly do you want to know and how can i help you?

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find the exact process using ps aux command?

Please do not post a technical question in the @How to contact....' forum. I have moved this for you. Hello Everyone, Please help me on this, Requirement here is to check whether the process is running using the process id. For the below scenario, I m trying to grep 1750 process id to... (3 Replies)
Discussion started by: Hari A
3 Replies

2. Shell Programming and Scripting

Get PID Number from “ps aux --sort -rss ”

Hi everyone How can I just get the PID of the following command: ps aux --sort -rss Thanks Regards (2 Replies)
Discussion started by: anonymuser
2 Replies

3. Shell Programming and Scripting

How to run a process continuously for an hour then stop?

Hi I have a shell script I would like to run it has to run twice a day every 5 seconds for an hour I can do this with cron but I was hoping there was an easier way. Is there a way to make a process sleep only at a certain time of day say between 1 and 2 pm? Or under certain conditions? Any help... (8 Replies)
Discussion started by: Paul Walker
8 Replies

4. Shell Programming and Scripting

Extract a column from ps -aux command

Hi, I have the following output : root 9296 81.7 0.2 1115328 20856 ? Sl 14:38 1:00 /opt/h264rtptranscoder.bin --videoPort=14500 --audioPort=14501 --serverPort=14500 --framesPerSecond=50 --profilesPath=/opt/transcodingProfiles I would like to have the following output : ... (6 Replies)
Discussion started by: liviusbr
6 Replies

5. AIX

Difference between ps -ef and ps aux

Hi, Can someone tell me what the difference is between ps -ef and ps aux. I was under the assumption that both commands would list ALL processes currently running on the system. But on my server I find the following: # ps -ef | wc -l 519 # ps aux | wc -l 571 What... (1 Reply)
Discussion started by: petervg
1 Replies

6. Shell Programming and Scripting

ps aux + grep + nice + while

Hi again, well does anyone knows how can i grep a process that right know the only part of the process name that i know is "backup" then renice it if the cpu consumption is more then 90% ... for now i have : a=$(ps aux | grep -c backup ) while $a > 2 #pseudo code do if ; then #... (16 Replies)
Discussion started by: drd0spt
16 Replies

7. Shell Programming and Scripting

Need to get the list of file with size in AUX

to get the list of file name with size Example: rwxrwxrwx 1 cm x 562KB Nov 6 19:22 a rwxrwxrwx 1 cm x 562MB Nov 6 19:22 a edit by bakunin: Please view this code tag video for how to use code tags when posting code and data. (5 Replies)
Discussion started by: Jewel
5 Replies

8. Shell Programming and Scripting

Run a script continuously for 10 minutes

Hi all!! Im using ksh and my OS is Linux. I want to run a script for ten minutes, starting from my current system time. How to acheive this? Any help appreciated. Thanks in advance (5 Replies)
Discussion started by: Jayaraman
5 Replies

9. UNIX for Dummies Questions & Answers

ps aux|grep getty

what is the aim of this command: ps aux|grep getty (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies

10. UNIX for Dummies Questions & Answers

PS -aux and PS

I am new to the Unix. Can someone tell me what is the difference between 'PS' command and 'PS -aux"? Isn't 'PS' mean the current running process? Isn't 'PS -aux' mean the current running process too? If they are the same, how come 'PS -aux' always has a lot more listing than 'PS'? Thanks, (4 Replies)
Discussion started by: a2715mt
4 Replies
Login or Register to Ask a Question