Commit 8d422491 authored by Fulvio Galeazzi's avatar Fulvio Galeazzi
Browse files

2021-11-19: FG; Update script as per change in output format of 'df detail'.

parent 7ed39a4b
......@@ -184,23 +184,23 @@ foreach my $_line (@_data)
$poolTest = $fields[1];
}
if (exists $poolHash{$poolTest}) {
$poolHash{$poolTest}{'used'} += convertNumber($fields[3].$fields[4],'size');
$poolHash{$poolTest}{'size'} += convertNumber($fields[6].$fields[7],'size');
my $tempFrac = $fields[8];
my $tempMax = convertNumber($fields[9].$fields[10],'size');
$poolHash{$poolTest}{'used'} += convertNumber($fields[4].$fields[5],'size');
$poolHash{$poolTest}{'size'} += convertNumber($fields[7].$fields[8],'size');
my $tempFrac = $fields[9];
my $tempMax = convertNumber($fields[10].$fields[11],'size');
$tempMax = $poolHash{$poolTest}{'used'}/$tempFrac/0.01 if ($tempFrac > 1.);
$poolHash{$poolTest}{'max'} = $tempMax unless ($poolHash{$poolTest}{'max'} > $tempMax);
if ( $poolHash{$poolTest}{'max'} > 0. ) {
$poolHash{$poolTest}{'frac'} = $poolHash{$poolTest}{'used'} / $poolHash{$poolTest}{'max'};
}
$poolHash{$poolTest}{'objs'} += convertNumber($fields[5],'count');
$poolHash{$poolTest}{'objs'} += convertNumber($fields[6],'count');
} else {
$poolHash{$poolTest}{'used'} = convertNumber($fields[3].$fields[4],'size');
$poolHash{$poolTest}{'size'} = convertNumber($fields[6].$fields[7],'size');
$poolHash{$poolTest}{'frac'} = $fields[8];
$poolHash{$poolTest}{'max'} = convertNumber($fields[9].$fields[10],'size');
$poolHash{$poolTest}{'used'} = convertNumber($fields[4].$fields[5],'size');
$poolHash{$poolTest}{'size'} = convertNumber($fields[7].$fields[8],'size');
$poolHash{$poolTest}{'frac'} = $fields[9];
$poolHash{$poolTest}{'max'} = convertNumber($fields[10].$fields[11],'size');
$poolHash{$poolTest}{'max'} = $poolHash{$poolTest}{'used'}/$poolHash{$poolTest}{'frac'}/0.01 if ($poolHash{$poolTest}{'frac'} > 1.);
$poolHash{$poolTest}{'objs'} = convertNumber($fields[5],'count');
$poolHash{$poolTest}{'objs'} = convertNumber($fields[6],'count');
}
print "POOL: $poolTest ".$poolHash{$poolTest}{'used'}." ".$poolHash{$poolTest}{'max'}." ".$poolHash{$poolTest}{'size'}." ".$poolHash{$poolTest}{'frac'}." ".$poolHash{$poolTest}{'objs'}."\n" if (defined $opt_debug);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment