Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 19

Managing System Accounting (Tasks)

This section describes how to set up and maintain system accounting.

This is a list of the step-by-step instructions in this chapter.

This is a list of the overview information in this chapter.

For information on using extended accounting, see "Extended Accounting" in System Administration Guide: Resource Management and Network Services.

For reference information on the various system accounting reports, see Chapter 20, System Accounting (Reference).

What is System Accounting?

The SunOS 5.9 system accounting software is a set of programs that enables you to collect and record data about user connect time, CPU time charged to processes, and disk usage. Once you collect this data, you can generate reports and charge fees for system usage.

You can use the accounting programs to:

  • Monitor system usage

  • Locate and correct performance problems

  • Maintain system security

After you set up the system accounting programs, they run mostly on their own.

How System Accounting Works

Automatic accounting is set up by first putting the accounting startup script into root's crontab file. The accounting startup script can then be started automatically by the cron command.

The following overview illustrates the system accounting process.

  1. Between system startup and shutdown, raw data about system use (such as user logins, running processes, and data storage) are collected in accounting files.

  2. Periodically (usually once a day), the /usr/lib/acct/runacct script processes the various accounting files and produces both cumulative summary files and daily accounting reports. Then the /usr/lib/acct/prdaily script prints the daily reports.

    For more information about the runacct script, see "The runacct Script".

  3. Monthly, you can process and print the cumulative runacct summary files by executing the monacct script. The summary reports produced by the monacct script provide an efficient means for billing users on a monthly or other fiscal basis.

System Accounting Components

The accounting software provides C language programs and shell scripts that organize data into summary files and reports. These programs reside in the /usr/lib/acct directories. The accounting reports reside in the /var/adm/acct directory.

Daily accounting can help you perform four types of auditing:

  • Connect

  • Process

  • Disk

  • Fee calculations

Connect Accounting

Connect accounting enables you to determine:

  • The length of time a user was logged in

  • How the tty lines are being used

  • The number of reboots on your system

  • How many times the accounting software was turned off and on

To provide this information, the system stores:

  • Records of time adjustments

  • Boot times

  • Times the accounting software was turned off and on

  • Changes in run levels

  • The creation of user processes (login processes and init processes), and the terminations of processes.

 
 
 
  Previous   Contents   Next