From ae130a3f5a026fed75f52f57c8ddb17e365b2bdd Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 9 Jul 2019 10:26:15 +0200 Subject: [PATCH] enhance dbi connect for multi meta mode --- centreon/plugins/dbi.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/centreon/plugins/dbi.pm b/centreon/plugins/dbi.pm index 3e766f96c..ac10b3c8c 100644 --- a/centreon/plugins/dbi.pm +++ b/centreon/plugins/dbi.pm @@ -204,6 +204,7 @@ sub disconnect { if (defined($self->{instance})) { $self->{statement_handle} = undef; $self->{instance}->disconnect(); + $self->{instance} = undef; } } @@ -211,6 +212,8 @@ sub connect { my ($self, %options) = @_; my $dontquit = (defined($options{dontquit}) && $options{dontquit} == 1) ? 1 : 0; + return if (defined($self->{instance})); + # Set ENV if (defined($self->{env})) { foreach (keys %{$self->{env}}) {