System Administration Guide, Volume 2

Accounting Files

The /var/adm directory structure contains the active data collection files.

The following table describes the accounting related files in the /var/adm directory.

Table 32-8 Files in the /var/adm Directory

File 

Description 

dtmp

Output from the acctdusg program

fee

Output from the chargefee program, ASCII tacct records

pacct

Active process accounting file  

pacctn

Process accounting files switched using turnacct

Spacctn.MMDD

Process accounting files for MMDD during execution of runacct

The /var/adm/acct directory contains the nite, sum, and fiscal directories, which contain the actual data collection files. For example, the nite directory contains files that are reused daily by the runacct procedure. A brief summary of the files in the /var/adm/acct/nite directory follows.

Table 32-9 Files in the /var/adm/acct/nite Directory

File 

Description 

active

Used by runacct to record progress and print warning and error messages

activeMMDD

Same as active after runacct detects an error

cms

ASCII total command summary used by prdaily

ctacct.MMDD

Connect accounting records in tacct.h format

ctmp

Output of acctcon1 program, connect session records in ctmp.h format (acctcon1 and acctcon2 are provided for compatibility purposes)

daycms

ASCII daily command summary used by prdaily

daytacct

Total accounting records for one day in tacct.h format

disktacct

Disk accounting records in tacct.h format, created by the dodisk procedure

fd2log

Diagnostic output during execution of runacct

lastdate

Last day runacct executed (in date +%m%d format)

lock

Used to control serial use of runacct

lineuse

tty line usage report used by prdaily

log

Diagnostic output from acctcon

log.MMDD

Same as log after runacct detects an error

owtmp

Previous day's wtmpx file

reboots

Beginning and ending dates from wtmpx and a listing of reboots

statefile

Used to record current state during execution of runacct

tmpwtmp

wtmpx file corrected by wtmpfix

wtmperror

Place for wtmpfix error messages

wtmperror.MMDD

Same as wtmperror after runacct detects an error

wtmp.MMDD

runacct's copy of the wtmpx file

The sum directory contains the cumulative summary files updated by runacct and used by monacct. A brief summary of the files in the /var/adm/acct/sum directory is shown in the following table.

Table 32-10 Files in the /var/adm/acct/sum Directory

File 

Description 

cms

Total command summary file for current fiscal period in internal summary format  

cmsprev

Command summary file without latest update  

daycms

Command summary file for the day's usage in internal summary format  

loginlog

Record of last date each user logged on; created by lastlogin and used in the prdaily program

rprt.MMDD

Saved output of prdaily program

tacct

Cumulative total accounting file for current fiscal period  

tacctprev

Same as tacct without latest update

tacct.MMDD

Total accounting file for MMDD

The fiscal directory contains periodic summary files created by monacct. A brief description of the files in the /var/adm/acct/fiscal directory is shown in the following table.

Table 32-11 Files in the /var/adm/acct/fiscal Directory

File 

Description 

cmsn

Total command summary file for fiscal period n in internal summary format

fiscrptn

Report similar to rprtn for fiscal period n

tacctn

Total accounting file for fiscal period n

Files Produced by runacct

The most useful files produced by runacct (found in /var/adm/acct) are shown in the following table.

Table 32-12 Files Produced by runacct

File  

Description 

nite/lineuse

runacct calls acctcon to gather data on terminal line usage from /var/adm/acct/nite/tmpwtmp and writes the data to /var/adm/acct/nite/lineuse. prdaily uses this data to report line usage. This report is especially useful for detecting bad lines. If the ratio between the number of logouts to logins is greater than about three to one, there is a good possibility that the line is failing.

nite/daytacct

This file is the total accounting file for the day in tacct.h format.

sum/tacct

This file is the accumulation of each day's nite/daytacct and can be used for billing purposes. It is restarted each month or fiscal period by the monacct procedure.

sum/daycms

runacct calls acctcms to process the data about the commands used during the day. This information is stored in /var/adm/acct/sum/daycms. It contains the daily command summary. The ASCII version of this file is /var/adm/acct/nite/daycms.

sum/cms

This file is the accumulation of each day's command summaries. It is restarted by the execution of monacct. The ASCII version is nite/cms.

sum/loginlog

runacct calls lastlogin to update the last date logged in for the logins in /var/adm/acct/sum/loginlog. lastlogin also removes from this file logins that are no longer valid.

sum/rprt.MMDD

Each execution of runacct saves a copy of the daily report that was printed by prdaily.