[apps::protocols::snmp::plugin] default snmp error status is OK in snmp multi mode
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.
Can you please have a look at this ?
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 🙏
Hello @lucie-dubrunfaut,
The issue is only with the numeric-value mode.
Snmpwalk logs are irrelevant. It is reproductible with any snmp device.
Hello :)
I noticed all this and create a ticket in our backlog. We will keep you informed when we will start this ticket.