update tablespace calc oracl

This commit is contained in:
garnier-quentin 2019-09-26 15:26:11 +02:00
parent 3a0b3656a1
commit dd00c9b4e9
1 changed files with 9 additions and 6 deletions

View File

@ -385,16 +385,19 @@ sub manage_selection {
} }
my ($percent_used, $percent_free, $used, $free, $size); my ($percent_used, $percent_free, $used, $free, $size);
if ((!defined($bytes_max)) || ($bytes_max == 0)) { if ((!defined($bytes_max)) || ($bytes_max eq '')) {
$percent_used = ($bytes - $bytes_free) / $bytes * 100; $self->{output}->output_add(long_msg => "skipping '" . $name . "': bytes max not defined.", debug => 1);
$size = $bytes; next;
$free = $bytes_free; } elsif ($bytes_max > $bytes) {
$used = $size - $free;
} else {
$percent_used = ($bytes - $bytes_free) / $bytes_max * 100; $percent_used = ($bytes - $bytes_free) / $bytes_max * 100;
$size = $bytes_max; $size = $bytes_max;
$free = $bytes_free + ($bytes_max - $bytes); $free = $bytes_free + ($bytes_max - $bytes);
$used = $size - $free; $used = $size - $free;
} else {
$percent_used = ($bytes - $bytes_free) / $bytes * 100;
$size = $bytes;
$free = $bytes_free;
$used = $size - $free;
} }
$self->{tablespace}->{$name} = { $self->{tablespace}->{$name} = {