On Thu, 3 Jul, Jon "awk is my friend" Dierks posted a wonderful idea for a
graphical/tabular discfree. I was intrigued and downloaded and implemented
his command file/awk program.
However, since I had just finished splitting my system volume set into
multiple user volumes (many thanks for the fine postings on this
subject over the past several months!), I wanted have the report tell
me which Volume set was being reported. Then, since a detail listing is more
than a page long for me, I wanted an option to produce only a total line for
each set.
Here are the results:
DETAIL REPORT
:df z
dev size utilization, Set: MPEXL_SYSTEM_VOLUME_SET
1 1.3G *************************.................................... 41%
2 1.3G *************************************........................ 61%
3 1.3G *************************************........................ 61%
4 1.3G **************************************....................... 62%
5 1.3G **************************************....................... 62%
11 1.3G **************************************....................... 62%
all 7.6G ************************************......................... 58%
dev size utilization, Set: AVICOM
33 2.0G **********************************************............... 76%
34 2.0G **********************************************............... 76%
35 2.0G ***********************************************.............. 76%
all 6.0G **********************************************............... 76%
dev size utilization, Set: HEMS
15 1.3G ***************************************...................... 63%
16 1.3G ***************************************...................... 63%
17 1.3G ***************************************...................... 64%
all 3.8G ***************************************...................... 63%
dev size utilization, Set: TEST
18 1.3G ************************************......................... 58%
19 1.3G ***********************************.......................... 58%
40 1.3G ***********************************.......................... 58%
all 3.8G ***********************************.......................... 58%
SUMMARY REPORT
:df y
dev size utilization, Set: MPEXL_SYSTEM_VOLUME_SET
all 7.6G ************************************......................... 58%
dev size utilization, Set: AVICOM
all 6.0G **********************************************............... 76%
dev size utilization, Set: HEMS
all 3.8G ***************************************...................... 63%
dev size utilization, Set: TEST
all 3.8G ***********************************.......................... 58%
And here are the two files, df and dfa
:print df.cmd.systems
parm format=e
setvar fmt "![UPS("!format")]"
comment Z gives detail; Y produces summary
if fmt = "Y" or fmt = "Z"
comment Add Discfree and awk lines for each Volumeset to report
RUN DISCFREE.PUB.SYS;INFO="C,,MPEXL_SYSTEM_VOLUME_SET" > DF1
/bin/awk "-f /SYSTEMS/PUB/DFA -v f=!fmt" <df1
RUN DISCFREE.PUB.SYS;INFO="C,,AVICOM" > DF1
/bin/awk "-f /SYSTEMS/PUB/DFA -v f=!fmt" <df1
RUN DISCFREE.PUB.SYS;INFO="C,,HEMS" > DF1
/bin/awk "-f /SYSTEMS/PUB/DFA -v f=!fmt" <df1
RUN DISCFREE.PUB.SYS;INFO="C,,TEST" > DF1
/bin/awk "-f /SYSTEMS/PUB/DFA -v f=!fmt" <df1
purge df1,temp
else
discfree !format
endif
:print dfa.cmd.systems
BEGIN {hd=0; }
# ldev 12 is a cd-rom on our system, not relevant for discfree
/^LDEV/ {
d=$3;
if(hd==0) {
r= " Set: " substr($5,2,index($5,":") - 2); # Volume Name
printf("%22s,%-40s\n", "dev size utilization", r); hd++;};
if(d!=12 && f=="Z") printf("%3s ",$3); # For detail, Drive num
}
/^ Device/ && d!=12 && !t {
if(f=="Z") { # Only print detail if f = "Z"
printf("%5.1fG ",$3/4/1024/1024);
for(i=0;i<$5/$3*60;i++) printf("*");
for(i=0;i<($3-$5)/$3*60;i++) printf(".");
printf(" %3d%%\n",$5/$3*100); }
tc+=$3; # accumulate disc size
tu+=$5; # accumulate disc usage
}
/^TOTALS/ {
t=1;
printf("all %5.1fG ",tc/4/1024/1024);
for(i=0;i<tu/tc*60;i++) printf("*");
for(i=0;i<(tc-tu)/tc*60;i++) printf(".");
printf(" %3d%%\n\n",tu/tc*100);
tc=0; # Reset totals/counters for next Volume set
tu=0;
hd=0;
}
My humblest apologies to those who really know awk as I'm sure my coding is
unconventional. And many thanks to Jon for his simple and elegant systems
management tool.
Mike Gabriel
Hughes Avicom International
mdgabriel @ ccgate.hac.com
|