![]() |
![]() HP OpenVMS Systemsask the wizard |
![]() |
The Question is: I am looking for a utility to monitor the free blocks that I have left on my hard drives. Is there one available or do you have to write your own. I would like it to send me a mail message after I hit a certain %. The Answer is : There are various system monitoring tools that can perform this task. There is DCL that could easily be used, too. Something akin to the following DCL command could be run as a detached, network, or batch job, and could send out notification mail whenever the system disk free space falls below required_threshold blocks. The attached procedure checks the free space once a minute, and it includes logic that avoids sending email should the available disk free space oscillate near the user-specified required_threshold value. This DCL code has not been heavily tested, and it may contain errors. $ set noon $! required_threshold is the default value, override it via p1 $ required_threshold = 1000 $ if f$length(p1) .nes. 0 then required_threshold = f$integer(p1) $ reenable_threshold = required_threshold + (required_threshold/10) $ if reenable_threshold .gt. 10000 then reenable_threshold = 10000 $ warning_was_sent := false $loop: $ if f$getdvi("SYS$SYSDEVICE","FREEBLOCKS") .le. required_threshold $ then $ if .not. warning_was_sent $ then $ mail/subject="Disk space is below ''required_threshold'" nla0: system $ warning_was_sent := true $ endif $ else $ if f$getdvi("SYS$SYSDEVICE","FREEBLOCKS") .gt. reenable_threshold $ then $ warning_was_sent := false $ endif $ endif $ wait 00:01:00 $ goto loop To invoke this or another command procedure in a detached job, use a RUN/DETACHED command similar to the one referenced in the OpenVMS Frequently Asked Questions (FAQ).
|