BSD Newsletter.com
   Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?
Advertisement: The OpenBSD PF Packet Filter Book: PF for NetBSD, FreeBSD, DragonFly and OpenBSD

BSD Links
·New Links
·Advocacy
·Drivers
·Events
·Flavours
·FAQs
·Guides
·Programming
·Security
·Software
·User Groups

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

Concept

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.

Introduction

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 accton command with the path to the file to store the data as the argument, commonly at /var/account/acct.

System accounting is turned off by running accton without any arguments.

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"

Examples

Practice Exercises

More information

ac(8), sa(8), accton(8), lastcomm(1), last(1)



Front | Information | Lists | Newsfeeds