Fix oracle disconnect

This commit is contained in:
garnier-quentin 2019-05-21 08:36:08 +02:00
parent a7cf9e966f
commit 013da46f75
2 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,10 @@ sub set_version {
sub disconnect {
my ($self) = @_;
$self->{instance}->disconnect if (defined($self->{instance}));
if (defined($self->{instance})) {
$self->{statement_handle} = undef;
$self->{instance}->disconnect();
}
}
sub connect {

View File

@ -63,6 +63,7 @@ sub run {
my $session = $self->{sql}->fetchrow_array();
$self->{sql}->disconnect();
$session =~ s/,/./g;
my $exit_code = $self->{perfdata}->threshold_check(value => $session, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
$self->{output}->output_add(severity => $exit_code,
short_msg => sprintf("%.2f%% of session resources used.", $session));