Fix oracle disconnect
This commit is contained in:
parent
a7cf9e966f
commit
013da46f75
|
@ -201,7 +201,10 @@ sub set_version {
|
||||||
sub disconnect {
|
sub disconnect {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
$self->{instance}->disconnect if (defined($self->{instance}));
|
if (defined($self->{instance})) {
|
||||||
|
$self->{statement_handle} = undef;
|
||||||
|
$self->{instance}->disconnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub connect {
|
sub connect {
|
||||||
|
|
|
@ -63,6 +63,7 @@ sub run {
|
||||||
my $session = $self->{sql}->fetchrow_array();
|
my $session = $self->{sql}->fetchrow_array();
|
||||||
$self->{sql}->disconnect();
|
$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' } ]);
|
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,
|
$self->{output}->output_add(severity => $exit_code,
|
||||||
short_msg => sprintf("%.2f%% of session resources used.", $session));
|
short_msg => sprintf("%.2f%% of session resources used.", $session));
|
||||||
|
|
Loading…
Reference in New Issue