[SNMP4J] Identifying peer addresses in low-level SNMP4J error messages

Jeff Gehlbach jeffg at opennms.org
Thu Sep 8 16:50:17 CEST 2016


Hello all,

(Apologies if this is a duplicate; I think the list rejected my original
GPG-signed post but I could be wrong)

We use SNMP4J (currently version 2.4.3) in the default SNMP strategy in
our open-source management platform OpenNMS:

https://github.com/OpenNMS/opennms/blob/develop/core/snmp/impl-snmp4j/src/main/java/org/opennms/netmgt/snmp/snmp4j/Snmp4JStrategy.java

One problem we encounter from time to time is messages in our logs that
indicate SNMP4J has received a problematic PDU from a peer, but it's
usually not clear which peer sent the problem PDU or any other
information about the PDU. For example, on stdout:

java.io.IOException: Wrong ASN.1 type. Not an integer: 8 at position 3
        at org.snmp4j.asn1.BER.decodeInteger(BER.java:638)
        at org.snmp4j.smi.Integer32.decodeBER(Integer32.java:60)
        at
org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:373)
        at
org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:345)
        at
org.snmp4j.transport.AbstractTransportMapping.fireProcessMessage(AbstractTransportMapping.java:76)
        at
org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.run(DefaultUdpTransportMapping.java:423)
        at java.lang.Thread.run(Thread.java:745)

In small-scale scenarios we can usually track down the offending peer
through clever troubleshooting, but especially at larger sites this can
be almost impossible for technical, change control, or infosec reasons.
Does anybody have tips to share for easing this kind of troubleshooting?

Thanks,
-jeff



More information about the SNMP4J mailing list