39 |
return if (defined $df); |
return if (defined $df); |
40 |
print STDERR " [cache miss] "; |
print STDERR " [cache miss] "; |
41 |
} |
} |
42 |
open(DF,"$ssh df -klP |") || die "$ssh df: $!"; |
eval { |
43 |
|
local $SIG{ALRM} = sub { die "ssh timeout\n"; }; |
44 |
|
alarm 10; # wait for ssh to connect and return first line |
45 |
|
open(DF,"$ssh df -klP |") || die "$ssh df: $!"; |
46 |
|
}; |
47 |
|
print STDERR " read DF eof=",eof(DF); |
48 |
while(<DF>) { |
while(<DF>) { |
49 |
|
alarm 0; # turn alarm off |
50 |
chomp; |
chomp; |
51 |
my ($node,$total,$used,$aval,$use_pcnt,$mount) = split(/\s+/,$_,6); |
my ($node,$total,$used,$aval,$use_pcnt,$mount) = split(/\s+/,$_,6); |
52 |
if ($use_pcnt && $use_pcnt =~ s/(\d+)%/$1/) { |
if ($use_pcnt && $use_pcnt =~ s/(\d+)%/$1/) { |