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.
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.
PATH= /usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin: /usr/sbin/acct:/var/adm/acct ; export PATH
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.
Leading blanks are ignored. Midnight can be entered as either 0000 or 2400.
For example, to specify the year 1992 with prime time beginning at 8:00 a.m. and ending at 5:00 p.m., specify:
1992 0800 1700
account = true
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:
Another method of adding this entry to the qconfig file would be to enter the command smitty chque. Then follow the next steps:
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.
su - adm cd /var/adm/acct mkdir nite fiscal sum chown adm:adm nite fiscal sum chmod 755 nite fiscal sum exit
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
If the free space in /var falls below 500 blocks, then ckpacct turns off accounting until space is made available. A loss of accounting data will result during the period that accounting is turned off. ckpacct will turn accounting on again when more space is available. THERE IS NO NOTIFICATION unless the MAILCOM variable is set as follows:
MAILCOM="mail root adm"
The variable can be set in the ckpacct and runacct scripts or in the /etc/environment file. If MAILCOM is set in both places the setting in ckpacct and runacct will be used.
/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.
The meaning of the fields in the accounting Daily Usage Report are as follows:
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
acctcms acctmerg acctcom acctprc acctcon acctprcl acctdisk acctprc2All of these accounting commands accept input from standard input (as in acctcms < /usr/adm/pacct) and redirect to standard output (as in acctcmd < /usr/adm/pacct > /tmp/report). Find out which accounting file is being used as standard input and where the output is being directed by entering:
acct_cmd < In_file > Out_file
setup wtmpfix connect1 connect2 process merge fees disk queueacct mergetacct cms userexit cleanup