-
Notifications
You must be signed in to change notification settings - Fork 1
CSA Maintenance Commands
csacms - summarizes command usage from per-process accounting records
@sbindir@/csacms [-a [[[-p] [-o]] [-e]]] [-c] [-j] [-n] [-s] [-S [-A]] files
The csacms command reads the pact file, sorted pact file, or files
previously put into internal summary format as determined by the input
option. To do this, the csacms command adds all the records for
processes that have executed the same commands. It then sorts them and
writes them to stardard output. Typically, it uses an internal summary
format to do this.
csacms accepts the following options:
-a
This option produces text output. You can use the following options only
with the -a option:
-p
Outputs a prime-time-only command summary.
-o
Outputs a nonprime-time-only (offshift) command summary.
-e
Outputs an extended report, printing additional fields.
The default output produced with the -a option includes command name,
number of times executed, total kcore-minutes, total kvirtual-minutes,
total CPU minutes, total real minutes, mean core size (in K), mean
virtual size (in K), mean CPU minutes per invocation, the amount of CPU
resources (proportional to other processes) used, and k-characters read
and written. Read and written values are printed separately. The output
is sorted by total kcore-minutes, unless you specify a sort option.
The high-water usage values for core and virtual memory are presented as both a prime-time value and nonprime-time value.
When you specify both -p and -o with -a, csacms produces a
combination prime or nonprime time report.
The extended report prints the following: high-water core memory usage value, high-water virtual memory usage value, the number of read and write system calls (printed separately), system time, minor faults, major faults, CPU delay time, block I/O delay time, and swap in delay time.
-c
Sorts by total CPU time (not total kcore-minutes).
-j
Combines all commands invoked only once under ``***other''.
-n
Sorts by number of command invocations.
-s
Indicates that files supplied to this command are already in internal format.
-S
Indicates that the sorted pacct file format is used on input.
-A
Causes all jobs (even nonterminated jobs) to be considered. You must use
this option with the -S option.
csacms - summarizes command usage from per-process accounting records
@sbindir@/csacms [-a [[[-p] [-o]] [-e]]] [-c] [-j] [-n] [-s] [-S [-A]] files
The csacms command reads the pact file, sorted pact file, or files
previously put into internal summary format as determined by the input
option. To do this, the csacms command adds all the records for
processes that have executed the same commands. It then sorts them and
writes them to stardard output. Typically, it uses an internal summary
format to do this.
csacms accepts the following options:
-a
This option produces text output. You can use the following options only
with the -a option:
-p
Outputs a prime-time-only command summary.
-o
Outputs a nonprime-time-only (offshift) command summary.
-e
Outputs an extended report, printing additional fields.
The default output produced with the -a option includes command name,
number of times executed, total kcore-minutes, total kvirtual-minutes,
total CPU minutes, total real minutes, mean core size (in K), mean
virtual size (in K), mean CPU minutes per invocation, the amount of CPU
resources (proportional to other processes) used, and k-characters read
and written. Read and written values are printed separately. The output
is sorted by total kcore-minutes, unless you specify a sort option.
The high-water usage values for core and virtual memory are presented as both a prime-time value and nonprime-time value.
When you specify both -p and -o with -a, csacms produces a
combination prime or nonprime time report.
The extended report prints the following: high-water core memory usage value, high-water virtual memory usage value, the number of read and write system calls (printed separately), system time, minor faults, major faults, CPU delay time, block I/O delay time, and swap in delay time.
-c
Sorts by total CPU time (not total kcore-minutes).
-j
Combines all commands invoked only once under ``***other''.
-n
Sorts by number of command invocations.
-s
Indicates that files supplied to this command are already in internal format.
-S
Indicates that the sorted pacct file format is used on input.
-A
Causes all jobs (even nonterminated jobs) to be considered. You must use
this option with the -S option.
csacrep - reports on consolidated accounting data
@sbindir@/csacrep [-p | -u] [-b] [-c] [-d] [-f] [-g] [-h] [-j] [-n] [-w] [-x] [-J] [-P] [-V]
The csacrep command generates reports from data in cacct format,
such as output from the csacon(8) command. The default output reports
the project name, the user ID, and the login name, and it suppresses the
heading.
The csacrep command accepts the following two types of options:
sorting and printing.
The csacrep command accepts the following two sorting options. You
cannot use the -p and -u options together. The -p option is
currently deferred, consequently, the sort currently is only by user ID.
-p
Sorts output first by the project ID (deferred) and then by the
secondary key of the user ID. By default, csacrep does not sort. You
cannot use this option with the -u option.
-u
Sorts output first by user ID and then by the secondary key of the
project ID (deferred). By default, csacrep does not sort. You cannot
use this option with the -p option.
The csacrep command accepts the following printing options:
-b
Reports SBU data.
-c
Reports CPU time, total kcore-minutes, and total kvirtual-minutes.
-d
Reports the cumulative disk usage and number of disk samples. Input
files that contains disk usage data are generated by using acctdisk
(see [acct]) or by merging cacct disk output files with other
cacct files, using the csaaddc(8) command.
-f
Reports full data.
-g
Reports group name.
-h
Displays heading.
-j
Reports number of processes and jobs.
-n
Reports prime and nonprime data.
-w
Reports the CPU, block I/O, and swap in delays.
-x
Reports the number of k-characters read and written, and the number of read and write systems calls.
-J
Reports job ID.
-P
Prints the project ID. (deferred) (The default is to print the project name.)
-V
Prints the number of minor and major page faults.
Zero is a valid value for the number of jobs. If a job is executed with multiple user ID/project ID pairs, the number-of-jobs value is incremented for only one such combination per job.
The following example generates a report from a daily accounting file:
csacrep -hcw < @csalocalstatedir@/sum/cacct.02031315
csadrep - reports daemon usage
@sbindir@/csadrep [-D level] [-o ofile] [-A] [-s sfile] [ [-a] | [ [-j] [-n] ] [-V level]
@sbindir@/csadrep [-D level] [-o ofile [-N]] [-A] [-s sfile]
@sbindir@/csadrep [-D level] [-o ofile] [ -a | [ [-j] [-n] ] ] [-V level] files
@sbindir@/csadrep [-D level] [-o ofile [-N]] files
The csadrep command reports usage of the workload management. Input is
either from a sorted pacct file created by csabuild(8) or from a
binary file created by csadrep with the -o option. The files
operand specifies the binary files.
The usage report is written to stdout.
The csadrep command accepts three types of options: input, output, and
report selection options.
The csadrep command accepts the following input option.
-s sfile
Specifies the name of the sorted pacct file. The csabuild(8) command
creates this file. The default is @csalocalstatedir@/work/spacct.
The csadrep command accepts the following output options.
-D level
Sets the debugging level. The level range is from 1 to 2. Level 0 turns
debugging off; level 1 is slightly verbose; and level 2 is verbose.
Debug output is written to stderr. By default, debugging is turned
off.
-o ofile
Specifies the name of the binary output file. csadrep can process this
file, using the files parameter.
-A
Reports all jobs, including those that have not completed. By default, only jobs that have completed are reported.
-N
Does not generate a usage report. You must use the -o option with this
option.
-V level
Sets the verbose level of the usage report. The levels are 0 through 4. Level 0 is terse, and level 4 is extremely verbose. The default is level 0.
The csadrep command accepts the following report selection options.
-a
Reports usage for all daemons. This is equivalent to -jn.
-j
Reports batch and interactive job usage. This is the default. Batch in this case is workload management usage.
-n
Reports workload daemon usage.
Example 1: The following example generates a very verbose usage report
for all the daemons. Input is from the sorted pacct file (spacct).
Binary output file drep.1 is created.
csadrep -a -V 4 -s spacct -o drep.1
Example 2: The following example generates a terse usage report for all the daemons. Input is from three previously created binary files.
csadrep -a drep.1 drep.2 drep.3
csaedit - displays and edits the accounting information
@sbindir@/csaedit [-P pacctfile] -b offsetfile -o outfile [-v]
@sbindir@/csaedit [-P pacctfile] [-o outfile] -A [-m] [-t] [-v]
@sbindir@/csaedit [-P pacctfile] -r reclist -o outfile [-v]
@sbindir@/csaedit [-P pacctfile] -r reclist [-o outfile] -A | -x [-m] [-t] [-v]
The csaedit command edits the accounting file. The accounting file
(pacctfile) can be a pacct or sorted pacct file.
You must use the csaverify(8) command to verify records in the
accounting file prior to using this command. If the csaverify command
indicates that the accounting file contains invalid data, you must first
delete the invalid data. You can do this by passing the file that
contains information about invalid records produced by the csaverify
command to the csaedit command. The csaedit command uses the byte
offset and length information from this file to delete the invalid data.
To ensure that all of the bad records were removed, use the csaverify
command to reverify the accounting file after deleting any records.
After deleting bad records, you can use the csaedit command to view
the remaining records and delete any of these remaining records. Use the
record numbers display by the -A option to delete records.
The csaedit command outputs the data to stdout or to a file. The
output data can be in binary or ASCII form. Binary data can only be
written out to a file. Only accounting records can be output. No data
can be output until bad data has been removed.
Displaying the data in ASCII form allows you to view the valid records and decide which ones to delete.
The csaedit command accepts three types of options: input, output, and
record selection options.
The csaedit command accepts the following input option:
-P pacctfile
Specifies a pacct file or sorted pacct file. The default filename is @csalocalstatedir@/work/Wpacct.
The csaedit command accepts the following output options:
-A
Specifies ASCII output for all data. The default is to output binary
data. You cannot use this option with the -x option.
-m
Outputs memory values. This option may only be used with the -A option
or the -x option.
-o outfile
Specifies the output file. The default for ASCII output is stdout.
This option is required with the -b and -r options. Records cannot
be written back to the input pacct file as in the following example:
csaedit -P pacct0 -r 18 -o pacct0. You cannot edit the file; you have
to create a new file.
-t
Outputs CPU times. Also displays queue wait time for consolidated
workload management records. This option may only be used with the -A
option or the -x option.
-v
Specifies verbose mode. Output is written to stderr.
-x
Specifies no execute mode. Only the records to be deleted are displayed.
The selected records are not actually deleted. The records are displayed
in ASCII form. This option must be used with the -r option. This
option cannot be used with the -A option.
The csaedit command accepts the following record selection options:
-b offsetfile
Specifies the file that contains the information about invalid records
that are to be deleted. The offsetfile is produced by the csaverify
command. You must use this option with the -o option since the data
will be written out in binary form only. You can only use this option
with the -P and -v options.
-r reclist
Specifies the record numbers of the records to be deleted. reclist is a comma-separated list.
Example 1: The following example deletes invalid records from the
Wpacct1 file. The file invalid contains information about invalid
records. The output is written to file Wpacct1.NEW.
csaedit -P Wpacct1 -b invalid -o Wpacct1.NEW
Example 2: The following example outputs the Wpacct1 file in ASCII. CPU times and memory values are reported.
csaedit -P Wpacct1 -Amt
Example 3: The following example displays records that are deleted in Example 4.
csaedit -P Wpacct1 -xr 2, 10, 15
Example 4: The following example deletes records 2, 10, and 15 from the Wpacct1 file. The output is written to file Wpacct1.NEW, and verbose output is written to file err.
csaedit -P Wpacct1 -r 2,10,15 -o Wpacct1.NEW -v 2> err
/usr/include/csa.h
Accounting records header file
/usr/include/csaacct.h
Daemon accounting header file
csagetconfig - searches the accounting configuration file for the specified argument
@sbindir@/csagetconfig label
The csagetconfig command searches the accounting configuration file
for label and returns the value associated with it. This command is
generally used in shell scripts.
By default, csagetconfig searches the @sysconfdir@/csa.conf file. If
the shell variable CSACONFIG is set to an alternative file,
csagetconfig will search a different configuration file.
The csagetconfig command accepts the following variable:
label
Specifies the argument that csagetconfig should search and return the
value for in the accounting configuration file.
Example 1: The following example extracts the value for ACCT_FS from
the default configuration file. The shell variable FILESYS is set to
the extracted value.
FILESYS=`csagetconfig ACCT_FS`
Example 2: The following example shows how to search an alternative
configuration file for the ACCT_FS variable:
FILESYS=`CSACONFIG=/tmp/myconfig csagetconfig ACCT_FS`
@sysconfdir@/csa.conf
Accounting configuration file
csajrep - prints a job report from the sorted pacct file
@sbindir@/csajrep [-s file] [-b] [-c] [-h] [-q] [-t] [-w] [-x] [-A] [-B] [-F] [-J] [-L] [-S] [-T] [-Z]
@sbindir@/csajrep [-s file] [-j jid] [-p prid] [-r reqid] [-u uid] [-b] [-c] [-e] [-h] [-q] [-t] [-w] [-x] [-A] [-B] [-J] [-L] [-S] [-T] [-V] [-Z]
@sbindir@/csajrep [-s file] [-A]
The csajrep command reports job accounting information from the sorted
pacct file, which is created by the csabuild(8) command.
The csajrep command accepts the following three types of options:
input, selection, and printing. If you omit the options, input is read
from @csalocalstatedir@/work/spacct and all records from each
completed job are reported. You can select a subset of jobs by
specifying the user ID, project ID (deferred), job ID, or workload
management request ID, for which you seek accounting information.
The following option specifies an input file for the job accounting report:
-s file
Specifies the name of the sorted pacct file created by csabuild(8).
The default file is @csalocalstatedir@/work/spacct.
By default, the -j, -p, and -u selection options report entire
jobs. The -e option limits the report to records that match the
selection criteria. The -e option must be used with at least one of
the following options: -j, -p, or -u. You cannot specify the -F
option in combination with any of the following options: -j, -p, or
-u.
Otherwise, the csajrep command accepts the following selection
options:
-e
Selects only the records that meet the selection criteria as defined by
the -j, -p, and -u options. The -e option must be used with at
least one of these four options. By default, csajrep outputs all of
the records from jobs that contain at least one record that meets the
selection criteria.
-j jid
Specifies a (numeric) job ID. The job ID must be specified in hexadecimal. The "0x" prefix or "0X" prefix are optional.
-p projid
Specifies a numeric project ID or project name. (deferred)
-r reqid
Specifies a workload management request ID.
-u uid
Specifies a numeric user ID or a user login name.
-F
By default, -F displays all records for completed jobs. This option
cannot be used with any of the following options: -e, -j, -p, and
-u. When -F is used with the -A option, all records for both
active and completed jobs are reported. When -F is used with the -Z
option, all records are reported except those with a job ID (jid) of
0.
-Z
Ignores records for which the job ID is equal to 0.
The csajrep command accepts the following printing options:
-b
Reports system billing unit (SBU) usage.
-c
Reports system and user CPU usage, along with CPU real and virtual run times.
-h
Suppresses report headings.
-q
For workload management records, reports the queue wait time and queue type.
-t
Prints summary information.
-w
Reports the CPU, block I/O, and swap in delays, along with high-water core memory usage value and high-water virtual memory usage value.
-x
Reports the number of k-characters read and written, and the number of read and write system calls. The read and written values are printed separately.
-A
Reports both active and completed jobs. By default, only completed jobs are reported.
-B
Reports process and job starting times.
-J
Reports job ID.
-L
Puts form feeds at the end of each job.
-S
Reports the array session handle. (deferred)
-T
Prints only summary information for each job.
-V
Reports page swaps, minor and major faults.
A job may contain multiple user IDs and project IDs (deferred), because
the user may have executed a command such as su(1).
When the -u option is used without the -e option, all records for
jobs containing at least one accounting record for the specified user
are displayed.
For example, if user1 executes the command rsh sgi who from a remote
host, then the command @sbindir@/csajrep -u user1 -JBc -s spacct would
produce output similar to:
JOB PROJECT LOGIN COMMAND START USER-TIM SYS-TIM
ID NAME NAME NAME TIME [SECS] [SECS]
============= ======== ======== ======== ==================== ======== ========
0x146 Xydev user1 who Jan 7 13:28:02 2000 0.004 0.008
0x146 System root rshd Jan 7 13:28:02 2000 0.004 0.014
The rshd(8) command was executed by root on behalf of user user1;
thus it is reported by the csajrep -u option.
When used with -u, the -e option suppresses the printing of all
accounting records which are not for the specified user. In the previous
example, the command @sbindir@/csajrep -eu user1 -JBc -s spacct would
produce output similar to:
JOB PROJECT LOGIN COMMAND START USER-TIM SYS-TIM
ID NAME NAME NAME TIME [SECS] [SECS]
============= ======== ======== ======== ==================== ======== ========
0x146 Xydev user1 who Jan 7 13:28:02 2000 0.004 0.008
Example 1: The following example generates a list of commands by job
that user jdoe executed. The list includes job ID, start time, and
both terminated and nonterminated jobs in the output:
csajrep -u jdoe -ABJ
csacon - condenses records from the sorted pacct file
@sbindir@/csacon [-A] [-D level] [-g] [-j] [-p] [-u]
[-s sorted pacct file]
The csacon command condenses records from the sorted pacct file and
writes consolidated records in cacct format to stdout. You can use the
csacrep(8) command to generate ASCII reports from the consolidated
file. csacon accepts two types of options: consolidation and input
options.
The csacon command accepts the following consolidation options. You
can specify multiple consolidation options. If you do not specify any
consolidation options, the default is to use -pu.
-A
Consolidates all jobs, including those that have not completed. By default, only jobs that have completed are consolidated.
-D level
Sets the debugging level. Level 1 is slightly verbose; level 6 is very verbose. Debug output is written to standard error. By default, debugging is turned off.
-g
Consolidates sorted pacct records by using the group ID as a key.
Because not all records have a group ID, you must use this option with
at least one of the following consolidation options: -p, -j, or
-u.
-j
Consolidates sorted pacct records by using the job ID as a key.
-p
Consolidates sorted pacct records by using the project ID as a key. (deferred)
-u
Consolidates sorted pacct records by using the user ID.
The csacon command accepts the following input option:
-s sorted pacct file
Specifies the name of the the sorted pacct file, which is the input
file. csabuild(8) created the file.
The following example consolidates all records in the sorted pacct
file. The sorted pacct records are condensed by the two-tuple job ID
and user ID. Output is written to the cacct file.
csacon -j -u -s sorted pacct file > cacct
csaperiod - runs periodic accounting
@sbindir@/csaperiod [-e MMDDhhmm] [-r] [-s MMDDhhmm]
The csaperiod command directs the processing of the daily consolidated
accounting files, which are created by the csarun(8) command. The
csaaddc(8) command merges the daily files into one file. The
csacrep(8) command then generates a report based on the merged file.
The progress of csaperiod is recorded in the pdact file. When an
error is detected, a message is written to the /var/log/messages file,
and mail is sent to root. Further data processing is halted.
The cron(8) command usually initiates csaperiod.
The csaperiod command accepts the following options:
-e MMDDhhmm
Selects consolidated accounting data generated at or before the specified date, MMDDhhmm.
-r
Removes the daily data files after processing is done. The default is to
leave the daily data files in the @csalocalstatedir@/sum directory.
-s MMDDhhmm
Selects consolidated accounting data generated at or after the specified date, MMDDhhmm.
By default, csaperiod processes all the @csalocalstatedir@/sum
files. The mail recipients (root by default) can be changed by
modifying the MAIL_LIST and WMAIL_LIST parameters in the
@sysconfdir@/csa.conf file.
If the script @sbindir@/csa.puser exists, csaperiod will execute it
via the shell "." command. A possible use of this user exit would be to
generate any site specific report, which would be appended to the
periodic report. csaperiod will check the return status from
"csa.puser". If the return status is non-zero, execution of csaperiod
will be aborted.
For example, the script could contain:
/usr/bin/local/siterpt > siterpt
pr -h "${SITEHDR} ${SYSNAME} ${BTWMSG}" siterpt >> ${PDRPT}.${DTIME}
You need to make sure that the csaperiod command can read the
site-generated user exit script. If csaperiod cannot read the script,
it does not handle the error graciously as it does for other errors.
This means the error will not be logged in the system messages file and
the pdact file, and no notification email will be sent out.
@sysconfdir@/csa.conf
CSA configuration file
@csalocalstatedir@/fiscal/cms.MMDDhhmm
Periodic command usage data in cms record format
@csalocalstatedir@/fiscal/pdacct.MMDDhhmm
Periodic condensed data files
@csalocalstatedir@/fiscal/rprt.MMDDhhmm
Periodic report files
@csalocalstatedir@/nite/pdact
Log file
@csalocalstatedir@/nite/E*MMDDhhmm
Error messages files
@csalocalstatedir@/sum/caact.MMDDhhmm
Daily condensed data files
@sbindir@/csa.puser
Site-generated user exit script for csaperiod.
csarecy - recycles unfinished job records into next accounting run
@sbindir@/csarecy [-r] [-s file] [-A] [-D level]
[-P file] [-R]
The csarecy command retrieves job information from the sorted pacct
file of the current accounting period and writes the records for
unfinished jobs into a pacct0 file for recycling into the next
accounting periord. csabuild(8) marks unfinished accounting jobs
(those that do not terminate in a given period of system activity).
csarecy takes these records from the sorted pacct file and puts them
into the next period's accounting files directory. This process is
repeated until the job finishes.
csarecy also prints reports about unfinished accounting jobs, in the
following format:
SYSTEM BOOT TIME STARTING AT Fri Nov 17 11:04:07 2000
For Linux porsche07 2.4.0-test7.csa.1 #9 SMP Sun Nov 12 10:17:23 CST 2000 i686
Preserved Accounting Jobs (Jobs which are continued).
==============================================================
JOB ID USERS PROJECT ID STARTED
------------------ ----- ------------- ------------------------
The csarecy command accepts the following options:
-r
Produces a report on all recycled jobs.
-s file
Specifies the sorted pacct file (created by csabuild(8)) as the
input file. The default is @csalocalstatedir@/work/spacct.
-A
Asks you whether you want to select each job for recycling. When this
option is used, you should run csarecy interactively. You cannot use
the -R option with this option.
-D level
Sets debugging level. Level 1 is somewhat verbose; level 2 is verbose.
-P path
Specifies the pathname of the output file for recycled pacct
accounting information. The system adds a 0 to the end of the filename,
so the actual filename is file0. The default is
@csalocalstatedir@/work/Wpacct.
-R
Produces report only; does not recycle jobs. You cannot use the -A
option with this option.
By default, recycled jobs are ignored by most accounting programs.
csarun - processes the daily accounting files and generates reports
@sbindir@/csarun [-A] [-V level] [MMDD [hhmm [state]]]
The csarun command, usually initiated by cron(8), directs the
processing of the daily accounting files. csarun processes accounting
records written into the pacct file.
When an error occurs, the csarun command does not damage the active
accounting file. While the csarun command is executing, diagnostic
messages are written to an active file. When an error occurs, a
message is written to the SYSLOG file and mail is sent to the root
user. Further data processing is stopped.
Before invoking csarun on a new accounting period, ensure that the
previous invocation of csarun has completed successfully. If this is
not done, information about unfinished jobs will not be accurate.
The lock and lock1 files prevent processes from invoking csarun at
the same time.
The csarun command accepts the following options and operands:
-A
Accounts for both terminated and active jobs. By default, only
terminated jobs are reported. csarun does not recycle active jobs when
this option is specified.
-V level
Controls verification level of accounting data files.
Level Description
level 0
Run csaverify and csaedit; this is the default
level 1
Run csaverify only
level 2
Do not run csaverify
MMDD [hhmm [state]]
Sets month, day, hour, minute, and state for which csarun will rerun
the accounting. If csarun is restarted, the month and day are
necessary; other portions are optional. If you supply the state on the
command line, you must also specify hhmm.
The csarun command processing is broken out into separate and
restartable states by using information in statefile to determine the
last state completed. To do this, the csarun command writes the state
name of the file into statefile. The csarun command examines the
statefile to determine what must be processed next.
The state are executed in the order that follows:
State Name Description
SETUP
The SETUP state moves active acounting files into a work directory.
VERIFY
Verifies the integrity of the data files.
ARCHIVE1
User exit that executes a site-generated accounting script to archive the accounting files.
BUILD
Organizes the accounting data into a sorted pacct file.
ARCHIVE2
User exit that executes a site-generated accounting script to archive
the sorted pacct file.
CMS
Generates command summaries.
REPORT
Generates daily accounting reports.
DREP
Generates daemon usage report.
FEF
User exit that executes a site-generated accounting script to format the
sorted pacct file into a format that is suitable for use on a front
end.
USEREXIT
User exit that executes a site-generated accounting script.
CLEANUP
The CLEANUP state cleans up temporary files and exits.
After a failure, make sure you check active files for diagnostics and
fix any corrputed pacct files, before restarting the csarun command
You must also remove the lock files before you can restart csarun.
When you restart csarun, you must specify the MMDD operand, which
specifies the month and day for which csarun will rerun accounting.
The contents of the statefile determines the entry point for
processing. You can override this entry point by entering the desired
state on the command line to direct the location where processing should
begin.
The mail recipients (root by default) can be changed by modifying the
MAIL_LIST and WMAIL_LIST parameters in the @sysconfdir@/csa.conf
file. You also can change the other parameters defined in the accounting
configuration file for your site.
csarun checks the number of free blocks in the filesystem that
contains the accounting files to ensure that it consists of more than
2000 blocks. Block size is 1024 bytes. By default, csarun assumes that
the filesystem is /var; if this is not the case, change symbol
ACCT_FS in @sysconfdir@/csa.conf accordingly. To change the minimum
number of free blocks on ACCT_FS (the default is 2000), modify
MIN_BLKS in the configuration file.
To remove bad records in accounting data files encountered by csarun,
use csaedit(8) and csaverify(8).
You need to make sure that csarun can read the site-generated user
exit scripts. If csarun cannot read the scripts, it does not handle
the error graciously like it does for other errors. This means the error
will not be logged in the SYSLOG file and the active file, and no
notification email will be sent out.
If possible, do not restart csarun in the SETUP state. Instead, run
SETUP manually and restart csarun by using the following command line:
csarun MMDD hhmm VERIFY
If csarun terminates abnormally and leaves the lock files in place,
the next execution of csarun will remove these locks, but it also will
terminate abnormally.
Example 1: The following example starts csarun in default form:
nohup csarun 2> @csalocalstatedir@/nite/csarun.log &
Example 2: The following example starts csarun to work on both
terminated and active jobs.
nohup csarun -A 2>> @csalocalstatedir@/nite/csarun.log &
Example 3: The following example restarts csarun on February 18 at the
state saved in statefile:
nohup csarun 0218 2>> @csalocalstatedir@/nite/csarun.log &
Example 4: The following example restarts csarun at 10:00 PM on
October 26 at BUILD state:
nohup csarun 1026 2200 BUILD 2>> @csalocalstatedir@/nite/csarun.log &
@sysconfdir@/csa.conf
Accounting configuration file
@csalocalstatedir@/day/*
Directory that contains current accounting files
@csalocalstatedir@/nite/active
Record of accounting progress
@csalocalstatedir@/nite/clastdate
Record of last date and time that accounting ran
@csalocalstatedir@/nite/lock
Lock file that prevents simultaneous invocation
@csalocalstatedir@/nite/lock1
Lock file that prevents simultaneous invocation
@csalocalstatedir@/nite/statefile
Record of last state that csarun was working on or completed
@csalocalstatedir@/sum/*
Directory that contains daily condensed data files and accounting reports
@csalocalstatedir@/work/*
Directory that contains temporary files from daily accounting
@sbindir@/csa.archive1
Site-generated user exit script to be executed during the ARCHIVE1
state.
@sbindir@/csa.archive2
Site-generated user exit script to be executed during the ARCHIVE2
state.
@sbindir@/csa.fef
Site-generated user exit script to be executed during the FEF state.
@sbindir@/csa.user
Site-generated user exit script to be executed during the USEREXIT
state.
csaswitch - checks the status of, enables or disables the different types of Comprehensive System Accounting (CSA), and switches accounting files for maintainability
@sbindir@/csaswitch [-D level] -c check -n name
@sbindir@/csaswitch [-D level] -c halt
@sbindir@/csaswitch [-D level] -c off -n namelist
@sbindir@/csaswitch [-D level] -c on [-n namelist] [-m memthreshold] [-t timethreshold] [-P pathname]
@sbindir@/csaswitch [-D level] -c status
@sbindir@/csaswitch [-D level] -c switch
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_SYS_PACCT capability to enable or disable an
accounting type, or to switch files for maintainability. See the
[capability] and [capabilities] man pages for more information
on the capability mechanism that provides fine grained control over the
privileges of a process.
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
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
@csalocalstatedir@/day/pacct. csaswitch moves the current accounting
file @csalocalstatedir@/day/pacct to the next available file
@csalocalstatedir@/day/pacct*. In this way, accounting data is not
lost, and @csalocalstatedir@/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
wkmg
Workload management daemon accounting
Valid record names (linked to the CSA base record):
Name
Description
io
Input and output data record
mem
Memory data record
delay
Delay accounting 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
csaacct, the group to the value of the CHGRP parameter in the
@sysconfdir@/csa.conf file, and the mode to 0664.
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 @sysconfdir@/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 @sysconfdir@/csa.conf file. If that
parameter does not exist, then csaswitch uses
@csalocalstatedir@/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
@sysconfdir@/csa.conf file. It also gets the accounting pathname from
the PACCT_FILE parameter in the @sysconfdir@/csa.conf file. If that
parameter does not exist, then csaswitch uses
@csalocalstatedir@/day/pacct.
The csackpacct(8) shell script invokes csaswitch to maintain
accounting files of a reasonable size. You should run csackpacct(8)
periodically by using cron(8).
Example 1: The following command turns on csa accounting with the
default pacct file:
@sbindir@/csaswitch -c on -n csa
Example 2: The following command checks the status of mem accounting:
@sbindir@/csaswitch -c check -n mem
# Accounting status for Thu Feb 3 16:41:48 2000
# Name State Value
mem On
@sysconfdir@/csa.conf
Accounting configuration file
@csalocalstatedir@/day/pacct
Current accounting file
@csalocalstatedir@/day/pacct*
Switched accounting files
csaverify - verifies that the accounting records are valid
@sbindir@/csaverify [-P pacctfile] [-o offsetfile]
[-m nrec] [-v] [-D]
The csaverify command verifies that the accounting records are valid.
The accounting file (pacctfile) can be a pacct or sorted pacct
file.
When csaverify finds an invalid record, it reports the starting byte
offset and length of the record. This information can be written to a
file in addition to standard output. A length of -1 indicates the end of
file. The resulting output file can be used as input to csaedit(8) to
delete pacct or sorted pacct records.
The csaverify command checks to ensure primary records and linked
records of a primary record (if there are any) are legal. The valid
primary records are CSA base, start-of-job, end-of-job, configuration,
workload management, and job header. Only CSA base records can have
linked records. The primary records themselves cannot be linked records.
The csaverify command checks to ensure that the pacct or sorted
pacct file only contains record types appropriate for that file. The
following record types are in a sorted pacct file and are not allowed
in a pacct file: job header record and consolidated workload
management records.
Filename options are as follows:
-P pacctfile
Specifies the filename of a pacct or sorted pacct accounting file.
The default is @csalocalstatedir@/work/Wpacct.
-o offsetfile
Specifies that information about invalid records, formatted for input to
the csaedit command, should be written to the file offsetfile. This
information will still be written to standard output in a more
user-friendly format.
Output options are as follows:
-m nrec
Specifies that no more than nrec invalid records are reported. By default, all invalid records will be reported.
-v
Sets verbose mode. Output is written to standard output.
-D
Sets debug mode. Output is written to standard output.
The following example verifies the Wpacct1 pacct file with verbose
mode turned on. In addition to writing information about invalid records
to standard output, information formatted for input to csaedit is
written to the file invalid.
csaverify -P Wpacct1 -o invalid -v
/usr/include/csaacct.h
Daemon accounting header file
/usr/include/csa.h
Accounting records header file
dodisk - performs disk accounting
@sbindir@/dodisk [mount_points]
By default, the dodisk command uses acctdusg to do disk accounting
by login directory for all filesystems. It is typically run by using the
cron(8) command.
By default, dodisk reports accounting information in
@csalocalstatedir@/day/dtmp, converts the records to cacct format and
stores them in @csalocalstatedir@/nite/diskcacct.
The dodisk command accepts the following operand:
mount_points
Specifies one or more mount points of mounted filesystem names where disk accounting is performed. If mount_points are not specified, "/" is the default filesystem.
The following example is a possible entry for the root crontab file so
that cron(8) automatically runs dodisk:
30 10 * * 1-5 @sbindir@/dodisk 2> @csalocalstatedir@/nite/dk2log
Section: User Commands (1)\
ja - starts and stops user job accounting information
ja [-a ash] [-c] [-d] [-D level] [-e] [-f] [-g
gid] [-h] [-j jid] [-J] [-l] [-m] [-M marks] [-n
names] [-o] [-p projid] [-r] [-s] [-t] [-u uid]
[file]
The ja command provides job-related accounting information. This
information is taken from the job accounting file to which the CSA
daemon writes, provided that job accounting is enabled. The job
accounting file can be either the file you provide or the default,
described in the following. ja provides information only about
terminated processes. The login shell and the current ja command being
executed are active processes and are not reported by ja. See ps(1)
for information about active processes.
To enable job accounting, use the ja command. You may specify only the
mark option (-m) and the optional file name when enabling. If the
job accounting file does not exist, ja creates it. If the file does
exist, accounting information is appended to the existing file. If job
accounting is already enabled and the optional filename specified is a
file other than the currently active job accounting file, the newly
specified file becomes the job accounting file.
If you do not specify the optional filename, the ACCT_TMPDIR
environment variable must be set to a directory. If that variable is not
set, the directory is assigned using the TMPDIR environment variable,
or defaults to /tmp. A default name of the following form is then
used:
$ACCT_TMPDIR/.jacct<jid>
The ACCT_TMPDIR environment variable is not exported in at(1) or
crontab(1) jobs. You must specify the job accounting filename in the
at(1) or crontab(1) commands; otherwise, ja will abort.
On normal termination of job accounting (-t specified), ja removes
the default job accounting file and disables job accounting. If you
specify the optional filename when enabling, specify the same name when
terminating. The optional job accounting file is not deleted by the ja
command.
The ja command lets you mark the positions of various commands
(processes) by writing the position of the next accounting record to be
processed to standard output. You can use these marks when generating
reports to restrict the information reported.
There are four groups of options you can use with the ja command: \
Report selection options
-c, -f, -o, -s
\
Record selection options
-a ash (deferred), -g gid, -j jid, -M marks, -n
names, -p projid (deferred), and -u uid
\
Report modifier options
-d, -e, -h, -J, -l
\
Special options (debug, mark, raw, and disable)
-D, -m, -r, and -t
The ja command can produce different types of reports by using the
-c, -f, -o, and -s options. The report-selection options are
first summarized and then described in detail.
In summary, the report selection options are as follows:
-c
Produces the command report (-c and -o are mutually exclusive).
-f
Produces the command flow report.
-o
Produces the other (alternative) command report (-o and -c are
mutually exclusive).
-s
Produces the summary report.
Described in detail, the report selection options are as follows:
-c
Produces a command report. The following fields are reported when you
specify the -c option with the -l option or with the -l and -h
options. These fields provide statistics about individual processes.
Command Name
First 15 characters of the name of the command that was executed.
Started At
Start time of the process.
Elapsed Seconds
Elapsed time of the process.
User CPU Seconds
Amount of CPU time the process consumed while it was executing in user mode.
Sys CPU Seconds
Amount of CPU time the process consumed while it was executing in system mode.
CPU Delay Secs
Amount of time the process waits for a CPU, while runnable.
Block I/O Delay Secs
Amount of time the process waits for synchronous block I/O to complete.
Swap In Delay Secs
Amount of time the process waits for page fault I/O (swap in only).
CPU MEM Avg Mbytes
(-l) Average amount of memory that this process used. This value is
calculated by dividing the memory integral by the total CPU time
(system + user CPU time). For more information on memory integrals,
see the Comprehensive System Accounting for Linux manual.
Characters Read
(-l) Number of characters in Mbytes read by the read, readv, and
`` system calls (see read(2), `readv`(2), and `pread`(2)).
Characters Written
(-l) Number of characters in Mbytes written by the write, writev,
and pwrite system calls (see write(2), writev(2), and
pwrite(2)).
Logical I/O Read
(-l) Number of logical I/O read requests that the process performed. A
logical I/O request is performed each time a process calls a read,
readv, or pread system call.
Logical I/O Write
(-l) Number of logical I/O write requests that the process performed.
A logical I/O write request is performed each time a process calls a
write, or writev, or pwrite system call.
CoreMem HiValue
(-h) (-l) Maximum amount of core memory the process used at any one
time. The value is reported in Kbytes.
VirtMem HiValue
(-h) (-l) Maximum amount of virtual memory the process used at any
one time. The value is reported in Kbytes.
Ex St
(-l) Lower 8 bits from the exit status of the process. See wait(2)
for more information.
Ni
(-l) The last nice value of the process.
Fl
(-l) Accounting flag. The following values are available:
F
The process forked but did not execute.
S
The process used superuser privileges.
The accounting flags are defined in /usr/include/csa.h.
SBUs
System billing unit (SBU) for the process. The system administrator configures SBU calculations. For more information, see the Comprehensive System Accounting for Linux manual.
-f
Produces a command flow report. This report provides information on the
parent/child relationships of processes and, if you specify the -l
option, CPU user and system time (in seconds).
-o
Produces an alternative (other) command report. The -o option report
contains the following fields, which show statistics about individual
processes.
Command Name
First 15 characters of the name of the command that was executed.
Started At
Start time of the process.
Elapsed Seconds
Elapsed time of the process.
Proc ID
Process ID of the current process.
Parent ProcID
Process ID of the parent process.
CoreMem HiWater
Maximum amount of core memory the process used at any one time. The value is reported in Kbytes.
VirtMem HiWater
Maximum amount of virtual memory the process used at any one time. The value is reported in Kbytes.
CPU Delay Count
Number of CPU delay values recorded for the process.
Block I/O Delay Count
Number of synchronous block I/O delay values recorded for the process.
Swap In Delay Count
Number of page fault I/O (swap in) delay values recorded for the process.
Real Run Time Secs
CPU "wall-clock" running time. On some architectures, the value is adjusted for CPU time stolen from the kernel in involuntary waits due to virtualization.
Virt Run Time Secs
Time intervals seen by the kernel. No adjustment for involuntary waits due to virtualization.
-s
Produces a summary report. The -s option report contains the following
fields, which provide accumulated usage statistics for the reporting
period.
Job Accounting Filename
Name of the file to which the kernel writes the ja accounting records.
Operating System
Operating system name, node name, release, version, and hardware type.
User Name (ID)
Name and user ID of the real user.
Group Name (ID)
Name and group ID of the real group.
Project Name (ID)
Project name and project number that this process uses (deferred). Multiple project ID usage is listed, but not individual projects.
Job ID
Job ID associated with these processes.
Report Starts
Starting time of the process that began first during the reporting period.
Report Ends
Ending time of the process that was the last to complete during the reporting period.
Elapsed Time
Duration of the reporting period in seconds (the difference between the report ending and starting times).
User CPU Time
Total CPU time (in seconds) used during the reporting period while the processes were in user mode.
System CPU Time
Total CPU time (in seconds) used during the reporting period while the processes were in system mode.
CPU Time Core Memory Integral (Mbyte-seconds)
Sum of the core memory integrals for all processes. For more information on memory integrals, see the Comprehensive System Accounting for Linux manual.
CPU Time Virtual Memory Integral (Mbyte-seconds)
Sum of the virtual memory integrals for all processes.
Maximum Core Memory Used (Mbytes)
Maximum amount of core memory used by any process at one time.
Maximum Virtual Memory Used (Mbytes)
Maximum amount of virtual memory used by any process at one time.
Characters Read
Total number of characters read by the read(2), readv(2), and
pread(2) system calls by all processes in the reporting period.
Characters Written
Total number of characters written by the write(2), writev(2), and
pwrite(2) system calls by all processes in the reporting period.
Logical I/O Read Requests
Total number of read(2), readv(2), and pread. system calls
executed by all processes in the reporting period.
Logical I/O Write Requests
Total number of write(2) and writev(2) system calls executed by all
processes in the reporting period.
CPU Delay
Total CPU delay (in seconds), summed over all processes in the reporting period.
Block I/O Delay
Total synchronous block I/O delay (in seconds), summed over all processes in the reporting period.
Swap In Delay
Total page fault I/O (swap in) delay (in seconds), summed over all processes in the reporting period.
Number of Commands
Total number of commands that completed during the reporting period.
System Billing Units
Sum of the system billing units (SBUs) of all processes.
The mark and disable options are as follows:
-m
Writes the position of the next accounting record to standard output.
This can be used to mark various positions within the job accounting
file for later use with the -M option. The position marked is the byte
offset of the current end-of-information of the job accounting file.
(-m cannot be used with the report selection and modifier options nor
with the -t disable option.)
-t
Disables (terminates) job accounting. (-m and -t are mutually
exclusive).
-a ash
Report is for this array session handle (ash) only. (deferred)
-g gid
Report is for this group identifier (gid) or group name only.
-j jid
Report is for this job identifier (jid) only.
-u uid
Report is for this user identifier (uid) or user name only.
-n names
Shows only commands matching names patterns that may be regular
expressions, as in ed(1), except that a + symbol indicates one or more
occurrences.
-p projid
Report is for this project identifier (projid) or project name only. (deferred)
-M marks
Shows only commands within the marked range. This can be a list of ranges with each list item having the following form:
.
First command preceding current position
m1
First command following mark
m1:
All commands between the mark and EOF
m1:m2
All commands between the two marks
:m1
All commands between BOF and the mark
:
All commands between BOF and EOF (default)
See the -m option for information on how to obtain marks.
Report modifier options must be used with at least one selection option. The report modifier options are as follows:
-d
Reports on workload management usage.
-e
Generates an extended summary report; you must use -e with the -s
option. The following are descriptions of fields produced by specifying
the -e option with the -s option. These fields provide additional
accumulated statistics for the reporting period:
Number of Page Swaps
Number of times the pages were swapped out of memory.
Number of Minor Page Faults
Number of minor page faults.
Number of Manor Page Faults
Number of major page faults.
Number of CPU Delays
Number of CPU delay values.
Number of Block I/O Delays
Number of synchronous block I/O delay values.
Number of Swap In Delays
Number of page fault I/O (swap in) delay values.
CPU Real Run Time
Cumulative CPU "wall-clock" running time (in seconds). On some architectures, the value is adjusted for CPU time stolen from the kernel in involuntary waits due to virtualization.
CPU Virtual Run Time
Cumulative time intervals seen by the kernel (in seconds). No adjustment for involuntary waits due to virtualization.
-h
Provides the largest amount of core and virtual memory the process used
at one time in 1K units. Used only with both the -c and -l options.
-J
Provides job ID and start/end times.
-l
Provides additional information when used with the -c or -f options.
-r
Raw mode, no headers are printed.
-D
Enables debugging for the ja command. Valid values are 1 through 4.
Debugging is off by default. A debug level greater than one provides
program flow information. A debug level greater than three provides
additional information about records which are skipped over due to the
requested ja record selection options.
Examples 1 and 2 show the usage of the -m and -M options with
standard shell and Korn shell variables.
Example 1:
ja #enable job accounting
.
. (Miscellaneous commands)
.
m1=`ja -m` #mark job accounting file's current position
.
. (Commands of special interest)
.
m2=`ja -m` #mark job accounting file's current position
.
. (Miscellaneous commands)
.
ja -cM $m1:$m2 #print command report from mark m1 to mark m2
ja -st #print summary report for entire session and disable
job accounting
Example 2:
ja #enable job accounting
.
. (Miscellaneous commands)
.
m1=`ja -m` #mark job accounting file's current position
.
. (Commands of special interest)
.
ja -cM $m1: #print command report from mark to EOF
.
. (Miscellaneous commands)
.
ja -st #print summary report for entire session and disable
job accounting
Example 3:
This example shows example output when you use the -c option.
Job Accounting - Command Report
===============================
Command Started Elapsed User CPU Sys CPU CPU Block I/O Swap In
Name At Seconds Seconds Seconds Delay Secs Delay Secs Delay Secs SBU's
=============== ======== ========== ========== ========== ========== ========== ========== =======
# CFG ON( 1) ( 6) 10:57:53 11/28/2000 System: Linux porsche07 2.4.0-test7.csa.1
#9 SMP Sun Nov 12 10:17:23 CST 2000 i686
ja 10:57:53 0.33 0.26 0.01 0.00 0.00 0.00 0.00
who 10:58:19 0.02 0.00 0.01 0.00 0.00 0.00 0.00
ja 10:58:32 0.26 0.25 0.00 0.00 0.00 0.00 0.00
csacom 10:58:51 0.01 0.01 0.00 0.00 0.00 0.00 0.00
ls 11:23:27 0.02 0.01 0.00 0.00 0.00 0.00 0.00
ls 11:24:40 0.01 0.01 0.00 0.00 0.00 0.00 0.00
ls 11:24:44 0.01 0.00 0.01 0.00 0.00 0.00 0.00
vi 11:24:50 151.95 0.00 0.02 0.00 0.00 0.00 0.00
The # CFG ON output line is a configuration record written when job
accounting was enabled via the ja command. This record contains the
daemon accounting types enabled, record accounting types enabled, last
system boot-time, and system identification information.
Example 4:
The following example shows the output of the -s option:
Job CSA Accounting - Summary Report
====================================
Job Accounting File Name : /tmp/username.ja
Operating System : Linux porsche07 2.4.0-test7.csa.1 #9 SMP Sun
Nov 12 10:17:23 CST 2000 i686
User Name (ID) : username (10320)
Group Name (ID) : resmgmt (16061)
Project Name (ID) : ? (0)
Job ID : 0xa0700000041fe
Report Starts : 12/13/00 10:19:50
Report Ends : 12/13/00 10:19:55
Elapsed Time : 5 Seconds
User CPU Time : 0.2900 Seconds
System CPU Time : 0.0350 Seconds
CPU Time Core Memory Integral : 0.0055 Mbyte-seconds
CPU Time Virtual Memory Integral : 0.0139 Mbyte-seconds
Maximum Core Memory Used : 1.1602 Mbytes
Maximum Virtual Memory Used : 2.0898 Mbytes
Characters Read : 0.1482 Mbytes
Characters Written : 0.0010 Mbytes
Logical I/O Read Requests : 61
Logical I/O Write Requests : 16
CPU Delay : 0.0160 Seconds
Block I/O Delay : 0.0385 Seconds
Swap In Delay : 0.0000 Seconds
Number of Commands : 5
System Billing Units : 0.0000
lastlogin - records last date on which each user logged in
@sbindir@/lastlogin -c infile
The lastlogin command records the last date on which each user logged
in. It is invoked by the Comprehensive System Accounting (CSA) package
as part of the daily accounting run. The -c infile option specifies
that the lastlogin should process infile, which is a consolidated
accounting file in cacct format. lastlogin updates the
@csalocalstatedir@/sum/loginlog file.
@sbindir@
holds all accounting commands
@csalocalstatedir@/sum
summary directory contains daily report information for CSA
nulladm - create file with permission bits set to 0664 and owner and
group set to csaacct
@sbindir@/nulladm file
Files created by the nulladm command have permission bits set to 0644
and the owner and group is set to csaacct. It is called by various
accounting shell procedures.
@sbindir@/
holds all accounting commands
@csalocalstatedir@/sum
summary directory contains information for CSA
acctdisk - produces consolidated accounting records
@sbindir@/acctdisk
acctdisk reads lines of information from standard input, converts them
to records in "Consolidated Accounting record" (cacct) format, and
writes out the records to standard output.
The input lines consist of the login ID and login name of the user and number of disk blocks used by the user. These three sets of data are separated by white space(s). Note that the login name information is not saved to cacct records, but the input lines must contain that data.
The output is not in readable form. It is usually saved as a data file
for later use. These caact files can also be merged with csaaddc(8)
command.
/etc/passwd used for login name to user ID conversions
@sbindir@/ holds all administration accounting commands
@csalocalstatedir@/day/pacctcurrent process accounting file
acctdusg - reads standard input and computes disk resource consumption
@sbindir@/acctdusg [-u file] [-p file]
acctdusg takes input from standard input and produces a report of disk
consumption sorted by user ID. The input to this command normally comes
from output of "find" command. For example:
# find /var |acctdusg
00000 root 126184
00002 daemon 8
00003 adm 264
00004 lp 8
00009 news 24
00025 named 24
00029 rpcuser 136
00037 rpm 101672
00038 ntp 8
00051 smmsp 8
00067 webalize 16
00080 desktop 112
#
The output from this command consists of three column of data: User login ID, login name, and number of disk blocks consumed by the user including indirect blocks.
If -u option is specified, the disk consumption information on files
that acctdusg failed to charge to any valid login are saved in the
specified unchargable_file. This option is useful to find out which
users are avoiding disk charges.
If -p option is specified, the provided password file is used by
acctdusg in finding login information. When -p option is not
specified, the system call getpwent is used to retrieve user account
information.
/etc/passwd used for login name to user ID conversions
@sbindir@/ holds all administration accounting commands
@csalocalstatedir@/day/pacct current process accounting file
csaaddc
csaaddc - combines cacct records
@sbindir@csaaddc [-A] [-D level] [-o ofile] [-t] [-v]
[[[-g] [-p]] [-j] [-u]] input-files
The csaaddc command combines cacct records by specified consolidation
options and writes out a consolidated record in either cacct or ASCII
format. You also can generate cacct records with the csacon(8),
acctdisk(8) and csachargefee(8) commands.
The csaaddc command accepts the following operand:
input-files
Specifies the files to be processed. The files are in cacct format.
-A
Outputs information in ASCII. By default, the output is written to a binary output file.
[-D level]
Sets debugging level. Level 1 is somewhat verbose; level 2 is verbose.
-o ofile
Specifies the output file. By default, the output is written to stdout.
-t
Consolidates all records into one total record.
-v
Sets verbose mode on. When you also specify -A, verbose output is
written to stderr.
You can specify multiple consolidation options. These options should be
the same as those used to create the input files with csacon(8). If
you do not specify any consolidation options, the default is -pu.
-g
Consolidates records by group ID. You must use this option with at least one of the other consolidation options, because not all records have a group ID.
-p
Consolidates records by project ID. (deferred)
-j
Consolidates records by job ID.
-u
Consolidates records by user ID.
The consolidation options used with csacon(8) to generate the input
files should correspond to the consolidation options used with
csaaddc. If they do not, the resulting data can be misleading and
difficult to interpret.
The following example merges two input files created with csacon(8),
using the -g consolidation option. The output is written to file
outfile.
csaaddc -g -o outfile cacct1 cacct2
csabuild - organizes accounting records into job records
@sbindir@/csabuild [-a] [-A] [-D level] [-i] [-n]
[-o nday] [-P pacct] [-s spacct] [-t]
The csabuild command reads accounting records from the CSA pacct
file and organizes them into job records by job ID and boot times. It
writes these job records into the sorted pacct file. This sorted
pacct file contains all of the accounting data available for each job.
The pacct file configuration records are associated with the job ID 0
job record within each boot period. The information in the sorted
pacct file is used by other commands to generate reports and for
billing.
An integer suffix is attached to the pacct pathname arguments; a 0 indicates recycled information, and 1 and higher indicates current data.
The csabuild command accepts several types of options: filename,
performance, job ending, and debugging.
The csabuild command accepts the following filename options:
-P pacct
Specifies pacct file pathname. The default is
@csalocalstatedir@/work/Wpacct.
-s spacct
Specifies the sorted pacct file pathname. The default is
@csalocalstatedir@/work/spacct.
The csabuild command accepts the following performance option:
-t
Prints timing information for the two major phases of csabuild.
The csabuild command accepts the following job ending options:
-a
Assumes crash option. The default operation is if a job does not have an associated end-of-job record, but the system was rebooted, the job is assumed to be terminated. With this option, these jobs are not marked as terminated.
-o nday
Terminates the session if a session is older than nday days. Workload management requests submitted more than ndays ago also are terminated. You can use this option to terminate old jobs that are known to be finished.
The csabuild command accepts the following debugging options:
-A
Abort option. If csabuild exits with an error, a core dump is
generated.
-D level
Controls messages printed during program execution. Level 1 is verbose, level 9 is not appropriate for any execution, except small test cases.
-i
Ignores bad records. If csabuild runs into a record that it detects as
bad, it can recover from the error by discarding the record and
continuing to process input. When it discards a record, it prints a
diagnostic message.
-n
Suppresses the workload management sort and condense phase. This option prevents workload management jobs that span multiple system boots from being condensed into one job. (This function is intended only for error recovery.)
The pacct1 file must exist. csaverify(8) can verify the pacct
input files. Generally, csaedit(8) can verify and repair bad input
files.
csabuild is limited by its input. Unless the data files are accurate,
the jobs cannot be organized correctly.
@csalocalstatedir@/day
Directory that contains current unprocessed accounting data
csackpacct - checks the size of the process accounting file
@sbindir@/csackpacct [blocks]
The csackpacct script checks the size of the CSA process accounting
file @csalocalstatedir@/pacct and checks the amount of free space on
the filesystem containing the @csalocalstatedir@ directory. If the
size of the pacct file exceeds 4000 blocks (default) or exceeds the
specified number of blocks, csackpacct starts a new accounting file
by invoking the csaswitch(8) command. When accounting is enabled, the
csaswitch command is called with the -c on option by default. You
can modify the behavior of the csaswitch command to enable additional
daemon or continuation record types and set threshold values by setting
the applicable values in the @sysconfdir@/csa.conf file. For
additional information, see the csaswitch(8) man page.
ACCT_FS is a parameter which defines the filesystem on which
@csalocalstatedir@/acct resides and is defined in the accounting
configuration file @sysconfdir@/csa.conf. The MIN_BLKS parameter
also is defined there.
csackpacct also ensures that the ACCT_FS filesystem contains at
least MIN_BLKS free blocks. If there is not this much free space,
csackpacct turns off CSA accounting by invoking csaswitch(8) with
the halt operand. csackpacct calls csaswitch(8) with the on
operand to re-enable process accounting when at least MIN_BLKS free
blocks are available.
The above feature is affected by how frequently csackpacct runs. You
should run csackpacct periodically using the cron(8) command.
The csackpacct script accepts the following operand:
blocks
Specifies the maximum size (in blocks) to which the CSA process accounting file can grow before it is switched. The default is 4000 blocks.
In the released template of the accounting configuration file,
@sysconfdir@/csa.conf, ACCT_FS is set to @csalocalstatedir@. If
this is not correct for your system, you must define ACCT_FS properly
in @sysconfdir@/csa.conf.
The following example is a suggested entry for the root crontab file
so that cron(8) automatically runs csackpacct on the hour:
5 * * * 1-6 if /sbin/chkconfig --list |grep csa; then @sbindir@/csackpacct; fi
@sysconfdir@/csa.conf
CSA configuration file
@csalocalstatedir@/day/pacct*
CSA process accounting files
crontab
root crontab(1) file
csacms - summarizes command usage from per-process accounting records
@sbindir@/csacms [-a [[[-p] [-o]] [-e]]] [-c] [-j] [-n] [-s] [-S [-A]] files
The csacms command reads the pact file, sorted pact file, or files
previously put into internal summary format as determined by the input
option. To do this, the csacms command adds all the records for
processes that have executed the same commands. It then sorts them and
writes them to stardard output. Typically, it uses an internal summary
format to do this.
csacms accepts the following options:
-a
This option produces text output. You can use the following options only
with the -a option:
-p
Outputs a prime-time-only command summary.
-o
Outputs a nonprime-time-only (offshift) command summary.
-e
Outputs an extended report, printing additional fields.
The default output produced with the -a option includes command name,
number of times executed, total kcore-minutes, total kvirtual-minutes,
total CPU minutes, total real minutes, mean core size (in K), mean
virtual size (in K), mean CPU minutes per invocation, the amount of CPU
resources (proportional to other processes) used, and k-characters read
and written. Read and written values are printed separately. The output
is sorted by total kcore-minutes, unless you specify a sort option.
The high-water usage values for core and virtual memory are presented as both a prime-time value and nonprime-time value.
When you specify both -p and -o with -a, csacms produces a
combination prime or nonprime time report.
The extended report prints the following: high-water core memory usage value, high-water virtual memory usage value, the number of read and write system calls (printed separately), system time, minor faults, major faults, CPU delay time, block I/O delay time, and swap in delay time.
-c
Sorts by total CPU time (not total kcore-minutes).
-j
Combines all commands invoked only once under ``***other''.
-n
Sorts by number of command invocations.
-s
Indicates that files supplied to this command are already in internal format.
-S
Indicates that the sorted pacct file format is used on input.
-A
Causes all jobs (even nonterminated jobs) to be considered. You must use
this option with the -S option.
Linux CSA is the outcome of a joint effort between Los Alamos National Laboratory (LANL) and SGI to port the IRIX CSA tool to the Linux Operating System. This project is a community driven fork of that code base and is not supported by either organization at this time.