Skip to content
jgrantham-SGI edited this page Jun 9, 2016 · 10 revisions

Overview of Comprehensive System Accounting (CSA)  

Linux Comprehensive System Accounting (CSA) is a set of C programs and shell scripts that, like the other accounting packages, provide methods for collecting per-process resource usage data, monitoring disk usage, and charging fees to specific login accounts.

CSA provides the following features:

  • Per-job accounting
  • Daemon accounting (workload management systems)
  • Flexible accounting periods (daily and periodic accounting reports can be generated as often as desired and not restricted to once per day or once per month)
  • Flexible system billing units (SBUs)
  • Offline archiving of accounting data
  • User exits for site specific customization of daily and periodic accounting
  • Configurable parameters within the @sysconfdir@/csa.conf file
  • User job accounting (ja command)

CSA takes this per-process accounting information and combines it by job identifier (jid) within system boot uptime periods. CSA accounting for an interactive job consists of all accounting data for a given job identifier during a single system boot period. CSA accounting for a batch job includes the accounting data associated with the batch system identifier, which may consist of one or more job identifiers and may span multiple reboots.

Daemon accounting records are written at the completion of daemon specific events. These records are combined with per-process accounting records associated with the same interactive or batch job.

By default, CSA only reports accounting data for terminated jobs. Interactive jobs, cron jobs and at jobs terminate when the last process in the job exits, which is normally the login shell. A workload management job is recognized as terminated by CSA based upon daemon accounting records and an end-of-job record for that job. Jobs which are still active are recycled into the next accounting period. This behavior can be changed through use of the csarun -A option.

A system billing unit (SBU) is a unit of measure that reflects use of machine resources. SBUs are defined in the CSA configuration file @sysconfdir@/csa.conf and are set to 0.0 by default. The weighting factor associated with each field in the CSA accounting records can be altered to obtain an SBU value suitable for your site. See the Comprehensive System Accounting for Linux manual for further information.

The CSA accounting records are not written into the System V pacct file but are written into a separate CSA @csalocalstatedir@/day/pacct file. The CSA commands can only be used with CSA generated accounting records. Similarly, the System V accounting commands can only be used with System V generated accounting records.

There are four user exits available with the csarun daily accounting script. There is one user exit available with the csaperiod periodic accounting script. These user exits allow sites to tailor the daily and periodic run of accounting to their specific needs by creating user exit scripts to perform any additional processing and to allow for archiving of accounting data. See the csarun and csaperiod man pages for further information.

CSA provides two user accounting commands, csacom and ja. The csacom command reads the CSA pacct file and writes selected accounting records to standard output. The ja command provides job accounting information for the current job of the caller. This information is obtained from a separate user job accounting file to which the CSA daemon writes. See the csacom and ja man pages for further information.

The @sysconfdir@/csa.conf file contains CSA configuration variables. These variables are used by the CSA commands.

The csaswitch command is used to dynamically configure on or off CSA record types, set memory and I/O threshold values, switch the CSA pacct file, and provide status information. See the csaswitch man page for further information.

CSA can be automatically configured on across system reboots using the chkconfig --add csa command.  

INSTALLATION/STARTUP SUMMARY

The following steps are required to set up CSA job accounting:

  1. Install a distribution of CSA commands.
  2. Configure CSA on across system reboots by using the chkconfig utility as follows: chkconfig --add csa
  3. Modify the CSA configuration variables in @sysconfdir@/csa.conf as desired
  4. Use csaswitch to configure on the accounting record types and thresholds defined in @sysconfdir@/csa.conf as follows: csaswitch -c on
  5. Run the /etc/init.d/csa start command.

This step will be done automatically for subsequent system reboots when CSA is configured on via the chkconfig utility.  

FILES

@sbindir@/

Contains the CSA administrator commands

@bindir@/

Contains the CSA user commands, csacom and ja

@sysconfdir@/csa.conf

CSA configuration file

@csalocalstatedir@/day/pacct

Current process accounting file

@csalocalstatedir@/sum

CSA daily reports and data files

@csalocalstatedir@/fiscal

CSA periodic reports and data files

Clone this wiki locally