.nhy .TITLE DSM - Disk Storage Monitor .b OVERVIEW .p DSM provides a method of keeping check on disk storage. At A.R.A.P. casual reminders to users to clean up directories has proved to be ineffective in preserving a resonable amount of free space on our RP06's. Users seldom take the time to remove unwanted or little used files. A few weeks after cleaning up we would find ourselves with only 5000 free blocks. DSM makes daily checks of disk allocations and automatically reminds users when allocations are exceeded. .p Disk allocation limits are specified on the basis of a uic or group of uics. Allocations are checked once daily at A.R.A.P. Enforcement is accomplished via messages at login, purging accounts, or revoking privileges (refer to memo8a on [360,215] for a detailed description of enforcement procedures). .p DSM has proved effective in keeping reign on our disk space. Users generally comply with only warning messages, the threat of more severe penalties being enough to prompt users to keep disk usage within bounds. .b MECHANISM .p DSM began as a faster way to do DIR/SUM [*,*], which under PIP can take up to 2 hours on RP06 packs. DSM gathers and totals block usage on a directory basis, rather than by file owner. It was done this way simply because it better suits A.R.A.P.'s uic structure. .p The summation is done as follows. All directories on a particular volume are scanned and a map file generated which indicates which file ID numbers (file headers) belong to which uic's. Then INDEXF.SYS (file header file) is read sequentially while the generated uic map file is simultaneously scanned. When a uic is found the blocks allocated are retreived from the corresponding file header in INDEXF.SYS. When the end of the index file is reached all directories will be totaled up. Now all that remains is to check the totals against allocations and take the appropriate action. .b INSTALLATION and OPERATION .p Installing DSM consists of 3 steps: .b .lm+9 .i-4 1.##Compile/assemble and build DSM.TSK .br Use the PDS command file DSMBLD.CMD for this. Install DSM.TSK as $$$DSM under uic [1,1]. Note that DSMPR2.MAC checks that 'DSM' is what appears on the command line. Modify DSMPR2.MAC if you want to change the name to something other than 'DSM'. .b .i-4 2.##Compile and build NOT.TSK .br NOT is the notice task which will be run when a user logs in. Normally ...PIP is used to print NOTICE.TXT. NOT is substituted in the PDS login module. Step 3 applies the patch to PDS. See notes below for more on what ...NOT does. .b .i-4 3.##Apply the patch to the PDS login module. .br Copy ARAPLOGI.CMD and ARAPLOGI.PAT to [11,100]. This patch procedure uses PAT with checksums, and should be reliable. See comments in the patch command file. ARAPLOGI.CMD will extract the login module from PDS.OLB and patch it with ARAPLOGI.PAT, resulting in ARAPLOGI.OBJ;2. Do not put ARAPLOGI.OBJ into the PDS library! Edit PDSODL.ODL so that the patch login module will be linked into PDS. Change the line .b O1170:##.FCTR###LOGI-[11,100]PDS/LB:LOGI .br ############to .br O1170:##.FCTR###LOGI-[11,100]ARAPLOGI .b Re-build PDS and then re-install it. .lm-9 .p DSM should now be ready to use. It is used in two modes. If it is run as a timesharing task it will give a summary of the requested directories. Syntax is: .b .i+9 DSM dev:[uic1]+[uic2]...+[uicn] .b Refer to memo8b on [360,215] for more details. .b If it is run as a realtime task DSM will check disk allocations. DSM determines whether or not it is realtime by a GETMCR failure. If it is running realtime it will sum all directories on the devices specified in the DATA statement in DSMMN.FTN (change IDEV and MAXDEV to be appropriate for your system). DSMMN.FTN is currently set up to look at DB0: and DB2:. The maximum number of directories per device is currently set at 300. Change the dimension of ISTAT in DSMCM.COM and MAXUIC in DSMMN.FTN if this is too small for your application. Recompile and build DSM if DSMCM.COM is changed. .B FILE USAGE .p DSM uses 4 files on LB0:[1,1] for the disk allocation checking. Only the allocation specification file need exist to run DSM in realtime (checking) mode for the first time. The other three files will be generated by DSM. .b .lm+9 .i-9 DSM.DAT - this is the allocation specification file. A template copy is included on [360,215]. Tailor it to your needs. This file was formerly called DSMALSP.DAT. .b .i-9 DSM.LOG - logs DSM checking activity and errors. A sample DSM.LOG is included on [360,215]. .b .i-9 DSMMSG.DAT - This keeps track of the number of warnings an account has received. It checksums the allocation specification record to make sure that the specification has not been changed. If the specification has been changed, the warnings are set back to zero and any revoked privileges will be restored. DSMMSG.DAT also contains the privilege mask at the time privileges are revoked. Privileges can then be properly reset when disk usage falls within limits. For this reason, DSMMSG.DAT should never be deleted if any of the UPF privilege masks have been modified by DSM. The privilege mask for revoking privileges is IRVMSK in DSMCM.COM. Change to suit. .b .i-9 DSMNOT.DAT - This file contains the summary information for all uics and all devices (specified in DSMMN.FTN) and any allocation warning messages that a user will receive upon login. .b .lm-9 NOTES .p The patch to PDS forces ...NOT to be run every time a user logs in, even if the /NONOTICE switch is used. ...NOT examines the command line passed to it to see if it was /NONOTICE. If so it does not print the notices. Note that BATNOTICE.TXT will never be used as it is used as a notice flag on the command line. Also NOT.FTN suppresses any batch notice printing to speed login in batch (normally there is no way to suppress notices during batch login). NOT retreives the users default uic from the command line and searches DSMNOT.DAT to see if there are any warning messages to be typed out for this user. If there is a message, it is printed along with the disk utilization numbers for his uic. If /NONOTICE was specified, and there are no warnings to type, ...NOT exits. Otherwise, disk utilization numbers for this users will be displayed. .p We schedule $$$DSM to run every 24 hours at 5:00 am. .b RUN/INT:24H/SCHED:05:00:00/UIC:[1,1]/PRIO:110 $$$DSM .b The warnings (if there are any) are incremented each time $$$DSM is run (realtime). Therefore if scheduled to run twice a day the enforcement rules will be applied in half the time span. E.G., message _#8 triggers the next step (PIP /PU etc.) which normally allows a week for a user to clean up before files get deleted. If $$$DSM is run twice daily, this would only allow 3.5 days before message _#8 and its consequences would be reached. The warning _#'s at which the next level of action takes place can be changed by editing DSMCM.COM and changing IDLLIM (delete limit) and IRVLIM (revoke limit). .p DSMUSERS on [360,215] reads PDSUPF.DAT and lists all users and their default uic in alphabetical order. Output is to unit 6.