AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
#Operatingsystems
#Servers
 View Only
  • 1.  report CPU activity

    Posted 03/22/10 10:53 AM

    Originally posted by: tttttttttttt


    I want to get a report file about CPU usage percent for one specific process (such as java) in a period of time every some interval. Then I will download the file to windows and draw a diagram. Could you please suggest the aix command or shell script for this task? I have tried the topas but its output can not be writen to a file.

    Also I need similar report about CPU usage for the whole system. Also need draw a diagram with the report output.

    Will appreciate for you help!
    #AIX-Forum


  • 2.  Re: report CPU activity

    Posted 03/22/10 11:30 PM

    Originally posted by: SystemAdmin


    Check out the man pages for topasrec and topasout; not that I have used them.

    The other option is to install nmon. Personally, I find it superior to topas, and you can use the available nmon2web.pl program to generate web-based graphics.
    #AIX-Forum


  • 3.  Re: report CPU activity

    Posted 03/23/10 09:02 AM

    Originally posted by: higby


    You could imbed 'ps auxw' in a script that runs every few minutes. The script would simply select the line that contains your process and, within that, pick out the 3rd column (CPU%). If you know the pid, it's easy with awk:

    1. assume you pid is 962656
    cpu_pct=$(ps auxw|awk ' ($2 == 962656) {print $3}')
    echo $cpu_pct >> fileout

    Then upload fileout to Windows and graph it.

    If your script doesn't know the pid, you would have to be able to identify the line associated with the process by either looking at the 'COMMAND' column and/or the STIME (start time) and/or the USER column. Hopefully your script could then grep out or awk out the one process line you need somehow.
    #AIX-Forum