acctcon(ADM)


acctcon: acctcon1, acctcon2 -- connect-time accounting

Syntax

/usr/lib/acct/acctcon1 [ -ptx ] [ -l lfile ] [ -o ofile ]

/usr/lib/acct/acctcon2

Description

acctcon1 converts a sequence of login/logoff records read from its standard input to a sequence of records, one per login session. Its input should normally be redirected from /etc/wtmp. Its output is ASCII giving device, user IDs, login name, prime connect time (seconds), non-prime connect time (seconds), session starting time (numeric), and starting date and time.

acctcon1 understands the following options:


-l lfile
lfile is created to contain a summary of line usage showing line name, number of minutes used, percentage of total elapsed time used, number of sessions charged, number of logins, and number of logoffs. This file helps track line usage, identify bad lines, and find software and hardware oddities. Hang-up, termination of login(M) and termination of the login shell each generate logoff records, so that the number of logoffs is often three to four times the number of sessions. See init(M) and utmp(F).

-o ofile
ofile is filled with an overall record for the accounting period, giving starting time, ending time, number of reboots, and number of date changes.

-p
Print input only, showing line name, login name, and time (in both numeric and date/time formats).

-t
acctcon1 maintains a list of lines on which users are logged in. When it reaches the end of its input, it creates a session record for each line that still appears to be active. It normally assumes that its input is a current file, so that it uses the current time as the ending time for each session still in progress. The -t flag causes it to use, instead, the last time found in its input, thus assuring reasonable and repeatable numbers for non-current files.

-x
Generate fake logout events for users who are still logged in when accounting is run.
acctcon2 expects as input a sequence of login session records and converts them into total accounting records (see tacct format in acct(FP)).

Examples

These commands are typically used as shown below. The file ctmp is created only for the use of acctprc(ADM) commands:

/usr/lib/acct/acctcon1 -t -l lineuse -o reboots <wtmp | sort +1n +2 >ctmp
/usr/lib/acct/acctcon2 <ctmp | acctmerg >ctacct

Limitations

The line usage report is confused by date changes. Use wtmpfix (see fwtmp(ADM)) to correct this situation.

At the beginning of every year, the file /usr/lib/acct/holidays should be updated with the appropriate holidays for the new year, or acctcon1 will become confused when attempting to report on prime/non-prime connect times.

Saturday and Sunday are assumed to be holidays.

Files

/etc/wtmp

See also

acct(ADM), acct(FP), ,acct(S-osr5) acctcms(ADM), acctcom(ADM), acctmerg(ADM), acctprc(ADM), acctsh(ADM), fwtmp(ADM), init(M), runacct(ADM), utmp(F)

Standards conformance

acctcon1 and acctcon2 are conformant with AT&T SVID Issue 2.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005