AAAREADME.TXT 4/8/92 Brian Lomasky c/o TERADYNE, INC. 321 Harrison Ave., Mail Stop H87. Boston, MA 02118 (617) 422-2259 This directory contains the actual source, object, and executable files that were referenced at the DECUS 1992 Spring Symposium held at Atlanta, GA during the "VA123 - Who's Filling Up the Disk Now?" session. -------------------------------------------------------------------------------- A typical scenario: The system manager gets called because a particular disk is very low on free space. Jobs may abort if the disk runs out of space. The problem lies in trying to figure out who (of the 3000 users who reside on that disk) is filling it up - and typing a DIRECTORY/SIZE [*...] on the entire 5-gigabyte disk takes much too long! What's a poor system manager to do? ****** PIGGY to the rescue!! ****** PIGGY is a utility that tracks changes in disk space very quickly and easily. It works by storing a "snapshot" image of the number of disk blocks used by each UIC (and resource identifier) for a given disk in a central data file. At a later time, when the system manager wants to see who is using too much space on that disk, PIGGY will create a report in just a few seconds, showing which users are using more space than the earlier "snapshot" had stored. Once the system manager knows who the "DISK PIG" is, it's just a simple matter of examining that user's directory tree for the excessively large files. -------------------------------------------------------------------------------- Restrictions and Notes: 1) PIGGY gets the disk space usage information from the disk quota file. If you have not enabled disk quotas for a given volume, you must enable "infinite" quotas for all users on the volume by typing something such as: $ MCR DISKQUOTA DISKQ>USE DISK$volume: (substituting your disk name here) DISKQ>CREATE DISKQ>MODIFY [0,0]/PERM=99999999 DISKQ>REBUILD DISKQ>EXIT (Note that SYSPRV (or equiv) privilege is required) Due to the many different UICs which might try to write files to the system disk, enabling disk quotas on the system disk is NOT recommended, since you might encounter some serious "DISK QUOTA EXCEEDED" errors if there is not an existing disk quota entry for each and every UIC which might ever write to the system disk. Therefore, PIGGY can not be used to monitor disk space usage on the system disk. 2) A logical called: TOOLS must exist, and must point to the directory where the PIGGY.DAT data file will reside 3) PIGGY needs BYPASS (or equiv) privilege so that it can successfully open its TOOLS:PIGGY.DAT file, as well as the SYSUAF file (so that it can tell the difference between a UIC and a resource identifier in the disk quota file) 4) PIGGY is invoked as a foreign DCL command. Assuming that PIGGY.EXE resides in the TOOLS: directory, add the following line to your LOGIN.COM file: $ PIGGY :== $TOOLS:PIGGY -------------------------------------------------------------------------------- To create the PIGGY database file for the first time: (Assume that your system contains 3 disks other than the system disk: DISK$USER1, DISK$USER2, and DISK$USER3) 1) First cleanup all obsolete files on each of the disks that you want PIGGY to keep track of. This will allow PIGGY's "snapshot" to store a normal baseline number of disk blocks for each of the UICs (and recource identifiers) that own files on each disk. 2) Enable "infinite" disk quotas, as described above, on each of the disks that you want PIGGY to monitor. 3) Type: PIGGY DISK$USER1: INIT to create a new TOOLS:PIGGY.DAT file containing the baseline disk usage for each UIC/identifier on the DISK$USER1: disk. 4) Type: PIGGY DISK$USER2: UPDATE to add the baseline disk usage for each UIC/identifier on the DISK$USER2: disk to the existing TOOLS:PIGGY.DAT file. 5) Type: PIGGY DISK$USER3: UPDATE to add the baseline disk usage for each UIC/identifier on the DISK$USER3: disk to the existing TOOLS:PIGGY.DAT file. -------------------------------------------------------------------------------- In the future, when you want to see who's using too much space on a disk (example of DISK$USER2:), type: PIGGY DISK$USER2: In just a very short time, a PIG.LIS report will be created, detailing the baseline and current disk usages, as well as the actual and percentage change, for all "PIGGISH" users. PIGGY uses two filters to eliminate the non-PIGGY users from the report: 1) A minimum number of blocks that you want to appear on the report. Any user disk quota which grows by less than this number of disk blocks will not be included in the report. Default of 1000 blocks, unless overridden by the options BLOCKn argument (see below for details). 2) A minimum percentage of blocks that you want to appear on the report. Any user disk quota which grows by less than this percentage of disk blocks will not be included in the report. Default of 20 percent, unless overridden by the options PCTnnn argument (see below for details). You can then examine the report and take corrective action against the offending users (cattle prods are highly effective!) A sample report is as follows: PIGGY Report for DISK$HAM56: on 08-Apr-92 02:17 PM (20% limit, 1000 blocks) (Last update was 07-Apr-92 09:13 AM)(Skipping negative diffs) Curr-Usage Prev-Usage Difference %Diff [SYSTEM] 94335 77255 17080 22% [WOODS] 14686 11039 3647 33% [FERRON] 64318 9607 54711 569% [GREER] 18075 12333 5742 46% [UNIXACCESS] 1811 723 1088 155% (Note that user FERRON's disk space has increased by 54711 blocks since that user's baseline number of 9607 disk blocks was stored). -------------------------------------------------------------------------------- PIGGY has a help screen, which is displayed if you type just the PIGGY command at your DCL prompt, without any following parameters or qualifiers. It lists all of the possible arguments that PIGGY allows: Disk Piggy Utility V1.1 Error - No arguments specified. Valid arguments are: dddd = (where dddd=any disk name) Specifies disk to be reported on PCTnnn = (where nnn=0 to 100) Specifies smallest percent change in disk space usage that you want to appear on the report (Default of 20%) BLOCKn = (where n=0 to 999999999) Specifies smallest number of different disk blocks used that you want to appear on the report (Default of 1000) NEG = Also print any negative disk block differences NOXLATE = No uic-to-identifier translation is to be performed ----- Special Restricted Qualifiers Follow: ----- UPDATE = Compare PIGGY values and then update the PIGGY database for all users UPDATE=ident = Compare PIGGY values and then update the PIGGY database with the info only for the specified identifier/username (The above 2 options not allowed with DUMP or NOXLATE) INIT = Initialize the PIGGY database with current disk quota values USERS = Create report containing list of usernames, block size diff, and captive/dismail/ident flags, for existing PIGGY users (This option not allowed with INIT, DUMP, NEG, or NOXLATE) Each of the possible arguments are explained, as follows: 1) Immediately after the PIGGY command must be the specification of the disk that you want to access. This is the only required argument. If this is the only argument which is specified, then a PIG.LIS report will be created, indicating all of the users who are pigging up the disk (comparing each user's stored baseline number of blocks with the current number of blocks used, as stored in the disk quota file). (Except when you specify the INIT argument, PIGGY always creates a PIG.LIS report file). 2) The PCTnnn argument is used when you're creating a PIG.LIS report, but you want to use a different threshold for the minimum percentage (Default of 20% if this argument if not specified). 3) The BLOCKn argument is used when you're creating a PIG.LIS report, but you want to use a different threshold for the minimum growth in the number of disk blocks (Default of 1000 blocks if this argument if not specified). 4) The NEG argument is used when you want to include users whose disk blocks have decreased between the baseline amount and the current amount, in addition to the users where the number of disk blocks have grown. 5) The NOXLATE argument is used if you want to see the actual UIC values (rather than the usual username translation) in the report. 6) The UPDATE argument is used to update the TOOLS:PIGGY.DAT data file with new baseline disk space usages for ALL users on the given disk. 7) The UPDATE=username argument is used to update the TOOLS:PIGGY.DAT data file with a new baseline disk space usage for one specific username on the given disk. 8) The INIT argument is used to create a new version of the TOOLS:PIGGY.DAT data file, containing only the baseline disk space usages for ALL users on the given disk; No other disk's baseline information will be stored. 9) The USERS argument is used to create a PIG.LIS report containing a comma-separated list of usernames or identifiers, block size differences, and captive/dismail/identifier flags, for all existing PIGGY users on the specified disk. This file can then be easily read and parsed by DCL, so that you can build your own special reporting and/or notification systems. -------------------------------------------------------------------------------- List of contained files: AAAREADME.TXT This file GET_RMS_STATUS.BAS VAX BASIC source code for a function called by PIGGY.BAS GET_RMS_STATUS.OBJ Compiled version of GET_RMS_STATUS.BAS PIGGY.BAS VAX BASIC source code for the PIGGY.EXE program PIGGY.BLD Command procedure to compile and link PIGGY.EXE from the source files PIGGY.EXE Linked version of PIGGY.OBJ PIGGY.OBJ Compiled version of PIGGY.BAS You should not need to recompile or relink the executable unless you need to change the features of the program. VAX BASIC V3.n or higher is required to compile this program. This program has been tested on VMS V5.3 and V5.4