Operating System - OpenVMS
1830242 Members
2169 Online
109999 Solutions
New Discussion

Re: Disk space allocation

 
SOLVED
Go to solution
Tim Nelson
Honored Contributor

Disk space allocation

I am working on some scripts to report on disk allocations and usage.
The show dev d /mount command gives me the currently free count and the output is great to work with, i.e. line by line space separated. The one additional item I need is total allocated to that disk / file system. I would love something that looked like a bdf or df -k output.
I apologize if I have missed the easy answer in the doc or help.
Thanks in advance.
20 REPLIES 20
Ian Miller.
Honored Contributor
Solution

Re: Disk space allocation

see F$GETDVI("devicename","FREEBLOCKS")
and F$GETDVI("devicename","MAXBLOCKS")

for example of use see
http://dcl.openvms.org/stories.php?story=04/01/11/4165701
____________________
Purely Personal Opinion
Tim Nelson
Honored Contributor

Re: Disk space allocation

THanks again Ian for the quick answer. I have not quite got a handle on some of the tricks with the functions.

If I could give you 100 pts I would.

Thanks !!!! Have a great weekend.
Lokesh_2
Esteemed Contributor

Re: Disk space allocation

Hi,

See the online help for lexical f$getdvi . You can extract many more information about the disk.

$help lexical f$getdvi

HTH,
Best regards,
Lokesh Jain
What would you do with your life if you knew you could not fail?
Tim Nelson
Honored Contributor

Re: Disk space allocation

Thanks Lokesh..

As you can tell I am an HPUX guy but not yet a VMS guy.

Thanks for the direction.
Hein van den Heuvel
Honored Contributor

Re: Disk space allocation



Using the lexical f$getdvi in a DCL script is definetly the VMS style / native solution.
Btw... be sure to check out lexical f$device to get you a list of intereting (mounted!) deviced to loop through.

If you want to solve the problem more in a unix style then just use SHOW DEV/FULL/MOUN
and parse for "Total blocks 999999"
and "Free blocks 99999".

btw... I suspect that the 'real problem' you are trying to solve has been solved many times before, both in freeware and commercial packages. Still... this could be a fun excersize to get into VMS!

Enjoy,
Hein.



Tim Nelson
Honored Contributor

Re: Disk space allocation

Thanks Hein, You hit it on the head. Cannot learn for myself if I use someone elses utility.

Thanks for the tips!!!
Ian Miller.
Honored Contributor

Re: Disk space allocation

I guess a unix style answer is
pipe show dev/mount/fu | sear sys$input "Total blocks","Free blocks","Disk"

(or I guess this could be done in perl with the VMS::getdvi module)
but you don't want to do that do you :-)

Write some DCL using F$GETDVI - its fun and educational!

See http://dcl.openvms.org for examples.

____________________
Purely Personal Opinion
Tim Nelson
Honored Contributor

Re: Disk space allocation

Actually Ian. This is what I am working on.
Instead of stuggling the ins and outs with DCL scripting I am going to run some remote shells from a UNIX system to VMS so I can take the output and send it through awk so I can get some quick reporting done.
Someother day will be spent learning DCL.

Thanks !
Ian Miller.
Honored Contributor

Re: Disk space allocation

awk is available for VMS
http://vms.process.com/scripts/fileserv/fileserv_search.exe?package=GAWK&description=&author=&system=Either&language=All&RD=&RM=&RY=

or, as I said you can do it in perl using the VMS::getdvi module
____________________
Purely Personal Opinion
Tim Nelson
Honored Contributor

Re: Disk space allocation

Even better.. See I am learning loads by the minute.

Thanks !!
Ian Miller.
Honored Contributor

Re: Disk space allocation

and a pre-built perl can be obtained from
http://h71000.www7.hp.com/freeware/freeware60/perl-5_8_1/

Use the VMS::Device module (included in above)
____________________
Purely Personal Opinion
labadie_1
Honored Contributor

Re: Disk space allocation

Gawk comes with Vms (or more precisely with Tcpip 5.any)

$ gawk :== $ sys$common:gawk.exe_alpha

It is a strange idea to put it in the Snmp examples directory, but it is available.
labadie_1
Honored Contributor

Re: Disk space allocation

Instead of perl, you can use python which has other qualities (readability, easy to maintain...)

python for Vms is available at

http://vmspython.dyndns.org/

see too
http://www.ferg.org/python_presentations/python_intro_for_managers.ppt
> http://www.ferg.org/python_slides/index.html
Jan van den Ende
Honored Contributor

Re: Disk space allocation

I have posted 2 procedures at DCL.OPENVMS:

SPACE.COM is activated at a terminal(-session). It presents an overview of disk usage 1 line per disk.

MONITOR_DEVICES.COM can also be run at a terminal session, but it is INTENDED to be ran in a MOTIF display window. It presents disk usage as a percentage bar, but also checks clusterwide mount statusses & shadow statusses. Non-nominal situations are highlighted.
It also gives management a nice 'moving picture', so they can show 'everything is permanently under control' (which it actually DOES help with!).

Try if you like it, and DO let me know if you run into a configuration that is NOT covered.

Enjoy.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Wim Van den Wyngaert
Honored Contributor

Re: Disk space allocation

Except monitoring free space, you should also check contiguous disk space. Programs may fail if space is too fragmented.

I don't know a method for retrieving this info in DCL so I try to create a contiguous file of 10.000 blocks every 30 minutes on almost every disk. If that fails : alarm.
Wim
Willem Grooters
Honored Contributor

Re: Disk space allocation

Freewware product svailable on CD (5.0, perhaps 6.0 as well) doing this is FREE. One line per disk.
Possibly, DFU (freeware as well) may show the same issues (and defragments as well).
Willem Grooters
OpenVMS Developer & System Manager
Wim Van den Wyngaert
Honored Contributor

Re: Disk space allocation

Thanks for the tip Willem. It is only sad to hear that DCL can not do the job.
Wim
Hein van den Heuvel
Honored Contributor

Re: Disk space allocation

Actually... specifically in a cluster, creating a large contiguous file as a test is probably the best method. (COPY/ALLOC=10000/CONT NL: dev:[000000]contig.tmp)

Cluster members have freeblock caches and the xqp will tell the other nodes to give back the free block cache before failing a request. [hmmm... not 100% sure it does this for lack of contig space]

Also... conceivably, if you fail to allocate the big file, then maybe you could release one of a few 'spare' contig space you pre-allocated and really soudn the alarm if you find your spares already released? ( $DELE dev:[000000]contig.tmp. )

groetjes,
Hein.
Thomas Simpson
Advisor

Re: Disk space allocation

Tim - Try looking in my directory for the file:
DISK_CAPACITY.COM
It produces a formatted report in GB. I have other variants if you really want it in blocks...

It also handles volume sets correctly.

Regards,
Tom
Tim Nelson
Honored Contributor

Re: Disk space allocation

Thanks to all who responded