From a966b94526e5f60b8cb19425588ec3a8b093ce04 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Thu, 13 Oct 2022 08:44:22 +0200 Subject: [PATCH] (plugin) database::oracle - mode fra-usage fix float comma (#3983) --- centreon-plugins/database/oracle/mode/frausage.pm | 3 +++ centreon-plugins/database/oracle/mode/longqueries.pm | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/frausage.pm b/centreon-plugins/database/oracle/mode/frausage.pm index a2c30cc33..a33e456e6 100644 --- a/centreon-plugins/database/oracle/mode/frausage.pm +++ b/centreon-plugins/database/oracle/mode/frausage.pm @@ -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_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_reclaimable} += $self->{file}->{ $row->[0] }->{percent_space_reclaimable}; } diff --git a/centreon-plugins/database/oracle/mode/longqueries.pm b/centreon-plugins/database/oracle/mode/longqueries.pm index 83a5703ab..47e4b8078 100644 --- a/centreon-plugins/database/oracle/mode/longqueries.pm +++ b/centreon-plugins/database/oracle/mode/longqueries.pm @@ -81,8 +81,10 @@ sub new { "timezone:s" => { name => 'timezone' }, }); - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'DateTime', - error_msg => "Cannot load module 'DateTime'."); + centreon::plugins::misc::mymodule_load( + output => $self->{output}, module => 'DateTime', + error_msg => "Cannot load module 'DateTime'." + ); $self->{statefile_cache} = centreon::plugins::statefile->new(%options); return $self; } @@ -143,7 +145,7 @@ sub manage_selection { hour => $values[2], minute => $values[1], second => $values[0], - time_zone => 'UTC', + time_zone => 'UTC' ); 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] : '-', username => defined($row[5]) ? $row[5] : '-', since => $since, - generation_time => centreon::plugins::misc::change_seconds(value => $since) }; + generation_time => centreon::plugins::misc::change_seconds(value => $since) + }; $i++; }