[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
System Management Guide: Operating System and Devices

Showing CPU Usage

You can display formatted reports about the CPU usage by process or by user with a combination of the acctprc1, acctprc2, and prtacct commands.

Prerequisites

The acctprc1 command requires input in the total accounting record form (acct file format). This implies that you have process accounting turned on or that you have run process accounting in the past. See "Setting Up an Accounting System" for guidelines.

Show CPU Usage for Each Process

To produce a formatted report of CPU usage by process, enter:

acctprc1 </var/adm/pacct

This information will be useful in some situations, but you will probably also want to summarize the CPU usage by user. The output from this command is used in the next procedure to produce that summary.

Show CPU Usage for Each User

  1. Produce an output file of CPU usage by process by entering:
    acctprc1 </var/adm/pacct >out.file
    The /var/adm/pacct file is the default output for process accounting records. You may want to specify an archive pacct file instead.

  2. Produce a binary total accounting record file from the output of the previous step by entering:
    acctprc2 <out.file >/var/adm/acct/nite/daytacct
    Note: The daytacct file is merged with other total accounting records by the acctmerg command to produce the daily summary record, /var/adm/acct/sum/tacct.
  3. Display a formatted report of CPU usage summarized by user by entering:
    prtacct </var/adm/acct/nite/daytacct

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]