fix cant get single value ntp snmp standard mode

This commit is contained in:
garnier-quentin 2019-03-12 12:10:25 +01:00
parent 23fa01375b
commit 059eb8b173
1 changed files with 1 additions and 7 deletions

View File

@ -68,13 +68,7 @@ sub run {
my ($ref_time, $distant_time);
my $oid_hrSystemDate = '.1.3.6.1.2.1.25.1.2.0';
my $result = $self->{snmp}->get_leef(oids => [ $oid_hrSystemDate ]);
if (scalar(keys %$result) == 0) {
$self->{output}->output_add(severity => 'UNKNOWN',
short_msg => "Cannot get 'hrSystemDate' information.");
$self->{output}->display();
$self->{output}->exit();
}
my $result = $self->{snmp}->get_leef(oids => [ $oid_hrSystemDate ], nothing_quit => 1);
if (defined($self->{option_results}->{ntp_hostname}) && $self->{option_results}->{ntp_hostname} ne '') {
my %ntp;