[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1

acctcom Command

Purpose

Displays selected process accounting record summaries.

Syntax

/usr/sbin/acct/acctcom [ [ -q | -o File ] | [ -a ] [ -b ] [ -c Classname ] [-f ] [ -h ] [ -i ] [ -k ] [ -m ] [ -r ] [ -t ] [ -v ] [ -w ]] [ -C Seconds ] [ -g Group ] [ -H Factor ] [ -I Number ] [ -l Line ] [ -n Pattern ] [ -O Seconds ] [ -u User ] [ -e Time ] [ -E Time ] [ -s Time ] [ -S Time ] [ File ... ]

Description

The acctcom command reads process accounting records from files specified by the File parameter from standard input or from the /var/adm/pacct file. Then the acctcom command writes the records you request to standard output. This command is stored in the /usr/sbin/acct directory, for access by all users.

If you do not specify a File parameter and if standard input is assigned to a workstation or to the /dev/null file, as when a process runs in the background, the acctcom command reads the /var/adm/pacct file.

If you specify a File parameter, the acctcom command reads each file chronologically by process completion time. Usually, the /var/adm/pacct file is the current file that you want the acctcom command to examine. Because the ckpacct procedure keeps this file from growing too large, a busy system may have several pacct files. All but the current file have the path name /var/adm/pacct?, where ? (question mark) represents an integer.

Each record represents one completed process. The default display consists of the command name, user name, tty name, start time, end time, real seconds, CPU seconds, and mean memory size (in kilobytes). These default items have the following headings in the output:

COMMAND                    START   END    REAL    CPU     MEAN
NAME    USER    TTYNAME    TIME    TIME   (SECS)  (SECS)  SIZE(K)

If a process was run by the root user, the process name is prefixed with a # (pound sign). If a process is not assigned to a known workstation ( for example, when the cron daemon runs the process), a ? (question mark) appears in the TTYNAME field.

Notes:
  1. The acctcom command only reports on processes that have finished. Use the ps command to examine active processes.
  2. If a specified time is later than the current time, it is interpreted as occurring on the previous day.

Security

Access Control: This command should grant execute (x) access to all users.

Flags

-a Shows some average statistics about the processes selected. The statistics are displayed after the output records.
-b Reads backwards, showing the most recent commands first. This flag has no effect when the acctcom command reads standard input.
-c Classname Selects processes belonging to the specified class.

Note: Accounting data cannot be retrieved for a deleted class.
-C Seconds Shows only processes whose total CPU time (system time + user time) exceeds the value specified by the Seconds variable.
-e Time Selects processes existing at or before the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss.
-E Time Selects processes ending at or before the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss. If you specify the same time for both the -E and -S flags, the acctcom command displays the processes that existed at the specified time.
-f Displays two columns related to the ac_flag field of the acct.h file: the first indicates use of the fork command to create a process, the second indicates the system exit value. Refer to the acct structure described in the acct file format in AIX 5L Version 5.2 Files Reference.
-g Group Selects processes belonging to the specified group. You can specify either the group ID or the group name.
-h Instead of mean memory size, shows the fraction of total available CPU time consumed by the process (hog factor). This factor is computed as:

(total CPU time) / (elapsed time)
-H Factor Shows only the processes that exceed the value of the Factor parameter. This factor, called the hog factor, is computed as:

(total CPU time) / (elapsed time)
-i Displays columns showing the number of characters transferred in read or write operations (the I/O counts).
-k Instead of memory size, shows total kcore minutes (memory measurement in kilobyte segments used per minute of run time).
-l Line (lowercase L) Shows only processes belonging to workstation /dev/Line.
-I Number (uppercase i) Shows only processes transferring more than the specified number of characters.
-m Shows mean main-memory size. This is the default. The -h flag or -k flag turn off the -m flag.
-n Pattern Shows only commands matching the value of the Pattern variable, where Pattern is a regular expression. Regular expressions are described in the ed command. In addition to the usual characters, the acctcom command allows you to use a + (plus sign) as a special symbol for the preceding character.
-o File Copies selected process records to the specified file, keeping the input data format. This flag suppresses writing to standard output. This flag cannot be used with the -q flag.
-O Seconds Shows only processes with CPU system time exceeding the specified number of seconds.
-q Displays statistics but not output records. The statistics are the same as those displayed using the -a flag. The -q flag cannot be used with the -o flag.
-r Shows CPU factor. This factor is computed as:

(user-time) / (system-time + user-time)
-s Time Shows only those processes that existed on or after the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss.
-S Time Shows only those processes starting at or after the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss.
-t Shows separate system and user CPU times.
-u User Shows only processes belonging to the specified user. Enter one of the following for the User variable: a user ID, a login name to be converted to a user ID, a # (pound sign) to select processes run by the root user, or a ? (question mark) to select processes associated with unknown user IDs.
-v Eliminates column headings from the output.
-w Displays the classnames to which the processes belong.

Examples

  1. To display information about processes that exceed 2 seconds of CPU time, enter:

    /usr/sbin/acct/acctcom -O 2 < /var/adm/pacct

    The process information is read from the /var/adm/pacct file.

  2. To display information about processes belonging to the finance group, enter:

    /usr/sbin/acct/acctcom -g Finance < /var/adm/pacct

    The process information is read from the /var/adm/pacct file.

  3. To display information about processes that belong to the /dev/console workstation and that run after 5 p.m., enter:

    /usr/sbin/acct/acctcom -l /dev/console -s 17:00 

    The process information is read from the /var/adm/pacct file by default.

Files

/usr/sbin/acct/acctcom Contains the acctcom command.
/var/adm/pacct Contains the current process accounting file.
/etc/group Contains the basic group attributes of groups.
/etc/passwd Contains the basic attributes of users.

Related Information

The ed command, ps command, runacct command, su command.

The cron daemon.

The acct subroutine.

The acct file format, utmp, wtmp, failedlogin file format.

Accounting Commands in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices.

For more information about the accounting system, the preparation of daily and monthly reports, and the accounting files, see the Accounting Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices.

Setting Up an Accounting System in AIX 5L Version 5.2 System Management Guide: Operating System and Devices describes the steps you must take to establish an accounting system.

Performance Monitoring and Tuning Commands and Subroutines in AIX 5L Version 5.2 Performance Management Guide

The environment File describes environment variables and their functions.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]