centreon-plugins icon indicating copy to clipboard operation
centreon-plugins copied to clipboard

[apps::protocols::snmp::plugin] default snmp error status is OK in snmp multi mode

Open Luth1ng opened this issue 1 year ago • 4 comments

Bug report

Quick description

When using a simple snmp numeric-value mode, I get an "UNKNOWN" status with a SNMP error. When using this same numeric-value inside a multi mode, I get an "OK" status with the same output...

How to reproduce

  • Environment:
Linux centreon.local 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 7.9.2009 (Core)
  • Version of the plugin:
grep 'clone: from ' /tmp/centreon-plugins/.git/logs/HEAD | cut -d'>' -f2- | awk '{print $1}' | date -u
Thu Feb 15 07:37:42 UTC 2024
  • Information about the monitored resource: Unrelated
  • Command line: See results below

Expected result

/tmp/centreon-plugins/src/centreon_plugins.pl \
--plugin=apps::protocols::snmp::plugin  \
--mode=multi  \
--hostname=myhost \
--snmp-community='mycommunity' \
--snmp-version=2c  \
--modes-exec=numeric-value \
--option-mode=numeric-value,--config-json='[ {"oid": "1.3.6.1.4.1.1234.1.2.3.4"} ]'

UNKNOWN: SNMP GET Request: Cant get a single value.

Actual result

/tmp/centreon-plugins/src/centreon_plugins.pl \
--plugin=apps::protocols::snmp::plugin  \
--mode=multi  \
--hostname=myhost \
--snmp-community='mycommunity' \
--snmp-version=2c  \
--modes-exec=numeric-value \
--option-mode=numeric-value,--config-json='[ {"oid": "1.3.6.1.4.1.1234.1.2.3.4"} ]'

OK: SNMP GET Request: Cant get a single value.

Luth1ng avatar Feb 15 '24 07:02 Luth1ng

Can you please have a look at this ?

Luth1ng avatar Jun 18 '24 10:06 Luth1ng

Hello :)

Can you tell us if you encounter this issue only with this mode numeric-value or also with other? Can you also tell us if you encounter this issue with other OID? Also, can you provide us an anonymized .snmpwalk (full snmpwalk of enterprise branch : snmpwalk -ObentU -v 2c -c public address .1.3.6.1.4.1 > equipment.snmpwalk) of your equipment to help us troubleshooting this issue ?

Thanks for your patience 🙏

lucie-tirand avatar Jun 18 '24 12:06 lucie-tirand

Hello @lucie-dubrunfaut,

The issue is only with the numeric-value mode. Snmpwalk logs are irrelevant. It is reproductible with any snmp device.

Luth1ng avatar Jun 19 '24 07:06 Luth1ng

Hello :)

I noticed all this and create a ticket in our backlog. We will keep you informed when we will start this ticket.

lucie-tirand avatar Jun 19 '24 08:06 lucie-tirand