Nagios::Plugin::JUNOS: Overwrite nagios_exit and call $junos->disconnect().

(Then call SUPER::nagios_exit.)
This commit is contained in:
Sebastian Harl 2012-01-03 10:16:31 +01:00
parent 09bbfe7c82
commit 75c3337376
2 changed files with 10 additions and 2 deletions

View file

@ -144,8 +144,6 @@ $plugin->run_checks();
my ($code, $msg) = $plugin->check_messages(join => ', ');
$junos->disconnect();
$plugin->nagios_exit($code, $msg);
sub check_interface

View file

@ -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;