$! ********************************************************************** $! * SHOW_FULL_DISKS.COM * $! * * $! * Display any disks with used space above a specified threshold. * $! * * $! * This software has been released into public domain. This * $! * software may be freely copied, distributed, and modified so * $! * long as it contains this message. This software is provided * $! * as is, free of charge. The author assumes no responsibility * $! * or liability for the use of this software. * $! * * $! * Richware http://richj.home.mindspring.com/Richware * $! * * $! * 13-JAN-1997 RDJ Command Procedure Creation. * $! ********************************************************************** $! $! $ Threshold = 90 ! adjust to your needs $! $ Set NoVerify $ Set NoOn $ If P1 .NES. "" $ Then $ Call Show_Disk 'P1' 'Threshold' $ Else $ Disk_Loop: $ Disk_Name = F$Device("*","Disk") $ If Disk_Name .EQS. "" Then Goto No_More_Disks $ If .NOT. F$GetDvi(Disk_Name,"AVL") Then Goto Disk_Loop $ If .NOT. F$GetDvi(Disk_Name,"MNT") Then Goto Disk_Loop $ If F$GetDvi(Disk_Name,"SHDW_MEMBER") Then Goto Disk_Loop $ If F$Extract(0,4,F$GetDvi(Disk_Name,"DevNam")) .EQS. "_DAD" Then Goto Disk_Loop $ Call Show_Disk 'Disk_Name' 'Threshold' $ Goto Disk_Loop $ No_More_Disks: $ EndIf $ Exit $! $! $! ********************************************************************** $! * Show_Disk: Display a Single Disk. * $! * P1 = Disk Name * $! * P2 = Space Threshold, as a percentage * $! ********************************************************************** $ Show_Disk: SubRoutine $ If F$GetDvi(P1,"VolCount") .GT. 1 Then Goto Exit $ Total_Blocks = F$GetDvi(P1,"MaxBlock") $ Free_Blocks = F$GetDvi(P1,"FreeBlocks") $ Used_Blocks = Total_Blocks - Free_Blocks $ PUsed = (Total_Blocks - Free_Blocks) * 100 / Total_Blocks $ If PUsed .GE. P2 $ Then $ VName = F$GetDvi(P1,"VolNam") $ HWType = F$GetDvi(P1,"Media_Name") $ Write SYS$OUTPUT F$FAO("Disk !10AS, type !4AS, is !3UW% full.", - VName, HWType, PUsed) $! Write SYS$OUTPUT "Disk ''VName', type ''HWType', is ''PUsed'% full." $ EndIf $ Exit: $ Exit $ EndSubRoutine ! Rebuild_Disk