|
|||
1. Managing Terminals and Modems (Overview) 2. Setting Up Terminals and Modems (Tasks) 3. Managing Serial Ports With the Service Access Facility (Tasks) 4. Managing System Resources (Overview) 5. Displaying and Changing System Information (Tasks) 8. Scheduling System Tasks (Tasks) 9. Managing System Accounting (Tasks) What's New in System Accounting How to Set Up System Accounting Maintaining Accounting Information How to Fix a Corrupted wtmpx File How to Restart the runacct Script Stopping and Disabling System Accounting How to Temporarily Stop System Accounting How to Permanently Disable System Accounting 10. System Accounting (Reference) 11. Managing System Performance (Overview) 12. Managing System Processes (Tasks) 13. Monitoring System Performance (Tasks) 14. Troubleshooting Software Problems (Overview) 16. Managing Core Files (Tasks) 17. Managing System Crash Information (Tasks) 18. Troubleshooting Miscellaneous Software Problems (Tasks) 19. Troubleshooting File Access Problems (Tasks) 20. Resolving UFS File System Inconsistencies (Tasks) |
What is System Accounting?System accounting software in the Solaris OS 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 system accounting on a daily or monthly basis. Or, you can tack disk usage per user. You can use the accounting programs to perform these tasks:
After you set up the system accounting programs, they run mostly on their own. How System Accounting WorksAutomatic 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 describes the system accounting process.
System Accounting ComponentsThe system 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 directory. The accounting reports reside in the /var/adm/acct directory. Daily accounting can help you perform four types of auditing:
Connect AccountingConnect accounting enables you to determine the following information:
To provide this information on connect sessions, the system stores the following data
These records are produced from the output of system programs such as date, init, login, ttymon, and acctwtmp. They are stored in the /var/adm/wtmpx file. Entries in the wtmpx file can contain the following information:
Process AccountingProcess accounting enables you to keep track of the following data about each process that runs on your system:
Every time a process terminates, the exit program collects this information and writes it to the /var/adm/pacct file. Disk AccountingDisk accounting enables you to gather and format the following data about the files each user has on disks:
This data is collected by the /usr/lib/acct/dodisk shell script at intervals that are determined by the entry you add to the /var/spool/cron/crontabs/root file. In turn, the dodisk script invokes the acctdisk and acctdusg commands. These commands gather disk usage by login name. Caution - Information gathered by running the dodisk script is stored in the /var/adm/acct/nite/disktacct file. This information is overwritten the next time the dodisk script is run. Therefore, avoid running the dodisk script twice in the same day. The acctdusg command might overcharge for files that are written randomly, which can create holes in the files. This problem occurs because the acctdusg command does not read the indirect blocks of a file when determining the file size. Rather, the acctdusg command determines the file size by checking the current file size value in the file's inode. Fee CalculationsThe chargefee utility stores charges for special services that are provided to a user in the /var/adm/fee file. A special service, for example, is file restoration. Each entry in the file consists of a user login name, user ID, and the fee. This file is checked by the runacct script every day, and new entries are merged into the accounting records. For instructions on running the chargefee script to bill users, see How to Bill Users. How Daily Accounting WorksHere is a step-by-step summary of how daily accounting works:
What Happens if the System Shuts DownIf the system is shut down by using the shutdown command, the shutacct script is executed automatically. The shutacct script writes a reason record into the /var/adm/wtmpx file and turns off process accounting. |
||
|