From e6aedd1c6c472463753ffb00dbab76697830dd46 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 23 May 2019 15:10:34 +0200 Subject: [PATCH] add genError in snmp-autoreduce --- centreon-plugins/centreon/plugins/snmp.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/plugins/snmp.pm b/centreon-plugins/centreon/plugins/snmp.pm index 3b4dd6d82..ab4b352ca 100644 --- a/centreon-plugins/centreon/plugins/snmp.pm +++ b/centreon-plugins/centreon/plugins/snmp.pm @@ -313,7 +313,8 @@ sub get_leef { next; } - if ($self->{snmp_autoreduce} == 1 && ($self->{session}->{ErrorNum} == 1 || $self->{session}->{ErrorNum} == -24)) { + if ($self->{snmp_autoreduce} == 1 && + ($self->{session}->{ErrorNum} == 1 || $self->{session}->{ErrorNum} == 5 || $self->{session}->{ErrorNum} == -24)) { next if ($self->autoreduce_leef(current => $entry) == 0); } my $msg = 'SNMP GET Request : ' . $self->{session}->{ErrorStr}; @@ -462,7 +463,8 @@ sub get_multiple_table { next; } - if ($self->{snmp_autoreduce} == 1 && ($self->{session}->{ErrorNum} == 1 || $self->{session}->{ErrorNum} == -24)) { + if ($self->{snmp_autoreduce} == 1 && + ($self->{session}->{ErrorNum} == 1 || $self->{session}->{ErrorNum} == 5 || $self->{session}->{ErrorNum} == -24)) { next if ($self->autoreduce_multiple_table(repeat_count => \$repeat_count) == 0); } @@ -607,7 +609,8 @@ sub get_table { # We are at the end with snmpv1. We quit. last; } - if ($self->{snmp_autoreduce} == 1 && ($self->{session}->{ErrorNum} == 1 || $self->{session}->{ErrorNum} == -24)) { + if ($self->{snmp_autoreduce} == 1 && + ($self->{session}->{ErrorNum} == 1 || $self->{session}->{ErrorNum} == 5 || $self->{session}->{ErrorNum} == -24)) { next if ($self->autoreduce_table(repeat_count => \$repeat_count) == 0); }