From 2878d98578f1a990a42dfa8fbd9ae0789f491365 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 9 Nov 2022 11:37:39 +0100 Subject: [PATCH] snmp standard interfaces - some equipments can have the value 0 for adminStatus and operStats (#4048) --- centreon-plugins/snmp_standard/mode/interfaces.pm | 6 +++--- centreon-plugins/snmp_standard/mode/listinterfaces.pm | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/interfaces.pm b/centreon-plugins/snmp_standard/mode/interfaces.pm index 599eb8ba4..aa52933a2 100644 --- a/centreon-plugins/snmp_standard/mode/interfaces.pm +++ b/centreon-plugins/snmp_standard/mode/interfaces.pm @@ -719,15 +719,15 @@ sub set_oids_status { $self->{oid_adminstatus} = '.1.3.6.1.2.1.2.2.1.7'; $self->{oid_adminstatus_mapping} = { - 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown', + 0 => 'noStatus', 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown' }; $self->{oid_opstatus} = '.1.3.6.1.2.1.2.2.1.8'; $self->{oid_opstatus_mapping} = { - 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown', + 0 => 'noStatus', 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown' }; $self->{oid_duplexstatus} = '.1.3.6.1.2.1.10.7.2.1.19'; $self->{oid_duplexstatus_mapping} = { - 1 => 'unknown', 2 => 'halfDuplex', 3 => 'fullDuplex', + 1 => 'unknown', 2 => 'halfDuplex', 3 => 'fullDuplex' }; } diff --git a/centreon-plugins/snmp_standard/mode/listinterfaces.pm b/centreon-plugins/snmp_standard/mode/listinterfaces.pm index c682a6c5d..0816d056b 100644 --- a/centreon-plugins/snmp_standard/mode/listinterfaces.pm +++ b/centreon-plugins/snmp_standard/mode/listinterfaces.pm @@ -34,11 +34,11 @@ sub set_oids_status { $self->{oid_adminstatus} = '.1.3.6.1.2.1.2.2.1.7'; $self->{oid_adminstatus_mapping} = { - 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown' + 0 => 'noStatus', 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown' }; $self->{oid_opstatus} = '.1.3.6.1.2.1.2.2.1.8'; $self->{oid_opstatus_mapping} = { - 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown' + 0 => 'noStatus', 1 => 'up', 2 => 'down', 3 => 'testing', 4 => 'unknown', 5 => 'dormant', 6 => 'notPresent', 7 => 'lowerLayerDown' }; $self->{oid_mac_address} = '.1.3.6.1.2.1.2.2.1.6'; $self->{oid_iftype} = '.1.3.6.1.2.1.2.2.1.3';