(plugin) database::oracle - mode fra-usage fix float comma (#3983)

This commit is contained in:
qgarnier 2022-10-13 08:44:22 +02:00 committed by GitHub
parent 7ba30060b5
commit a966b94526
2 changed files with 10 additions and 4 deletions

View File

@ -132,6 +132,9 @@ sub manage_selection {
$self->{file}->{ $row->[0] }->{percent_space_reclaimable} = $row->[2] * 100 / $row->[3]; $self->{file}->{ $row->[0] }->{percent_space_reclaimable} = $row->[2] * 100 / $row->[3];
} }
$self->{file}->{ $row->[0] }->{percent_space_usage} =~ s/,/./;
$self->{file}->{ $row->[0] }->{percent_space_reclaimable} =~ s/,/./;
$self->{global}->{percent_space_usage} += $self->{file}->{ $row->[0] }->{percent_space_usage}; $self->{global}->{percent_space_usage} += $self->{file}->{ $row->[0] }->{percent_space_usage};
$self->{global}->{percent_space_reclaimable} += $self->{file}->{ $row->[0] }->{percent_space_reclaimable}; $self->{global}->{percent_space_reclaimable} += $self->{file}->{ $row->[0] }->{percent_space_reclaimable};
} }

View File

@ -81,8 +81,10 @@ sub new {
"timezone:s" => { name => 'timezone' }, "timezone:s" => { name => 'timezone' },
}); });
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'DateTime', centreon::plugins::misc::mymodule_load(
error_msg => "Cannot load module 'DateTime'."); output => $self->{output}, module => 'DateTime',
error_msg => "Cannot load module 'DateTime'."
);
$self->{statefile_cache} = centreon::plugins::statefile->new(%options); $self->{statefile_cache} = centreon::plugins::statefile->new(%options);
return $self; return $self;
} }
@ -143,7 +145,7 @@ sub manage_selection {
hour => $values[2], hour => $values[2],
minute => $values[1], minute => $values[1],
second => $values[0], second => $values[0],
time_zone => 'UTC', time_zone => 'UTC'
); );
next if (defined($self->{option_results}->{memory}) && defined($last_time) && $last_time > $dt->epoch); next if (defined($self->{option_results}->{memory}) && defined($last_time) && $last_time > $dt->epoch);
@ -155,7 +157,8 @@ sub manage_selection {
sql_text => defined($row[4]) ? $row[4] : '-', sql_text => defined($row[4]) ? $row[4] : '-',
username => defined($row[5]) ? $row[5] : '-', username => defined($row[5]) ? $row[5] : '-',
since => $since, since => $since,
generation_time => centreon::plugins::misc::change_seconds(value => $since) }; generation_time => centreon::plugins::misc::change_seconds(value => $since)
};
$i++; $i++;
} }