Nagios::Plugin::JUNOS: Overwrite nagios_exit and call $junos->disconnect().
(Then call SUPER::nagios_exit.)
This commit is contained in:
parent
09bbfe7c82
commit
75c3337376
|
@ -144,8 +144,6 @@ $plugin->run_checks();
|
|||
|
||||
my ($code, $msg) = $plugin->check_messages(join => ', ');
|
||||
|
||||
$junos->disconnect();
|
||||
|
||||
$plugin->nagios_exit($code, $msg);
|
||||
|
||||
sub check_interface
|
||||
|
|
|
@ -438,6 +438,16 @@ sub get_query_object_value
|
|||
return $res->getFirstChild->getNodeValue;
|
||||
}
|
||||
|
||||
sub nagios_exit
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
if ($self->{'junos'}) {
|
||||
$self->{'junos'}->disconnect();
|
||||
}
|
||||
$self->SUPER::nagios_exit(@_);
|
||||
}
|
||||
|
||||
sub verbose
|
||||
{
|
||||
my $self = shift;
|
||||
|
|
Loading…
Reference in a new issue