DISKCHARGE Diskcharge is used to assign an account or charge number to a disk file or files. It is also used to display the account numbers on files in a directory (or directory tree), replace existing charge numbers with a new one, and display current summary usage. System Management uses the program to generate summary files for entry into a Resource Accounting System. During initial setup, and subsequently when the System Manager records usage, un-tagged files will be set to the account number specified in the user's authorization record in SYSUAF. AUTHORS: This is a total re-write of software originally implemented at Westinghouse Sunnyvale by Rick Naras based on discussions with Marty Adkins and Al Sorrell of Westinghouse, Baltimore. This rewrite was done by: Al Sorrell and Shari Dishop at Westinghouse ESG, Baltimore ----------------------------COPYRIGHT NOTICE--------------------------------- "(c) Copyright 1989 Westinghouse Electric Corporation, All Rights Reserved" Software Registration Number: DSC-080-89SW/A, July 26, 1989 Approved for release to DECUS 1989 Fall VAX SIG Tape, Walter G Sutcliff, ESG Baltimore Patents & Intellectual Property 9/13/89 Ronald G. Clanton, Manager, Software & Information Services 9/19/89 Westinghouse grants a limited license to use and copy this software but retains all rights to reproduce and commercially distribute this software. This software is subject to change without notice and should not be construed as a commitment by Westinghouse. This software is supplied "as-is" and no warranty is given or implied. Neither the authors, nor their employer Westinghouse assume any responsibility for the use or reliability of the software. However, we would be interested in any problems you might encounter or suggestions for improvement. You may contact the authors at: Westinghouse Electric Corporation VAX Support Group PO Box 746, MS 1615 Baltimore, Maryland, 21203 ------------------------------------------------------------------------------ This program will probably NOT be directly usable as it stands, but is intended to serve as a framework for modification and enhancements (although it will execute as provided and will allow you to place the ACES on the files, etc.) The principal problem you're likely to encounter is that it does not interface with your particular account authorization scheme. A PostScript copy of the Fall 89 VA130 presentation slides are available in this directory as DISKCHARGE_HANDOUTS.PS A SCA-generated "called-by" tree is included in CALLED_BY.TXT. This illustrates the relationship between the different routines making up the package. For a complete list of options, consult the help file DISKCHARGE.HLP. One of the key elements that each site will need to supply is a routine called FVALIDATE. This performs the account validation, i.e., is this account valid, and is this user permitted to charge it. We've provided a dummy copy as FVALIDATE_DUMMY.FOR which always returns success. Additional dummy routines are provided in MISC_DUMMY.FOR. These include: OPEN_AAF_READ which opens (Read/Only) an Account Authorization File which shows what accounts a user may charge OPEN_ACC_READ which opens (Read/Only) an Account file which shows what accounts are currently valid READ_AAF_USER which checks to see if a user may charge a given account On our systems, DISKCHARGE resides in a directory with the logical name ACC$. It expects the DISKCHARGE_ACC_FILE.FDL file which is used in creating the data file to reside in ACC$ as well as a message file ACC$:DISKCH.MSGTXT which is sent to users who attempt to charge invalid accounts. There are also a number of references to this in the two message files, ACC_ERRORS.MSG and DISKCHARGE_ERR.MSG. DISKCHARGE is implemented as a DCL verb through the use of DISKCHARGE.CLD. The program needs to be LINKed /NODEBUG/NOTRACE and INSTALLed with SYSPRV. The reason for the SYSPRV privilege is that's what's required to access the files in which we have the account authentication info. The module PRIVS.FOR defines the privileges necessary for all functions within DISKCHARGE and contains several routines which grant privileges as needed to access files. You may wish to change what privileges are necessary to perform certain functions. This is the place to *CAREFULLY* make those changes. Two command procedures are provided to compile/assemble and link the source files: COMPILE.COM and LINK.COM. They each take a P1 for optional qualifiers to the FORTRAN or LINK commands respectively. There is also a command procedure RUN_DISKCHARGE_SCAN.COM which we run once a week. This is run on each node of a cluster and kicks off batch jobs into queues named BATCH$SYSTEM or BATCH$DISKCHARGE to use the /SCAN/REPAIR options to collect usage information and "tag" files which have not had an account number set or propagated. It looks for all disks on a system and determines whether they are candidates for data collection. A disk is not checked if it is 1) A floppy (RXxx) 2) A CD (RRDx) 3) A RAM disk (ESExxx) 4) Served from a node other than the one on which the procedure is running 5) A member of a shadow set (unless it is the shadow master) 6) A member of a disk volume set (unless it is the root volume) We introduced the concept (and logical name) CLUSTER_MASTER to be used to designate one machine in a (NI, CI, or MI) cluster to perform those functions which you only want done once per cluster. Normally, the actual DISKCHARGE batch jobs would only be run on the CLUSTER_MASTER - unless it is a CI/MI cluster and there are multiple machines which are CI-attached. In that case, if a generic queue named BATCH$DISKCHARGE exists, it should feed execution queues on each machine. The DISKCHARGE jobs are then fed to that generic queue to spread the load. The reason for all the local/HSC checking is that the high volume of I/Os would be intolerable over a NI-served disk path. When DISKCHARGE/SCAN/REPAIR is completed, MAIL is sent to each user with files that have bad accounts and to all the holders of identifiers for which no entry in ACCAAF is found. The text of this message is found in ACC$:DISKCH.MSGTXT and a "subject" line is created from within the module SEND_MAIL indicating the nature of the complaint. Note that SETting an account on a directory will cause all new files created under it to have the same account applied, since the ACE has the "propagate" flag set.