|Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?|
This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at http://bsdwiki.reedmedia.net/wiki/Enable_accounting_and_view_system_usage_statistics.html.
Enable accounting and view system usage statistics
Be aware of when it is appropriate to enable system accounting, recognize which utilities are available to do so, and know how to view the resulting statistics.
The kernel keeps track of various attributes of all processes and, when system accounting is enabled, this information is saved when the process terminates. The accounting information includes the command name, the starting time, the amount of time used by the system and the user (TODO: explain that), the elapsed time, the user ID and group ID, the average amount of memory used, the count of I/O operations, and the terminal (tty) where the process was started. The accounting also records if the process was forked without replacing the parent process (exec) and how the process was terminated (such as with core dump or killed by a signal).
The system accounting is enabled by running the
System accounting is turned off by running
TODO: show how is enabled at boot time on all BSDs
TODO: show example of data; show examples of sa, ac, accton, lastcomm
TODO: not the same, but also cover "last"
ac(8), sa(8), accton(8), lastcomm(1), last(1)