Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login(1)

acct(8)

acctmerg(8)

fwtmp(8)

init(8)

acct(2)

acctcon(8)  —  Maintenance

NAME

acctcon1, acctcon2 − Display connect-time accounting summaries

SYNOPSIS

acctcon1 [−l file] [−o file] [−p] [−t]

acctcon2

FLAGS

−l fileWrites line-usage format from the input file (usually /var/adm/wtmp) to file for the accounting period during which the file /var/adm/wtmp is active.  The following example shows the ASCII line-usage heading format:

TOTAL DURATION: 57 MINUTES
LINE           MINUTES    PERCENT    # SESS    # ON    # OFF
pty/ttyp4         37           64        3      3       7
console           26           45        2      2       4
pty/ttyp5          7           11        1      1       3
pty/ttyp6          0            0        0      0       2
TOTALS            69            -        6      6      16

TOTAL DURATION specifies the total number of minutes used for connect sessions during the accounting period during which the /var/adm/wtmp file is active.  The columns specify the line name, the number of session minutes used, the percentage of total elapsed time used for the sessions, the number of sessions charged, the number of logins, and the number of logouts.  The last line in the line-usage file totals the entries for each column. 

The line-usage format helps to track line usage and identify bad lines.  All hangups, terminations of the login command, and terminations of the login shell cause the system to write logout records, so that the number of logouts is often greater than the number of sessions. 

−o fileWrites an overall-record format to file from the input file (usually /var/adm/wtmp) for the accounting period during which the /var/adm/wtmp file is active.  The following example shows the overall-record format:

from mon day date hh:mm:ss yyyy tz
to   mon day date hh:mm:ss yyyy tz
2    date changes  Number of times the date was changed.
21   acctg off     Number of times accounting functions
                   were turned off.
25   run-level S   Number of times accounting functions
                   ran in single-user mode.
108  system boot   Number of times the system was rebooted.
21   acctg on      Number of times accounting functions
                   were turned on.
21   acctcon1      Number of times the acctcon1 command
                   was issued.

The first lines specify the date and time stamp, including time zone, of the accounting period start time and end time. 

−pWrites the input file (usually /var/adm/wtmp) to the default output device.  For example:

pty/ttyp1  hoff   616883748  Jul  19  16:35:48  1990  EST
pty/ttyp1  hoff   616883825  Jul  19  16:37:05  1990  EST
pty/ttyp1  LOGIN  616883833  Jul  19  16:37:13  1990  EST
pty/ttyp1  tom    616883837  Jul  19  16:37:17  1990  EST

The output columnar format lists the line reference name, the login name, the time in seconds since January 1, 1970, 0 hours, 0 minutes, 0 seconds, the date, the 24-hour clock time, the year, and the time zone. 

−tUses the last time found in the input file as the ending time for any current processes.  This time, rather than current time, is necessary to have reasonable and repeatable values for noncurrent files.  The output format is the same as the default output format. 

The acctcon1 command also maintains a list of ports on which users are logged in.  When the acctcon1 command reaches the end of its input, a session record is written for each port that still appears to be active.  The acctcon1 command assumes that the input source is the current file and uses current time as the ending time for each session still in progress. 

DESCRIPTION

The acctcon1 and acctcon2 commands are described separately. 

acctcon1

The acctcon1 command is invoked by the runacct shell procedure to write a sequence of login and logout records.  One record for each connect session is written to the specified destination as a sequence of login session records.  The /var/adm/wtmp source file should be directed as input to the command. 

The following example shows the default ASCII columnar output format:

285212673  1192  hoff 85    0     616883748  Jul 19 16:35:48  1990 EST
285212673  1033  tom  10    0     616883837  Jul 19 16:37:17  1990 EST
285212673  0     root 1345  2852  616883855  Jul 19 16:37:35  1990 EST
285212673  1120  jim  0     62    616888058  Jul 19 17:47:38  1990 EST

The columns contain the following information:

       •Device address, expressed as a decimal equivalent of the major/minor device address at which the connection was activated. 

       •User ID assigned for the connect-session record. 

       •Login name under which the session took place. 

       •Total number of prime-time seconds for the connect session. 

       •Total number of nonprime-time seconds for the connect session. 

       •Seconds since the date 0 hours, 0 minutes 0 seconds, 1 January 1970. 

       •Month, day of the month, connect-session starting time, year, and time zone. 

The order of date and time information is locale dependent.  The timestamps shown use the default format for date and time values; however, you can define the NLTIME environment variable to change this format. 

acctcon2

The acctcon2 command is invoked by the runacct shell procedure.  It converts a sequence of login session records produced by the acctcon1 command into connect-time total accounting records.  These records are often merged with other total accounting records with the acctmerg command to produce a daily report. 

EXAMPLES

The following example converts login records to a default format login session record report:

acctcon1 -t /var/adm/lineuse -o /var/adm/reboots \
              < /var/adm/wtmp > /var/adm/logsess

The previous example generates three files.  The /var/adm/logsess file lists ending date and 24-hour timestamp records that correspond with the last time that input was obtained with the −t flag.  For the accounting period covered by the /var/adm/wtmp file, the /var/adm/lineuse line-usage summary file is generated by the −l flag, and the /var/adm/reboots overall record file is obtained with the −o flag. 

The following example converts a series of login session records in the /var/adm/logsess file to a total accounting record in the /var/adm/logacct binary file:

acctcon2 < /var/adm/logsess > /var/adm/logacct

FILES

/usr/sbin/acct/acctcon1
Specifies command path.

/usr/sbin/acct/acctcon2
Specifies command path.

/var/adm/wtmpThe active login/logout database file. 

/usr/include/sys/acct.h, /usr/include/utmp.h
Accounting header files that define formats for writing accounting files.

RELATED INFORMATION

Commands: login(1), acct(8), acctmerg(8), fwtmp(8), init(8)

Functions: acct(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026