--- parse_df.pl 2002/07/15 10:13:38 1.1 +++ parse_df.pl 2002/07/16 08:32:24 1.5 @@ -29,9 +29,9 @@ chomp; my ($node,$total,$used,$aval,$use_pcnt,$mount) = split(/\s+/,$_,6); if ($use_pcnt && $use_pcnt =~ s/(\d+)%/$1/) { - print STDERR "$_\n"; +# print STDERR "$_\n"; # $df{$mount}=$use_pcnt; - $df{$mount}=$used * 100 / $total; + $df{$mount}=$used * 100 / $total if ($total != 0); # print $df{$mount}," == $use_pcnt\n"; } } @@ -47,20 +47,28 @@ long-desc = "edit name of your host here" EOF + my @targets; + foreach my $mnt (keys %df) { my $target = $mnt; if ($mnt eq "/") { $target = "root"; } else { $target =~ s,^/,,; + $target =~ s,/,_,g; } + push @targets,$target; print <<"EOF"; target $target target-type = usage display-name = "$mnt" + skip-overview = 1 EOF } + print "target overview + mtargets = \"",join("; ",@targets),"\" + target-type = usage\n"; exit 1; }