man uacrep
NAME
uacrep, uacrepmrg, csacrep_uacrep
- Unicos[/mk] cacct/csacrep merging and hierarchical reporting
SYNOPSIS
/usr/lib/acct/csacrep -hjcwxM <cacct >csacrep1.out
csacrep_uacrep csacrep1.out x
sort csacrep?.sum | uacrepmrg -tag test -o crep.mrg
uacrep -f crep.mrg
DESCRIPTION
The csarep_uacrep, uacrepmrg, and uacrep programs are a series to re-format
Unicos cacct reports generated by csacrep by merging reports and reporting
by a project tree hierarchy.
The csacrep_uacrep reformat recognizes both Unicos and Unicos/mk formats of
the '-hjcwxM' options. This korn script will require customization to
recognize host name, specifically as Unicos or Unicos/mk csacrep report
format. The metrics collected by 'csacrep -hjcwxM" include:
cpu-sec, k*cpumn, connsec, iow-sec, k*iowmn,
blks-xf, phy-io, log-io, mpp-sec, pe-secs,
procs, and jobs
The phy-io metric is not available under Unicos/mk and the mpp-sec and pe-
secs metrics may be meaningless for most Unicos configurations.
The uacrepmrg program will merge by user/project combinations multiple
files reformated by csacrep_uacrep or previous uacrepmrg executions. Part
of the merging is to establish appropriate units for the metrics being col-
lected. The uacrepmrg converts the metrics to:
cpu-hrs, m*cpuhr, conhrs, iowhrs, m*iowhr,
kblk-xf, kphy-io, klog-io, mpp-hrs, pe-hrs,
procs, and jobs
The uacrep program reports by a pre-defined project tree hierarchy one or
more files generated by uacrepmrg. Typically one or more daily or monthly
files generated by csacrep_uacrep and uacrepmrg are reported. Reporting
can be on any of the metics mentioned above. Two reports are generated
with uacrep, the first is a report by hierarchy to a pre-specified level
(depth). The second report is per-project or for masked projects.
OPTIONS uacrep
-file file1[,file2,...]
Up to 12 files created by uacrepmrg are specified. If this option is
omitted files will be prompted via stdin.
-tree project_hierarchy_file
A predefined project hierarchy file must exist. The first field is
the numeric acid and the second field is the project hierarchy delim-
ited by slashes. The right most is alpha representation of the acid.
Sample records:
0 ROOT
202 UA
203 UA/ARSC
206 UA/ARSC/STAFF
222 UA/ARSC/CRAY
-show field1[,field2,...]
Allowable fields (metrics) are:
cpu, mpp, phr, res, iom, iow,
blk, lio, pio, con, job, pro
This option specifies which metrics to display in the report. The fields
are displayed left to right in the order specified. The first field speci-
fied is the primary field for the report and will include per-project total
and percentage. The non-primary fields are displayed only as a total (or
only as a percentage with -pct). If only one field is selected then each
file will be displayed after the total of all files. Use '-show all' for
all fields, the defaults are:
cpu,mpp,res,blk,lio,job
-pct This is a flag to indicate non-primary fields (or individual files)
are to be displayed as a percentage instead of a total by project.
-users
This is a flag to indicate that individual user totals are to be
displayed. If the -mask option is used only the users matching the
project mask are displayed.
-hierarchy
This is a flag to indicate only the hierarchy levels defined by
-level are to be display, the per-project report will be omitted.
-level number
This option defines the depth of the project hierarchy display. The
hierarchy display can be disabled by using -level 0.
-mask mask
A wildcarded mask of projects to display can be specified with this
option. With the initial hierachy report the top level is always
reported. This option is particularly useful for getting a breakdown
of users with -users for a portion of the project hierarchy.
-output filename
This redirects the report from stdout to a file.
-verbose
This is a flag to include record counts and debugging information.
OPTIONS uacrepmrg
The file to process may be specified as an argument, if no argument is pro-
vide the input is assumed to be on stdin.
-tag name
This is an optional name to include in the file header. Up to 6 char-
acters will be displayed in the uacrep report. Common tags are the
month the date has been collected.
-host name
This is a secondary tag to include in the report header. Up to 8
characters will be displayed in the uacrep report. This field is gen-
erally used to indicate a host name for sites which report multiple
hosts.
-output filename
This redirects the report from stdout to a file.
-verbose
This is a flag to include record counts and debugging information,
verbose output for uacrepmrg is directed to stderr not stdout.
OPTIONS csacrep_uacrep
This korn script has two modes of operation based on whether one or two
arguments are provided.
one argument
provides an input cacct file which is reported via csacrep and con-
verted to uacrepmrg format.
two arguments
provides an input csacrep report file which is converted to uacrepmrg
format. The presence of any second argument invokes this mode.
EXAMPLES
The following example takes two cacct files from two days and produces a
two day total by cpu showing each day separately. The -h option is used to
show only the hierarchy report.
/usr/lib/acct/csacrep -hjcwxM <19980505.cacct >0505.csacrep
/usr/lib/acct/csacrep -hjcwxM <19980506.cacct >0506.csacrep
csacrep_uacrep 0505.csacrep x # makes 0505.sum
csacrep_uacrep 0506.csacrep x # makes 0505.sum
sort 05*.sum |
uacrepmrg -tag test -host yukon -o out.uacrepmrg
sort 0505.sum | uacrepmrg -tag 980505 -host yukon -o mrg.0505
sort 0506.sum | uacrepmrg -tag 980506 -host yukon -o mrg.0506
uacrep -h -show cpu -f mrg.0505,mrg.0506
#Host: yukon #Tags: 980505 980506
#
User CPU
Count Hours 980505 980506
----- ------ ------ ------
5 1451.3 52.2% 550.2 901.1 DOD
5 1451.3 52.2% 550.2 901.1 DOD/NAVY
3 7.0 .3% 0.5 6.5 ROOT
37 1320.6 47.5% 651.6 669.0 UA
18 1302.3 46.9% 650.7 651.7 UA/ACADEMIC
19 18.3 .7% 1.0 17.3 UA/ARSC
----- ------ ------ ------
45 2779 1202 1577 Totals
#
The following example requests both cpu and mpp hours and also omits the -h
option. The -mask option is included only the UA/ARSC hierarchy in the
secondary per-project report.
uacrep -show cpu,mpp -m UA/ARSC -f mrg.0505,mrg.0506
#Host: yukon #Tags: 980505 980506
#
User CPU MPP
Count Hours Hours
----- ------ ------
5 1451.3 52.2% 1453.4 DOD
3 7.0 .3% ROOT
37 1320.6 47.5% 1359.3 UA
19 18.3 .7% 16.5 UA/ARSC
----- ------ ------
45 2779 2813 Totals
#
#Host: yukon #Tags: 980505 980506
#
User CPU MPP
Count Hours Hours
----- ------ ------
4 4.1 .1% UA/ARSC/CRAY
14 14.2 .5% 16.5 UA/ARSC/STAFF
1 UA/ARSC/WEBADM
----- ------ ------
45 2779 2813 Totals
#
The following example uses the -mask option and the -users option to get a
breakdown of users for a project, the hierarchy display was omitted by
using -level 0:
uacrep -show cpu,job -u -m UA/ARSC/STAFF -l 0 -f mrg.0505,mrg.0506
#Host: yukon #Tags: 980505 980506
#
User CPU Total
Count Hours Jobs
----- ------ ------
14 14.2 .5% 5866 UA/ARSC/STAFF
1.4 5762 :baring
0.2 2 :bastille
1 :bedford
0.2 3 :bills
1 :burton
2 :clark
55 :copyacnt
1 :horner
1 :houston
2 :ids
0.3 10 :kcarlson
6 :lforbes
5 :mcgill
12.0 .4% 7 :robinson
8 :root
----- ------ ------
45 2779 7311 Totals
#
The following example merges a months worth of collected csacrep_uacrep
files for reporting:
sort 9804/*.sum | uacrepmrg -t 9804 -h yukon -o 9804.Sum
uacrep -f 9804.Sum -h -s cpu,mpp,job
#Host: #Tags: F_0001
#
User CPU MPP Total
Count Hours Hours Jobs
----- ------ ------ ------
19 37329 75.8% 39184 2325 DOD
3 14002 28.4% 15782 655 DOD/AF
16 23327 47.3% 23401 1670 DOD/NAVY
3 15.8 10742 ROOT
65 11923 24.2% 12013 93910 UA
36 11366 23.1% 11538 2599 UA/ACADEMIC
28 557.1 1.1% 475.1 91308 UA/ARSC
1 3 UA/FEDERAL
----- ------ ------ ------
87 49268 51196 106977 Totals
#
The following example reports four months by CPU hours percentage used:
uacrep -h -s cpu -pct -f "`ls 98*.Sum`"
#Host: yukon #Tags: 9801 9802 9803 9804
#
User CPU
Count Hours 9801 9802 9803 9804
----- ------ ------ ------ ------ ------
30 135655 70.8% 52.6% 81.8% 73.0% 75.8% DOD
4 37490 19.6% 23.7% 20.0% 6.7% 28.4% DOD/AF
2 DOD/DODOTHER
24 98166 51.2% 29.0% 61.7% 66.3% 47.3% DOD/NAVY
6 76.4 ROOT
84 55814 29.1% 47.3% 18.2% 27.0% 24.2% UA
44 52382 27.3% 42.0% 17.5% 26.8% 23.1% UA/ACADEMIC
36 3425.4 1.8% 5.3% .7% .1% 1.1% UA/ARSC
1 6.3 UA/COMMERCE
3 UA/FEDERAL
----- ------ ------ ------ ------ ------
120 191546 46641 45219 50418 49268 Totals
#
Included in the sbin directory of this distribution is a csa.user exit for
daily generation of csacrep_uacrep and monthly invocation of another sbin
script csa.ua_eom.ksh for monthly report generation. The sbin scripts will
require customization for site needs.
NOTES
These commands are applicable for Cray Unicos or Unicos/mk systems. The
uacrepmrg and uacrep programs can be run on any Unix system using reports
generated by csacrep under Unicos. The reporting has been tested under
Unicos 9.0 and 10.0 and Unicos/mk 2.0.
The uacrep and uacrepmrg commands utilizes the cci command parser utilized
by non-UNIX operating systems instead of the traditional UNIX getopt()
parsing. Options have been defined to "look like" UNIX style options, but
can be spelled out or generally abbreviated. For example '-o' is the same
as '-output'. Because of this multiple options must be space separated and
the hyphen is part of the option name. Also because of this order of
options and arguments is irrelevant.
ACKNOWLEDGEMENTS
Written at the University of Alaska.
RELATED INFORMATION
Files: /var/local/output/acct/sum/tree, /usr/adm/acct/local/sum/....
Commands: csacrep(8), uakpacct(8), uadrep(8).
Related information: csa(8).