This document describes the accounting setup procedures for AIX Versions 4.1, 4.2, and 4.3. Documentation requires the setup person to be the root user. In this document, the 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. Modifying the root profile is optional, but will help with administration.
The AIX and RS/6000 product documentation library is also available:
http://www.rs6000.ibm.com/resource/
Make sure the bos.acct fileset is installed. Enter:
lslpp -l bos.acct
This command should report the state as COMMITTED or APPLIED if the fileset is installed. To get the latest level software for the bos.acct fileset, refer to the section Fixes and Problems 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:
enq -d
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:
/var/adm/qacct
The pac command (printer accounting command) is more versatile because it allows separate accounting files for each printer.
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 in as root and enter:
su - adm -c crontab -e
This will bring up the adm crontab file 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 Versions 4.1, 4.2, or 4.3 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 displays a message to use -Uxxxx.)
acctcms acctmerg acctcom acctprc acctcon acctprc1 acctdisk acctprc2
All 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
If accounting is started via cron, note the crontab file entries. If accounting is run from root, then the entry is in /usr/spool/cron/crontabs/root. If accounting is run from adm then the entry is in /usr/spool/cron/crontabs/adm.
setup wtmpfix connect1 connect2 process merge fees disk queueacct mergetacct cms userexit cleanup