Go to main content

Administering Resource Management in Oracle® Solaris 11.4

Exit Print View

Updated: August 2018

How Extended Accounting Works

The extended accounting facility in the Oracle Solaris operating system uses a versioned, extensible file format to contain accounting data. Files that use this data format can be accessed or be created by using the API provided in the included library, libexacct (see the libexacct(3LIB) man page). These files can then be analyzed on any platform with extended accounting enabled, and their data can be used for capacity planning and chargeback.

If extended accounting is active, statistics are gathered that can be examined by the libexacct API. The libexacct API allows examination of the exacct files either forward or backward. The API supports third-party files that are generated by libexacct as well as those files that are created by the kernel. There is a Practical Extraction and Report Language (Perl) interface to libexacct that enables you to develop customized reporting and extraction scripts. See Perl Interface to the libexacct Library.

For example, with extended accounting enabled, the task tracks the aggregate resource usage of its member processes. A task accounting record is written at task completion. Interim records on running processes and tasks can also be written. For more information on tasks, see About Projects and Tasks.

Figure 2  Task Tracking With Extended Accounting Activated

image:Flow diagram shows how aggregate resource usage of a task's processes is captured in the record that is written at task completion.

Extensible Format

The extended accounting format is substantially more extensible than the legacy system accounting software format. Extended accounting permits accounting metrics to be added and removed from the system between releases, and even during system operation.

Note -  Both extended accounting and legacy system accounting software can be active on your system at the same time.

exacct Records and Format

Routines that allow exacct records to be created serve two purposes.

  • To enable third-party exacct files to be created.

  • To enable the creation of tagging records to be embedded in the kernel accounting file by using the putacct system call (see the getacct(2) man page).

    Note -  The putacct system call is also available from the Perl interface.

The format permits different forms of accounting records to be captured without requiring that every change be an explicit version change. Well-written applications that consume accounting data must ignore records they do not understand.

The libexacct library converts and produces files in the exacct format. This library is the only supported interface to exacct format files.

Note -  The getacct, putacct, and wracct system calls do not apply to flows. The kernel creates flow records and writes them to the file when IPQoS flow accounting is configured.

Using Extended Accounting on an Oracle Solaris System with Zones Installed

The extended accounting subsystem collects and reports information for the entire system (including non-global zones) when run in the global zone. The global administrator or a user granted appropriate authorizations through the zonecfg utility can also determine resource consumption on a per-zone basis. See Chapter 1, Non-Global Zone Configuration Command and Resources in Oracle Solaris Zones Configuration Resources for more information.