centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
308 stars 270 forks source link

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

Open Luth1ng opened 4 months ago

Luth1ng commented 4 months ago

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

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 commented 2 weeks ago

Can you please have a look at this ?

lucie-dubrunfaut commented 2 weeks ago

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 🙏

Luth1ng commented 2 weeks ago

Hello @lucie-dubrunfaut,

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

lucie-dubrunfaut commented 2 weeks ago

Hello :)

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