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

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

Open liferadioat opened this issue 2 years ago • 6 comments

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,

liferadioat avatar Dec 29 '23 13:12 liferadioat

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

Sims24 avatar Dec 29 '23 15:12 Sims24

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?

liferadioat avatar Jan 03 '24 11:01 liferadioat

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

Sims24 avatar Jan 05 '24 11:01 Sims24

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

liferadioat avatar Jan 05 '24 11:01 liferadioat

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.

omercier avatar Feb 19 '24 11:02 omercier

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?

lucie-tirand avatar Jul 02 '24 14:07 lucie-tirand