- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Calculate Diskspace
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 12:13 AM
08-11-2004 12:13 AM
I would need to calculate the total disk space available on a cluster and also the free/used space.
Is there a smart way of doing this? Instead of writing a DCL. I would appreciate if you could share your thoughts. The method that i can think of is
1. Do a $sh dev dsa
2. Output the command above to a file and
make calculations.
I was wondering if there is any other way.
Thanks
Mobeen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 12:40 AM
08-11-2004 12:40 AM
Re: Calculate Diskspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 12:41 AM
08-11-2004 12:41 AM
Re: Calculate Diskspace
I think is more simple:
$ TOT=F$GETDVI("DSA","MAXBLOCK")
$ FRE=F$GETDVI("DSA","FREEBLOCKS")
then you can make any evaluation you need.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 12:42 AM
08-11-2004 12:42 AM
Re: Calculate Diskspace
instead of writing DCL
well, if you don't object to USING DCL, have a look at
http://dcl.openvms.org/stories.php?story=04/05/27/8944070
hth
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 12:42 AM
08-11-2004 12:42 AM
Re: Calculate Diskspace
still DCL, but using lexical functions:
$ tot_f = 0
$ tot_m = 0
$loop:
$ dev = F$DEVICE("*","DISK")
$ IF dev .EQS. "" THEN $ goto exit
$ IF .NOT. F$GETDVI(dev,"MNT") THEN $ GOTO loop
$ IF F$GETDVI(dev,"SHDW_MEMBER") THEN $ GOTO loop
$ f = F$GETDVI(dev,"FREEBLOCKS")
$ m = F$GETDVI(dev,"MAXBLOCK")
$ WRITE SYS$OUTPUT "''dev' free=''f' max=''m'"
$ tot_f = tot_f + f
$ tot_m = tot_m + m
$ GOTO loop
$!
$exit:
$ SHOW SYMB tot_f
$ SHOW SYMB tot_m
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 01:14 AM
08-11-2004 01:14 AM
Re: Calculate Diskspace
Thanks for all your thoughts. I would now like to add an additional criteria into this calculation -
I would like to divide the disks into 2 categories and find out the total storage on category1 disks and the same with category 2 disks
That is i need to do the following
1. Find out the total disk space cluster
wide
2. Find out the total free space cluster
wide
3. Find out the total used space for
category 1 disks
4. Find out the total used space for
category 2 disks
Category 1 and Category 2 disks are all DSAs and they are fixed. Does this mean that the only way for me is to create 2 files CATEGORY1.TXT and CATEGORY2.TXT and read them from these and calculate using DCL or is there any other way.
I appreciate all your help....
Its really amazing to see the response and the way different people think....
Thanks
Mobeen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 01:37 AM
08-11-2004 01:37 AM
Re: Calculate Diskspace
instead of using files to store the disk names for CATEGORY1 and CATEGORY2 disks, why not use symbols. Then use F$LOCATE(dev,category1) to find out, if a device falls into one category or another.
$ category1="_DSA1:/_DSA2:/..."
$ IF F$LOCATE(dev,category1) .ne. F$LENGTH(category1)
$ THEN
$ ! device belongs into category1
$ ENDIF
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 01:46 AM
08-11-2004 01:46 AM
Solutionthe Volker's example is like you want. I can't understand which disks are in cat.1 and which in cat.2
$ tot_f = 0
$ tot_m = 0
$ t1_f = 0
$ t1_m = 0
$ t2_f = 0
$ t2_m = 0
$loop:
$ dev = F$DEVICE("*","DISK")
$ IF dev .EQS. "" THEN $ goto exit
$ IF .NOT. F$GETDVI(dev,"MNT") THEN $ GOTO loop
$ IF F$GETDVI(dev,"SHDW_MEMBER") THEN $ GOTO loop
$ f = F$GETDVI(dev,"FREEBLOCKS")
$ m = F$GETDVI(dev,"MAXBLOCK")
$ WRITE SYS$OUTPUT "''dev' free=''f' max=''m'"
$ tot_f = tot_f + f
$ tot_m = tot_m + m
$ if (......)
$ then
$ t1_f = t1_f + f
$ t1_m = t1_m + m
$ else
$ t2_f = t2_f + f
$ t2_m = t2_m + m
$ endif
$ GOTO loop
$!
$exit:
$ t1_used=t1_m - t1_f
$ t2_used=t2_m - t1_f
$ open/write tgt categoy1.txt
$ write tgt "Total space = ''tot_m'"
$ write tgt "Global free space = ''tot_f'"
$ write tgt "Cat.1 used = ''t1_used'"
$ close tgt
$ open/write tgt categoy2.txt
$ write tgt "Total space = ''tot_m'"
$ write tgt "Global free space = ''tot_f'"
$ write tgt "Cat.2 used = ''t2_used'"
$ close tgt
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 01:52 AM
08-11-2004 01:52 AM
Re: Calculate Diskspace
Lets say my definition of Category 1 and Category 2 is as follows
Category 1 - All DSAs with a label like
DATA%
Category 2 - All DSA with a label like
MFG%
Yes, i did think about using Symbols as against the files, its probably easier to do this with symbols
regards
Mobeen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 02:00 AM
08-11-2004 02:00 AM
Re: Calculate Diskspace
$ tot_m = 0
$ t1_f = 0
$ t1_m = 0
$ t2_f = 0
$ t2_m = 0
$loop:
$ dev = F$DEVICE("*","DISK")
$ IF dev .EQS. "" THEN $ goto exit
$ IF .NOT. F$GETDVI(dev,"MNT") THEN $ GOTO loop
$ IF F$GETDVI(dev,"SHDW_MEMBER") THEN $ GOTO loop
$ f = F$GETDVI(dev,"FREEBLOCKS")
$ m = F$GETDVI(dev,"MAXBLOCK")
$ WRITE SYS$OUTPUT "''dev' free=''f' max=''m'"
$ tot_f = tot_f + f
$ tot_m = tot_m + m
$ vlbl = F$GETDVI(dev,"VOLNAM")
$ if f$extr(0,4,vlbl).eqs."DATA"
$ then
$ t1_f = t1_f + f
$ t1_m = t1_m + m
$ endif
$ if f$extr(0,3,vlbl).eqs."MFG"
$ then
$ t2_f = t2_f + f
$ t2_m = t2_m + m
$ endif
$ GOTO loop
$!
$exit:
$ t1_used=t1_m - t1_f
$ t2_used=t2_m - t1_f
$ open/write tgt categoy1.txt
$ write tgt "Total space = ''tot_m'"
$ write tgt "Global free space = ''tot_f'"
$ write tgt "Cat.1 used = ''t1_used'"
$ close tgt
$ open/write tgt categoy2.txt
$ write tgt "Total space = ''tot_m'"
$ write tgt "Global free space = ''tot_f'"
$ write tgt "Cat.2 used = ''t2_used'"
$ close tgt
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 03:18 AM
08-11-2004 03:18 AM
Re: Calculate Diskspace
I shall work on this tomorrow and will let you know how it went and also post the DCL back here, so that some one who needs the same can use it
Thanks again
Mobeen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 04:07 AM
08-11-2004 04:07 AM
Re: Calculate Diskspace
we have a version of SPACE.COM that splits the totals in two groups.
In our case, before we were able to shadow multisite system disks, we had a VAX and an Alpha SYTEM disk at each site, and a locally-attached dump-file-disk at each system.
We wanted them out of the "available" statistics for obvious reasons.
That version of SPACE.COM has two sets of disks; those that are included in the logical name "SYSTEM_DISKS" (comma-separated list), and those that are not.
Of course it can easily adapted for ANY subsetting of the disk-farm.
When I get to work tomorrow I'l post it (now at home).
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 04:08 AM
08-11-2004 04:08 AM
Re: Calculate Diskspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 07:59 PM
08-11-2004 07:59 PM
Re: Calculate Diskspace
http://vms.process.com/scripts/fileserv/fileserv.com?FREE
The output looks like this (better formatted on a terminal!):-
ALPHA_ROB$$ freespace
Device Name Volume Label Type Used Blocks Free Blocks Total
---------------- -------------- ------ --------------- --------------- ---------
$1$DGA1: AXPVMSSYS DGX00 15918729 (45%) 19637660 (55%) 35556389
$1$DGA2: SY0 DGX00 16800719 (48%) 18755170 (52%) 35555889
$1$DGA3: SY1 DGX00 17227509 (49%) 18328380 (51%) 35555889
$1$DGA4: SY2 DGX00 19814579 (56%) 15741810 (44%) 35556389
$1$DGA5: SY3 DGX00 19321639 (55%) 16234750 (45%) 35556389
$1$DGA6: SY4 DGX00 18963589 (54%) 16592800 (46%) 35556389
$1$DGA7: SY6 DGX00 17052309 (48%) 18504080 (52%) 35556389
$1$DGA8: SY7 DGX00 16574209 (47%) 18982180 (53%) 35556389
$1$DGA9: SY8 DGX00 19412779 (55%) 16143610 (45%) 35556389
$1$DGA10: SY9 DGX00 22468034 (64%) 13088355 (36%) 35556389
$1$DGA11: RESTORE DGX00 10092314 (29%) 25464075 (71%) 35556389
$1$DGA20: SY5 DGX00 15465199 (44%) 20091190 (56%) 35556389
$1$DGA100: AXPSYS072 DGX00 24521694 (69%) 11034695 (31%) 35556389
$1$DGA101: ROGER DGX00 34162059 (97%) 1394330 ( 3%) 35556389
$1$DGA102: RUSEL DGX00 35411699 (**%) 144690 ( 0%) 35556389
$1$DGA103: GARY DGX00 35159524 (99%) 396865 ( 1%) 35556389
$1$DGA104: CHRISH DGX00 33729844 (95%) 1826545 ( 5%) 35556389
$1$DGA105: DAN DGX00 31409379 (89%) 4147010 (11%) 35556389
$1$DGA106: MIKE DGX00 32601304 (92%) 2955085 ( 8%) 35556389
$1$DGA107: EDDIE DGX00 33001424 (93%) 2554965 ( 7%) 35556389
$1$DGA108: SUPPORT DGX00 33873589 (96%) 1682800 ( 4%) 35556389
$1$DGA109: CONTRACT1 DGX00 34194749 (97%) 1361640 ( 3%) 35556389
$1$DGA110: CHRISF DGX00 34774699 (98%) 781690 ( 2%) 35556389
$1$DGA111: PUBDEV DGX00 34450109 (97%) 1106280 ( 3%) 35556389
$1$DGA112: CONTRACT2 DGX00 26652284 (75%) 8904105 (25%) 35556389
$1$DGA113: JAMIE DGX00 32771439 (93%) 2784950 ( 7%) 35556389
$1$DGA114: OPS DGX00 32747849 (93%) 2808540 ( 7%) 35556389
$1$DGA115: ROBERT DGX00 20237134 (57%) 15319255 (43%) 35556389
$1$DKA0: ARCHIVE1 DKX00 10636290 (60%) 7137234 (40%) 17773524
Totals: 29 mounted disks 373459MB (72%) 145346MB (28%) 518805MB
Rob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 09:28 PM
08-11-2004 09:28 PM
Re: Calculate Diskspace
as promised
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 09:37 PM
08-11-2004 09:37 PM
Re: Calculate Diskspace
What this routine needs, is a (proferable clusterwide) logical name with a list of disk labels.
Example: define /table=.. DATA_DISKS ".DATA1,DATA2,EXTRADATA,"
Please note the comma's at begin and end.
Without them, DATA1 would also include DATA10, DATA11 etc!
Of course, you have to change the F$TRNLNM in the procedure from SYSTEMDISKS to use your own logical name.
Success!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2004 10:00 AM
08-12-2004 10:00 AM
Re: Calculate Diskspace
$ def/sys backup_device_1 -
condev_axp:,-
dev_disk_1:,dev_disk_2:
$ def/sys backup_device_2 -
condev_vms:,-
condev_utl:,-
dev_disk_3:
2. We write the disk info to a file.
3. For clusters that have disks that tend to fill up, we emailed the disk usage file to the key application person(s) for that cluster. That way they are aware of how much free disk space they have left on their cluster.
Lawrence