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
311 stars 274 forks source link

SNMP Generic App Protocol doesn´t find any value - custom mib #4798

Open liferadioat opened 11 months ago

liferadioat commented 11 months ago

Hi,

I am using the centreon plugins (github latest) to check a device with a custom MIB at ubuntu server with

sudo -u nagios perl centreon_plugins.pl --plugin=apps::protocols::snmp::plugin --mode=string-value --hostname=10.158.129.xx --oid='.1.3.6.1.4.1.2604.5.1.1.1' --snmp-community=icinga The result: UNKNOWN: SNMP GET Request: Cant get a single value.

When I use the same OID on the same machine with snmpwalk I get a valid result: sudo -u nagios snmpwalk -v2c -c icinga 10.158.129.xx .1.3.6.1.4.1.2604.5.1.1.1 Result: iso.3.6.1.4.1.2604.5.1.1.1.0 = STRING: "LRFW01.xy.at"

What could be the issue here? Is there any option I am missing at centreon? The mib seems recognized by snmpwalk, but not for centreon. The mib is saved at /usr/share/snmp/mibs & /home/nagios/.snmp

Best,

Sims24 commented 11 months ago

Try adding .0 at the end of your --oid= option

liferadioat commented 10 months ago

Thanks, I tried, but it is not working partially. It seems related to some other result types like gauge32:

sudo -u nagios snmpwalk -v2c -c icinga 10.158.129.254 .1.3.6.1.4.1.2604.5.1.2.4

iso.3.6.1.4.1.2604.5.1.2.4.1.0 = Gauge32: 89055
iso.3.6.1.4.1.2604.5.1.2.4.2.0 = Gauge32: 18
sudo -u nagios perl centreon_plugins.pl --plugin=apps::protocols::snmp::plugin --mode=numeric-value --hostname=10.158.129.254 --oid='.3.6.1.4.1.2604.5.1.2.4.1.0' --snmp-community=icinga

snmp_build: unknown failure
UNKNOWN: SNMP GET Request: Error building ASN.1 representation (Can't build OID for variable)

Gauge seems to be the default value type at numeric mode, but what causes this error?

Sims24 commented 10 months ago

A leading .1 digit is missing at the beginning of the --oid option value

liferadioat commented 10 months ago

Thanks, is counter64 supported? perl centreon_plugins.pl --plugin=apps::protocols::snmp::plugin --mode=numeric-value --hostname=10.158.129.254 --oid-type='counter' --oid='.1.3.6.1.4.1.2604.5.1.2.7' --snmp-community=icinga --counter-per-seconds gives an error while snmpwalk results iso.3.6.1.4.1.2604.5.1.2.7.0 = Counter64: 676190

omercier commented 9 months ago

Hi @liferadioat,

Do you agree that your first two errors are solved? Regarding the Counter64 OID I get an error as well with your data loaded by snmpsim.

With a Counter

.1.3.6.1.4.1.2604.5.1.2.7.0 = Counter64: 676190
perl centreon_plugins.pl --plugin=apps::protocols::snmp::plugin --mode=numeric-value --snmp-port 2024 --snmp-community=issue_4798_3  --hostname 127.0.0.1   --oid='.1.3.6.1.4.1.2604.5.1.2.7.0' --debug
OK: current value is 676190 | 'value'=676190;;;;
.1.3.6.1.4.1.2604.5.1.2.7.0 = 676190

With an integer

.1.3.6.1.4.1.2604.5.1.2.7.0 = INTEGER: 676190
perl centreon_plugins.pl --plugin=apps::protocols::snmp::plugin --mode=numeric-value --snmp-port 2024 --snmp-community=issue_4798_3  --hostname 127.0.0.1   --oid='.1.3.6.1.4.1.2604.5.1.2.7.0' --debug  --oid-type='counter' --statefile-dir=/dev/shm --counter-per-seconds
UNKNOWN: SNMP GET Request: Cant get a single value. 

We'll dig a little more on this.

lucie-dubrunfaut commented 4 months ago

Hello :)

Without additional information we are not able to provide a solution or resolve a possible bug. So @liferadioat if you still need a response / solution to this issue, can you take a look at the recap provide by @omercier above and help us understanding your issue?