[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
System Management Guide: Operating System and Devices

Setting Up an Accounting System

Prerequisites

You must have root authority to complete this procedure.

Procedure

The following is an overview of the steps you must take to set up an accounting system. Refer to the commands and files noted in these steps for more specific information.

  1. Enter the nulladm command to ensure that each file has the proper access permission: read (r) and write (w) permission for the file owner and group and read (r) permission for others:
    /usr/sbin/acct/nulladm wtmp pacct
    This provides access to the pacct and wtmp files.

  2. Update the /etc/acct/holidays file to include the hours you designate as prime time and to reflect your holiday schedule for the year.
    Note: Comment lines can appear anywhere in the file as long as the first character in the line is an * (asterisk).
    1. To define prime time, fill in the fields on the first data line (the first line that is not a comment), using a 24-hour clock. This line consists of three 4-digit fields, in the following order:
      • Current year
      • Beginning of prime time (hhmm)
      • End of prime time (hhmm)
      Leading blanks are ignored. You can enter midnight as either 0000 or 2400.

      For example, to specify the year 1984, with prime time beginning at 8:00 a.m. and ending at 5:00 p.m., enter:

      1984  0800  1700
    2. To define the company holidays for the year on the next data line. Each line contains four fields, in the following order:
      • Day of the year
      • Month
      • Day of the month
      • Description of holiday
      The day-of-the-year field contains the number of the day on which the holiday falls and must be a number from 1 through 365 (366 on leap year). For example, February 1st is day 32. The other three fields are for information only and are treated as comments.

      A two-line example follows:

        1  Jan  1 
       New Year's Day332  Nov 28  
      Thanksgiving Day 
  3. Turn on process accounting by adding the following line to the /etc/rc file or by deleting the comment symbol (#) in front of the line if it exists:
    /usr/bin/su - adm -c /usr/sbin/acct/startup
    The startup procedure records the time that accounting was turned on and cleans up the previous day's accounting files.

  4. Identify each file system you want included in disk accounting by adding the following line to the stanza for the file system in the /etc/filesystems file:
    account = true
  5. Specify the data file to use for printer data by adding the following line to the queue stanza in the /etc/qconfig file:
    acctfile = /var/adm/qacct
  6. As the adm user, create a /var/adm/acct/nite, /var/adm/acct/fiscal, and /var/adm/acct/sum directory to collect daily and fiscal period records:
    su - adm
    cd /var/adm/acct
    mkdir nite fiscal sum
    exit
  7. Set daily accounting procedures to run automatically by editing the /var/spool/cron/crontabs/root file to include the dodisk, ckpacct, and runacct commands. For example:
    0 2 * * 4 /usr/sbin/acct/dodisk
    5 * * * * /usr/sbin/acct/ckpacct
    0 4 * * 1-6 /usr/sbin/acct/runacct
                  2>/var/adm/acct/nite/accterr
    The first line starts disk accounting at 2:00 a.m. (0 2) each Thursday (4). The second line starts a check of the integrity of the active data files at 5 minutes past each hour (5 *) every day (*). The third line runs most accounting procedures and processes active data files at 4:00 a.m. (0 4) every Monday through Saturday (1-6). If these times do not fit the hours your system operates, adjust your entries.
    Note: You must have root user authority to edit the /var/spool/cron/crontabs/root file.
  8. Set the monthly accounting summary to run automatically by including the monacct command in the /var/spool/cron/crontabs/root file. For example:
    15 5 1 * * /usr/sbin/acct/monacct
    Be sure to schedule this procedure early enough to finish the report. This example starts the procedure at 5:15 a.m. on the first day of each month.

  9. To submit the edited cron file, enter:
    crontab /var/spool/cron/crontabs/root

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]