[fa.info-vax] Accounting Program

info-vax@ucbvax.ARPA (06/25/85)

From: zar%xhmeia@cit-hamlet.arpa

I have made an accounting program to apply real charges to people
using your VAX VMS system (V3, V4). This software is public domain.
The only thing I ask is to be kept informed as to any changes and
extra copies made. I held back on distributing this program until
I knew what to expect from VMS V4 changes (it seems that the struc-
ture of V4 accounting files is the same as V3). Eventually, I will
make changes to read V2 accounting data files as well. A description
follows:

This program was created to be an all purpose accounting summary
program. The program, ACCNT (version 1.2), was written to read and
process VMS accounting files and allow optional "extra" accounting
files to be used for non-standard VMS accounting specific to certain
sites. ACCNT was written to assume users would have a list of charge
constants to arrive at a dollar total for resources used and does
very little in displaying resource usage by resource unit. Rather,
the summary lists a dollar sum for each resource.

ACCNT uses 3 to 4 primary files in accumulating an accounting
summary:
	PI (optional) - A (P)rincipal (I)nvestigator file contain-
	     ing a list of all account names and their associated
	     PI. This is useful if the desired summary output should
	     be listed by real names associated with account numbers.
	CHARGE - A charge constants file with a list of required
	     and optional charge constants for each standard and
	     non-standard accounting resource.
	DATA - The VMS accounting data file and/or a site-specific
	     "extra" accounting data file.

The following is a step by step example for full use of the accounting
package:
   $ ASSIGN/USER CRASH.DAT CRASH$DATA
	the previous line is a data file containg the date and times
	of system crashes and boots. The fields are:
		01:11  = Either the phrase "Crashed at:" or "Booted  at:".
		13:36  = Date and time in "dd-mmm-yyyy hh:mm:ss.ss "
		         format.
		37:?   = Explaination of crash retrieved from the first
		         message displayed by SDA.
   $ ASSIGN/USER "DTCC accounting summary" ACCT$HEADER
	the previous line will be used as the accounting summary title.
   $ RUN ACCNT
   Output filename[SYS$OUTPUT:]? 
        this will be the filename of the summary produced by ACCNT. The
        default output is your terminal or whatever the current output
        device is.
   A - Records            B - System initializations
   C - Extra(by unit)     D - Extra(by group)
   E - Extra(by user)     F - Batch(by queue)
   G - Batch(by group)    H - Batch(by user)
   I - Print(by queue)    J - Print(by group)
   K - Print(by user)     L - Group totals
   M - Individual totals  N - System user totals
   O - Inter. Histogram   P - Login failures
   Q - Charge rates

   Display what[ACFIMNQ]? 
        this question determines what will be displayed in your
        summary listing. The default is options A, C, F, I, M, N,
        and Q.
   Search for[all]? 
        this question allows you to display summary information
        about a single user or group of users. By default, all
        users with accounting records will be displayed.
   Enter "start end" dates in the form "dd-mmm-yyyy:hh:mm:ss.ss".
   [<RETURN> will use entire data set(s)]? 
        this allows you to only display accounting summary infor-
        mation during a specific time frame. By default, all records
        are used regardless of the date and time of the record.
   Enter filename to display each record[None]? 
        this allows you to create an expanded readable listing of
        each record in the VMS accounting data files. By default,
        this listing is not created.
   Enter a user totals filename[None]? 
        this option will create an keyed indexed file containing
        usernames and associated totals for the summary produced.
        By default, no user totals file is created.
   Enter invoice output filename[None]? 
        this will make a separate short totals listing for each
        account or each P.I. name encountered (very useful for send-
        ing one/two page invioce to project managers).
   Enter PI data filename[none]? 
        this asks for a (P)rincipal (I)nvestigator data file. This
        file is a keyed indexed file containing a 8 byte account
        string and a 12 byte PI string. This allows you to associate
        real names to indistinguishable account numbers used as a
        typical user's account string. By default, no P.I. data file
        is referenced or needed.
   Charge constants filename? 
        The name of a file containing charge constants for standard
        VMS and (optionally) non-standard accounting data types. The
        following is the format of this REQUIRED file (This file can
        contain blank lines or "!" to delimit comments from real data):
           Line 1 - A date/time string determining the last date
                and/or time the charge rates in this data file are
                valid for. All fields may be excluded as long as the
                punctuation marks are included (i.e. "-- ::." is the
                same as the current date and time).
           Line 2 - A formatted 8 byte (column 1-8) ASCII account
                string. This account will not be included in the
                normal user summary and is assumed to be a concealed
                SYSTEM account string.
           Line 3 - A line containing a floating point value defining
                the CPU charge for Interactive processes, Subprocesses,
                Detached processes, and Network processes.
           Line 4 - A line containing two floating point values de-
                fining the charge for using 1 Direct I/O unit and 1
                buffered I/O unit.
           Line 5 - A line containing a floating point value defining
                the charge for each mount.
           Next Line - A line containing a integer value defining the
                number of batch queues on the system. Following this,
                there must be an equivalent number of lines with the
                following information:
                   1) A string less than 17 bytes representing a batch
                      queue name.
                   2) A floating point number representing the charge
                      for CPU in this queue per hour (free format).
           Next Line - A line containing a integer value defining the
                number of print queues on the system. Following this,
                there must be an equivalent number of lines with the
                following information:
                   1) Print queue name (<17 bytes)
                   2) Charge per page printed in this queue (free
                      format)
                   3) Number of pages to add per print job (f-f)
           Next Line - A line containing a integer value defining the
                number of terminals on the system including the console
                terminal. Following this, there must be an equivalent
                number of lines with the following information:
                   1) Terminal name (<6 bytes; "TTA1:" for example)
                   2) Account to credit for use of this terminal
                      (sometimes users own their own terminals instead
                      of using a system terminal so others will be
                      renting the use of the terminal from the owner
                      not neccessarily the system) (<9 bytes)
                   3) Hourly line charge for use of this terminal
                      (always deducted from user and credited to the
                      system)
                   4) Hourly account charge for use of this terminal.
                      These charges are credited to the account string
                      defined by item 2.
           Next Line - A line containing a integer value defining the
                number of non-standard charge units. Following this,
                an equivalent number of lines with the following infor-
                mation:
                   1) The extra charge unit name (i.e. "DISK") (<5 bytes)
                   2) The value to multiply each unit with.
           Next Line - A line containing the word "YES" or "NO". This
                answers if you will charge users different rates during
                different hours of the day. If "YES", 24 lines must
                follow containing a floating point value to divide all
                charges by (i.e. 2.0 would reduce all charges on the
                computer by 1/2 whereas .5 would increase all charges
                by 2). Each line represents a different hour starting
                at hour 00 and ending with hour 23.
   Enter accounting data filename(s) (wild cards allowed)
   [SYS$MANAGER:ACCOUNTNG.DAT;0]? 
        asks for a VMS accounting data filename or names to process. An
        asterix may be used anywhere in the name to search multiple files
        but lists of names are not allowed. To only make a summary of
        non-standard accounting records, enter "NLA0:" here. By default,
        the accounting file SYS$MANAGER:ACCOUNTNG.DAT is used.
   Enter extra accounting filename[none]? 
        The name of extra accounting data files. Wild cards are allowed,
        but lists of names aren't. By default, no extra accounting data
        files are searched. The format of an extra accounting data file
        record is:
             Col 1-8   : Account string of user
             Col 10-21 : Username string
             Col 23-45 : Date and time in the form "dd-mmm-yyyy hh:mm:ss.ss"
             Col 47-50 : Extra unit name string
             Col 52-   : Number of extra units used (integer)

If you have questions about ACCNT, send your requests to:
        Mr. D. Zirin
        c/o Zar Ltd.
        P.O. Box 372
        Pasadena, CA 91102
or      ZAR%XHMEIA@CIT-HAMLET (on BITNET or ARPANET)