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

Commands Reference, Volume 1


acctprc1, acctprc2, or accton Command

Purpose

Performs process-accounting procedures.

Syntax

/usr/sbin/acct/acctprc1InFile ]

/usr/sbin/acct/acctprc2

/usr/sbin/acct/acctonOutFile ]

Description

The three acctprc commands, acctprc1, acctprc2, and accton, are called by the runacct command to perform process-accounting shell procedures.

The acctprc1 command reads records from standard input that are in the acct format, adds the login names that correspond to user IDs, and then writes an ASCII record to standard output. This record contains the user ID, login name, prime CPU time, nonprime CPU time, the total number of characters transferred (in 1024-byte units), the total number of blocks read and written, and mean memory size (in 64-byte units) for each process.

If specified, the InFile parameter contains a list of login sessions in utmp format, sorted by user ID and login name. If the File parameter is not specified, acctprc1 gets login names from the/etc/passwd password file. The information in the InFile parameter helps distinguish among different login names that share the same user ID.

The acctprc2 command reads (from standard input) the records written by the acctprc1 command, summarizes them by user ID and name, and writes the sorted summaries to standard output as total accounting records.

When the accton command is used without parameters, process accounting is turned off. If you specify the OutFile parameter (an existing file), process accounting is turned on, and the kernel adds records to that file. You must specify the OutFile parameter for process accounting to start. The OutFile parameter is not created by the accton command. The file specified by the OutFile parameter must already exist with the proper group, owner, and permissions. Many shell scripts expect the /var/adm/pacct file.

Security

Access Control: These commands should grant execute (x) access only to members of the adm group.

Examples

  1. To add a user name to each process-accounting record in a binary file and convert the records to an ASCII file named out.file, enter the following commands or use the lines in a shell script:

    /usr/sbin/acct/acctprc1 < /var/adm/pacct >out.file
    
  2. To produce a total accounting record of the ASCII output file in example 1, enter the following commands or use the lines in a shell script:

    /usr/sbin/acct/acctprc2 < out.file > \
    /var/adm/acct/nite/daytacct 
    

    The resulting file is a binary total accounting file in tacct format, containing individual records sorted by user ID. The file /var/adm/acct/nite/daytacct is merged with other total accounting records by the acctmerg command to produce the daily summary record in the /var/adm/acct/sum/tacct file.

  3. To turn off process accounting, enter:

    /usr/sbin/acct/accton
    

Files


/usr/sbin/acct/acctprc1 Contains the acctprc1 command.
/usr/sbin/acct/acctprc2 Contains the acctprc2 command.
/usr/sbin/acct/accton Contains the accton command.
/etc/accton Symbolic link to the actual accton command directory.
/etc/passwd Contains the basic user attributes, including the user IDs used by the acctprc1 command.

Related Information

The acctmerg command,runacct command.

The acct file format, utmp file format.

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.1 System Management Concepts: Operating System and Devices.

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

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

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


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