csaswitch(1M)csaswitch(1M)NAMEcsaswitch - checks the status of, enables or disables the different types
of Comprehensive System Accounting (CSA), and switches accounting files
for maintainability
SYNOPSIS
/usr/lib/acct/csaswitch [-D level] -c check -n name
/usr/lib/acct/csaswitch [-D level] -c halt
/usr/lib/acct/csaswitch [-D level] -c off -n namelist
/usr/lib/acct/csaswitch [-D level] -c on [-n namelist] [-m memthreshold] [-t timethreshold] [-P pathname]
/usr/lib/acct/csaswitch [-D level] -c status
/usr/lib/acct/csaswitch [-D level] -c switch
DESCRIPTION
The csaswitch command checks the current status of the different types of
Comprehensive System Accounting (CSA), enables or disables them, and
switches files for maintainability.
You can use csaswitch to check the current status of an accounting type
or to report the status of all types. These functions do not require any
privileges.
Users must have the CAP_ACCT_MGT capability to enable or disable an
accounting type, or to switch files for maintainability. See the
capability(4) and capabilities(4) man pages for more information on the
capability mechanism that provides fine grained control over the
privileges of a process.
On Trusted IRIX systems, a root user with the MAC label of dblow will
need to execute the following command before running csaswitch:
suattr -C CAP_ACCT_MGT,CAP_MAC_READ,CAP_MAC_WRITE,CAP_MAC_UPGRADE,
CAP_DAC_WRITE,CAP_DAC_EXECUTE+pi
You may also need the CAP_CHOWN and CAP_FOWNER capabilities. If you are
at a MAC label that is higher than dbadmin, you will need the
CAP_MAC_DOWNGRADE capability instead of the CAP_MAC_UPGRADE capability.
The csaswitch command accepts the following options:
-D level Sets the debug level. Level 1 is slightly verbose; level 3
is the most verbose. Debug output is written to standard
error. By default, debugging is turned off (level 0).
-c command Specifies the accounting command.
Command Description
check Reports the status for an accounting type
Page 1
csaswitch(1M)csaswitch(1M)
halt Turns off all accounting types
off Disables one or more types of accounting
on Enables one or more types of accounting
status Reports the status of all types of
accounting
switch Specifies that a new accounting file should
be created to maintain manageable files.
Suppose the accounting filename is
/var/adm/acct/day/pacct. csaswitch moves
the current accounting file
/var/adm/acct/day/pacct to the next
available file /var/adm/acct/day/pacct* and
then calls acctctl(3C) using the file
argument /var/adm/acct/day/pacct. In this
way, accounting data is not lost, and
/var/adm/acct/day/pacct remains the current
file.
-n name Specifies the name of the accounting type for which a
request is being made. The namelist argument for the off
and on commands can be a single name or a comma-separated
list of names.
Valid process accounting names are:
Name Description
csa CSA accounting
Valid daemon names are:
Name Description
nqs Network Queuing System (NQS) daemon
accounting
wkmg Workload management daemon accounting
tape Tape daemon accounting
Valid record names (linked to the CSA base record):
Name Description
io Input and output data record
Page 2
csaswitch(1M)csaswitch(1M)
mem Memory data record
Valid threshold names are:
Name Description
memt Memory threshold
time CPU time threshold
-m memthreshold
Specifies the virtual memory high-water mark below which
accounting records will not be written. The threshold
should be specified in Kbytes and as an integer. The -m
option must be specified when the memt operand is specified
with the -n option.
-t timethreshold
Specifies the number of CPU seconds below which accounting
records will not be written. The threshold should be
specified as an integer. The -t option must be specified
when the time operand is specified with the -n option.
-P pathname Specifies the pathname of the file to which accounting data
is written. If the file exists, accounting records are
appended to it. Otherwise, csaswitch creates a new file;
and it sets the owner of the file to adm, the group to the
value of the CHGRP parameter in the /etc/csa.conf file, and
the mode to 0664. On Trusted IRIX systems, csaswitch sets
the MAC label of the file to dbadmin.
If you specify the on command and do not specify the -n option, the
csaswitch command gets information about which accounting types and
thresholds to enable from the /etc/csa.conf file.
When you enable an accounting type, if no accounting type is currently
on, you need to specify the accounting pathname via the -P option. If
you do not specify the -P option, csaswitch gets the pathname from the
PACCT_FILE parameter in the /etc/csa.conf file. If that parameter does
not exist, then csaswitch uses /var/adm/acct/day/pacct.
When you turn on a linked record, csaswitch turns on csa accounting (if
it is not on already) since there can be no linked records without the
base record. The same happens when you set a threshold since thresholds
will not have any effect if csa is not running. Likewise, when you turn
off csa accounting, csaswitch turns off all the linked records and
thresholds.
When you switch the pacct file, if no accounting type is currently on,
csaswitch turns on accounting. It gets information about which
accounting types and thresholds to enable from the /etc/csa.conf file.
It also gets the accounting pathname from the PACCT_FILE parameter in the
Page 3
csaswitch(1M)csaswitch(1M)
/etc/csa.conf file. If that parameter does not exist, then csaswitch
uses /var/adm/acct/day/pacct.
NOTES
The csaswitch command does not support IRIX System V or extended
accounting.
The csackpacct(1M) shell script invokes csaswitch to maintain accounting
files of a reasonable size. You should run csackpacct(1M) periodically
by using cron(1M).
EXAMPLES
Example 1: The following command turns on csa accounting with the
default pacct file:
/usr/lib/acct/csaswitch -c on -n csa
Example 2: The following command checks the status of mem accounting:
/usr/lib/acct/csaswitch -c check -n mem
# Accounting status for Thu Feb 3 16:41:48 2000
# Name State Value
mem On
FILES
/etc/csa.conf Accounting configuration file
/var/adm/acct/day/pacct Current accounting file
/var/adm/acct/day/pacct* Switched accounting files
SEE ALSOcron(1M), csa(1M), csackpacct(1M), capability(4).
Page 4