29 |
chomp; |
chomp; |
30 |
my ($node,$total,$used,$aval,$use_pcnt,$mount) = split(/\s+/,$_,6); |
my ($node,$total,$used,$aval,$use_pcnt,$mount) = split(/\s+/,$_,6); |
31 |
if ($use_pcnt && $use_pcnt =~ s/(\d+)%/$1/) { |
if ($use_pcnt && $use_pcnt =~ s/(\d+)%/$1/) { |
32 |
print STDERR "$_\n"; |
# print STDERR "$_\n"; |
33 |
# $df{$mount}=$use_pcnt; |
# $df{$mount}=$use_pcnt; |
34 |
$df{$mount}=$used * 100 / $total if ($total != 0); |
$df{$mount}=$used * 100 / $total if ($total != 0); |
35 |
# print $df{$mount}," == $use_pcnt\n"; |
# print $df{$mount}," == $use_pcnt\n"; |
47 |
long-desc = "edit name of your host here" |
long-desc = "edit name of your host here" |
48 |
|
|
49 |
EOF |
EOF |
50 |
|
my @targets; |
51 |
|
|
52 |
foreach my $mnt (keys %df) { |
foreach my $mnt (keys %df) { |
53 |
my $target = $mnt; |
my $target = $mnt; |
54 |
if ($mnt eq "/") { |
if ($mnt eq "/") { |
55 |
$target = "root"; |
$target = "root"; |
56 |
} else { |
} else { |
57 |
$target =~ s,^/,,; |
$target =~ s,^/,,; |
58 |
|
$target =~ s,/,_,g; |
59 |
} |
} |
60 |
|
push @targets,$target; |
61 |
print <<"EOF"; |
print <<"EOF"; |
62 |
target $target |
target $target |
63 |
target-type = usage |
target-type = usage |
65 |
|
|
66 |
EOF |
EOF |
67 |
} |
} |
68 |
|
print "target overview |
69 |
|
mtargets = \"",join("; ",@targets),"\" |
70 |
|
target-type = usage\n"; |
71 |
exit 1; |
exit 1; |
72 |
} |
} |
73 |
|
|