Setup of System Accounting in AIX 3.2


About This Document
      Related Documentation
What to Install to Get Accounting Working on a System
Steps for Modifying the Root User Profile
Steps for Setting Up System Accounting
Fields of the Daily Usage Report
Fixes and Problems
Diagnosing Problems

About This Document

This document describes the accounting setup procedures for AIX Version 3.2.

The setup of system accounting as documented in the 3.2 AIX InfoExplorer has some errors. This document describes the Version 3.2 setup procedures and provides the corrections to enable system accounting under AIX version 3.2.

Access to the InfoExplorer and system documentation for AIX Version 3.2 require the setup person to be root. In this document, root user will be used for setting up system accounting and the user adm for running the reports.

Modify the root user .profile to provide access to the required executables. Modification of the root profile is optional, but will probably help with administration.

Related Documentation


What to Install to Get Accounting Working on a System

Make sure the following product is installed:

    bosext2.acct.obj - 'lslpp -l bosext2.acct.obj' 

This command should report the state as COMMITTED or APPLIED if the fileset is installed. To get the latest level accounting software, refer to the section "Fixes and Problems" later in this document.

Steps for Modifying the Root User Profile

  1. Log in as root.
  2. Edit the .profile file with your favorite text editor.
  3. Locate the PATH statement in the .profile file. It must include the /usr/sbin/acct and /var/adm/acct directories as shown in the following example:
       PATH= /usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin: 
           /usr/sbin/acct:/var/adm/acct ; export PATH 
  4. Locate the export statement in the .profile. If the PATH statement given above was not used, the PATH variable must be included.

Steps for Setting Up System Accounting

  1. Log in to the system as root user. As described previously, root is the accounting administrator.

  2. Enter:
       su - adm -c /usr/lib/acct/nulladm  /var/adm/wtmp  /var/adm/pacct 

    This command ensures correct permissions and provides access to the wtmp and pacct files.

  3. Update the /etc/acct/holidays file for the current year using a favorite text editor. The following notes will help clarify the format of this file:

  4. The file systems that will be included for accounting information need to be configured in the /etc/filesystems file. For each file system that will be included, add the following information to its stanza:
       account = true 
  5. Indicate the data file that will be used for printer data by adding the following line to the /etc/qconfig stanza for that printer:
       acctfile = /var/adm/qacct 

    This entry must be added to the queue stanza and not the device stanza. If the entry is added by editing the /etc/qconfig file, enter the following command to re-digest the qconfig file:

        enq -d 

    Another method of adding this entry to the qconfig file would be to enter the command smitty chque. Then follow the next steps:

    1. Select queue name.
    2. Enter /var/adm/qacct for the ACCOUNTING FILE pathname.

    These steps will update the appropriate stanza in /etc/qconfig file and will re-digest the qconfig file.

    NOTE: The printer accounting will not record usage for network printers, transparent printers, or PostScript printers. In addition, all print queues must use the same accounting file:


    The pac command (printer accounting command) is more versatile because it allows separate accounting files for each printer. For more information, see InfoExplorer.

  6. Create directories /var/adm/acct/nite, /var/adm/acct/fiscal, and /var/adm/acct/sum if they do not already exist. These directories should be owned by the user adm with a group ID of "adm". Use the following series of commands to create these directories:
       su - adm 
       cd /var/adm/acct 
       mkdir nite fiscal sum 
       chown adm:adm nite fiscal sum 
       chmod 755 nite fiscal sum 
  7. Modify the crontabs file for the adm user for automated accumulation of accounting data. The crontabs file for the adm user is in /var/spool/cron/crontabs/adm.

    To edit the adm crontab, log on as root and enter:

       su - adm -c crontab -e 

    This will bring up the adm crontabfile in a vi session. You may need to uncomment or add some entries, and times may need to be modified to suit the installation's time requirements. An example of the entries needed is as follows:

    10 23 * * 0-6 /usr/lib/acct/runacct 2> \ 
       /usr/adm/acct/nite/accterr > /dev/null 
    0 23 * * 0-6 /usr/lib/acct/dodisk > /dev/null 2>&1 
    0 * * * * /usr/lib/acct/ckpacct > /dev/null 2>&1 
    15 4 1 * * /usr/lib/acct/monacct > /dev/null 2>&1 

  8. Turn on process accounting by adding the following line to the /etc/rc file.
         /usr/bin/su - root  -c  /usr/sbin/acct/startup 

    The startup command records the time that accounting was turned on and cleans up the previous day's accounting files.

    If the system is not going to be rebooted at this time, run the preceding startup command from the root command line to start process accounting.

Fields of the Daily Usage Report

The meaning of the fields in the accounting Daily Usage Report are as follows:

User ID number
Login name of user
Cumulative CPU minutes during prime hours
During non-prime hours
Cumulative minutes spent in the kernel during prime hours
During non-prime hours
Cumulative blocks transferred during prime hours
During non-prime hours
Cumulative blocks read/written during prime hours
During non-prime hours
Cumulative connect time (minutes) during prime hours
During non-prime hours
Cumulative disk usage
Queuing system charges (pages)
Fee for special services
Count of processes
Count of login sessions
Count of count of disk samples

Fixes and Problems

Fixes for AIX Version 3.2.5 and later can be downloaded via the Internet with the FixDist service.

On very large systems, if there are over 1000 users in the /etc/passwd file, the /usr/sbin/acct/dodisk script must be changed. At line 136 in dodisk, the diskusg command must be changed to read as follows:

diskusg -Unnnnn $args > dtmp 

nnnnn is the new maximum number of users for which disk accounting should be done. (When the maximum number is too small, the dodisk script will return an error message that tells the user to use -uxxxx. It should say -Uxxxx.)

On AIX 3.2.5 and Greater

Diagnosing Problems

General Information Needed

When Accounting Fails

  1. Check to see what state accounting is in. Look at the /usr/adm/acct/nite/active file. States are as follows:
  2. Check accterr for additional messages.
  3. Refer to section "How To Fix General Accounting Problems" in InfoExplorer.
  4. Restart runaccount.

Other Items to Check

Setup of System Accounting in AIX 3.2: acct.setup.32.cmd ITEM: FAX
Dated: 99/05/21~00:00 Category: cmd
This HTML file was generated 99/06/24~12:41:55
Comments or suggestions? Contact us