man uadrep





NAME


  uadrep, uadrepmrg, disku.ksh,	disku.nawk
   - Unicos[/mk] diskusg merging and hierarchical reporting


SYNOPSIS


  # via	disku.ksh (typically from csa.user):
   /usr/lib/acct/diskusg -H -E -a devices |
   grep	-v "^#"	|
   nawk	-v HOST=host -v	DEVI=device_abbr -v DATE=yyyymmdd.hhmm \
    -f disku.nawk >files.yyyymmdd

  # monthly or periodic:
   sort	-k9.1,9.8 -k1 -k2 files.* |
   uadrepmrg [-tag tag_name] |
   sort	-o disku.merged
   uadrep -f disku.merged [-options]


DESCRIPTION


  The disku.ksh|disku.nawk, uadrepmrg, and uadrep programs are a series	to
  re-format Unicos diskusg reports by merging and reporting by a project tree
  hierarchy.

  The disku.ksh	script is generally run	daily to generate diskusg report
  files	which are reformatted using the	disku.nawk script.  The	resulting
  file contains:
      project	      project name
      userid	      username (paired with project)
      kFiles	 ftot files/1,000
      kF_Onl	 fonl files/1,000 online
      kF_Off	 foff files/1,000 offline
      MByt_Total mtot megabytes	total
      MB_Online	 monl megabytes	online
      MB_Offline moff megabytes	offline
      system	      system/file-system identification
      days	      days summarized

  The disku.ksh	script will require customization to recognize host names and
  appropriate file systems for collection.

  The uadrepmrg	program	will merge by user/project combinations	multiple
  files	reformated by disku.ksh	or previous uadrepmrg executions.

  The uadrep program reports by	a pre-defined project tree hierarchy one or
  more files generated by uadrepmrg.  Typically	one or more daily or monthly
  files	generated by disku.ksh and uadrepmrg are reported.  Reporting can be
  on any of the	metics mentioned above.	 Two reports are generated with
  uadrep, the first is a report	by hierarchy to	a pre-specified	level
  (depth).  The	second report is per-project or	for masked projects.


OPTIONS uadrep


  -file	file1[,file2,...]
       Up to 12	files created by uadrepmrg 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:
	 ftot, fonl, foff, mtot, monl, moff

  Use '-show all' for all fields, the defaults is 'monl' (megabytes online).
  This option specifies	which metrics to display in the	report.	 The fields
  are displayed	left to	right in the order specified.  The fields are
  displayed either as a	total or a percentage if -pct is specified.  If	more
  than one field type is specified then	exactly	one device must	be specified.

  -device dev1[,dev2,...]

  The devices are whatever abbreviations were supplied via disku.ksh.  The
  default is all devices found within the file.	 If more than one device is
  specified exactly one	show field type	must be	specified.

  -pct This is a flag to indicate fields 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 uadrepmrg


  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 uadrep 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 uadrep 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 uadrepmrg is directed	to stderr not stdout.


OPTIONS csadrep_uadrep


  This korn script has no arguments and	must be	customized for appropriate
  hostnames and	filesystems to report on.


EXAMPLES


  The following	example	takes disku.ksh	output files from two days and pro-
  duces	a two day total. The -h	option is used to show only the	hierarchy
  report.

    sort /var/local/output/acct/dacct/19980728.files.* |
    uadrepmrg -o out.19980728
    sort /var/local/output/acct/dacct/19980727.files.* |
    uadrepmrg -o out.19980727
    uadrep -f out.19980727,out.19980728	-h -l2 \
      -tree /allsys/local/acct/summary/tree
    #Host:  H_0001	    #Tag:   F_0001  Days:   1.0
    #Host:  H_0002	    #Tag:   F_0002  Days:   1.0
    #
    User  chiHom chiTmp	chiAll chiViz
    Count MByOnl MByOnl	MByOnl MByOnl
    ----- ------ ------	------ ------

      120  41488  22314		      DOD

       10  514.4		      DOD/AF
       10  564.5		      DOD/ARMY
	2  424.6		      DOD/BMDO
	4   57.4		      DOD/DODOTHER
       94  39927  22314		      DOD/NAVY

	1    1.6   74.7	6280.8	      ROOT

      287  30580  20242	 30855	  0.8 UA

      174  24982  19192		      UA/ACADEMIC
       90 4657.2 1005.4	 30855	  0.8 UA/ARSC
	2   27.4		      UA/COMMERCE
       21  913.7   44.7		      UA/FEDERAL

	4    5.0		      Unknown
    ----- ------ ------	------ ------
      412  72075  42631	 37135	    1 Totals: MByOnl Days:1.0 H_0001
    #

  The following	example	combines the uadrepmrg output files from above and
  produces an identical	two day	total:

    sort -k9.1,9.8 -k2 out.19980727 out.19980728 |
    uadrepmrg -h chilkoot -t test |
    sort -o out.both
    uadrep -f out.both -h -l2 \
      -tree /allsys/local/acct/summary/tree
    #Host:  H_0001	    #Tag:   F_0001  Days:   2.0
    #
    User  chiHom chiTmp	chiAll chiViz
    Count MByOnl MByOnl	MByOnl MByOnl
    ----- ------ ------	------ ------

      120  41488  22314		      DOD

       10  514.4		      DOD/AF
       10  564.5		      DOD/ARMY
	2  424.6		      DOD/BMDO
	4   57.4		      DOD/DODOTHER
       94  39927  22314		      DOD/NAVY

	1    1.6   74.7	6280.8	      ROOT

      287  30580  20242	 30855	  0.8 UA

      174  24982  19192		      UA/ACADEMIC
       90 4657.2 1005.4	 30855	  0.8 UA/ARSC
	2   27.4		      UA/COMMERCE
       21  913.7   44.7		      UA/FEDERAL

	4    5.0		      Unknown
    ----- ------ ------	------ ------
      412  72075  42631	 37135	    1 Totals: MByOnl Days:2.0 H_0001
    #

  Comparing each day's total for the filesytem identified as 'chiAll':

    uadrep -f out.19980727,out.19980728	-h -l2 \
      -tree /allsys/local/acct/summary/tree \
      -d chiAll
    #Host:  H_0001	    #Tag:   F_0001  Days:   1.0
    #Host:  H_0002	    #Tag:   F_0002  Days:   1.0
    #
    Days:    2.0    1.0	   1.0
    #
    User  chiAll	MByOnl MByOnl
    Count total		F_0001 F_0002
    ----- ------	------ ------

	1 6280.8  16.9%	3140.4 3140.4 ROOT

       15  30855  83.1%	 16709	14146 UA

       15  30855  83.1%	 16709	14146 UA/ARSC
    ----- ------	------ ------
       16  37135	 19849	17286 Totals: chiAll,MByOnl Days:1.0 H_0001
    #

  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:

    uadrep -f out.19980727,out.19980728	\
      -tree /allsys/local/acct/summary/tree \
      -d chiAll	-u -m UA/ARSC/STAFF -l 0
    #Host:  H_0001	    #Tag:   F_0001  Days:   1.0
    #Host:  H_0002	    #Tag:   F_0002  Days:   1.0
    #
    Days:    2.0    1.0	   1.0
    #
    User  chiAll	MByOnl MByOnl
    Count total		F_0001 F_0002
    ----- ------	------ ------
       13  30424  81.9%	 16494	13930 UA/ARSC/STAFF
	    57.4    .2%	  28.7	 28.7	:baring
	    84.8    .2%	  42.4	 42.4	:bastille
	   126.2    .3%	  62.4	 63.8	:bills
	   986.2   2.7%	 493.1	493.1	:clark
	  3988.4  10.7%	1994.2 1994.2	:edberg
	   239.2    .6%	 119.6	119.6	:houston
	  5819.1  15.7%	4192.2 1626.9	:huebert
	   627.6   1.7%	 313.4	314.2	:kcarlson
	  4852.2  13.1%	2426.1 2426.1	:lforbes
	  5238.0  14.1%	2619.0 2619.0	:mcgill
	   333.2    .9%	 166.6	166.6	:mkienenb
	  6462.4  17.4%	3231.2 3231.2	:robinson
	   442.4   1.2%	 221.2	221.2	:root
	  1167.0   3.1%	 583.5	583.5	:sysmon
    ----- ------	------ ------
       16  37135	 19849	17286 Totals: chiAll,MByOnl Days:1.0 H_0001

  Included in the sbin directory of this distribution is a csa.user exit for
  daily	generation of disku.ksh	files and 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
  uadrepmrg and	uadrep programs	can be run on any Unix system using reports
  generated by csadrep under Unicos.  The reporting has	been tested under
  Unicos 9.0 and 10.0 and Unicos/mk 2.0.

  The uadrep and uadrepmrg  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: diskusg(8),	uakpacct(8), uacrep(8).

  Related information: csa(8).