mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 08:04:36 +02:00
(core) add debug snmp (#3541)
This commit is contained in:
parent
492a2b393c
commit
802781b019
@ -372,6 +372,8 @@ sub get_leef {
|
||||
$self->{output}->option_exit(exit_litteral => $self->{snmp_errors_exit});
|
||||
}
|
||||
|
||||
$self->debug(results => $results) if ($self->{output}->is_debug());
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
@ -548,6 +550,8 @@ sub get_multiple_table {
|
||||
}
|
||||
}
|
||||
|
||||
$self->debug(results => $results) if ($self->{output}->is_debug());
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
@ -662,6 +666,8 @@ sub get_table {
|
||||
$self->{output}->option_exit(exit_litteral => $self->{snmp_errors_exit});
|
||||
}
|
||||
|
||||
$self->debug(results => $results) if ($self->{output}->is_debug());
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
@ -924,6 +930,20 @@ sub map_instance {
|
||||
return $results;
|
||||
}
|
||||
|
||||
sub debug {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
foreach my $oid1 ($self->oid_lex_sort(keys %{$options{results}})) {
|
||||
if (ref($options{results}->{$oid1}) eq 'HASH') {
|
||||
foreach my $oid2 ($self->oid_lex_sort(keys %{$options{results}->{$oid1}})) {
|
||||
$self->{output}->output_add(long_msg => $oid2 . ' = ' . (defined($options{results}->{$oid1}->{$oid2}) ? $options{results}->{$oid1}->{$oid2} : 'undef'), debug => 1);
|
||||
}
|
||||
} else {
|
||||
$self->{output}->output_add(long_msg => $oid1 . ' = ' . (defined($options{results}->{$oid1}) ? $options{results}->{$oid1} : 'undef'), debug => 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub oid_lex_sort {
|
||||
my $self = shift;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user