Collection fails on interface tables that skip indexes

Description

This exceptin was found in the collectd log:

java.lang.ArrayIndexOutOfBoundsException: 65
at
org.opennms.netmgt.collectd.SnmpIfCollector.getNextSnmpV2Pdu(SnmpIfCollector.java:493)
at
org.opennms.netmgt.collectd.SnmpIfCollector.snmpReceivedPdu(SnmpIfCollector.java:773)
at
org.opennms.protocols.snmp.SnmpSession$SessionHandler.processSnmpMessage(SnmpSession.java:247)
at org.opennms.protocols.snmp.SnmpPortal.handlePkt(SnmpPortal.java:587)
at org.opennms.protocols.snmp.SnmpPortal$Receiver.run(SnmpPortal.java:353)
at java.lang.Thread.run(Thread.java:534)

This happens do to incorrect handling of ifIndexed tables that skip index
values: i.e: 1, 2, 3, 4, 5... 60, 61, 62, 64, 65...

-David

Environment

Operating System: All Platform: All

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Chris J. February 25, 2005 at 5:10 PM

I found seveal ArrayIndexOutOfBounds errors in the collectd.log. But I'm not
100% sure which host the error is complaining about.
Since the next log entry says that collection for a host is complete, does that
mean that that host IP is the one that likely caused the error during the
collection?

2005-02-25 16:28:51,464 DEBUG [SnmpPortal--1] SNMPCollectorEntry: update: added
oid:value pair: .1.3.6.1.4.1.9.2.2.1.1.27.162 : 0
2005-02-25 16:28:51,497 WARN [SnmpPortal--1] SnmpIfCollector: snmpReceivedPdu:
Unexpected exception while processing SNMP response packet.
java.lang.ArrayIndexOutOfBoundsException
at org.opennms.netmgt.collectd.SnmpIfCollector.snmpReceivedPdu(SnmpIfCol
lector.java:758)
at org.opennms.protocols.snmp.SnmpSession$SessionHandler.processSnmpMess
age(SnmpSession.java:247)
at org.opennms.protocols.snmp.SnmpPortal.handlePkt(SnmpPortal.java:587)
at org.opennms.protocols.snmp.SnmpPortal$Receiver.run(SnmpPortal.java:35
3)
at java.lang.Thread.run(Thread.java:536)
2005-02-25 16:28:51,497 DEBUG [CollectdScheduler-100 Pool-fiber29] SnmpCollector
: collect: interface SNMP query for address 192.168.2.242 complete.

Former user February 25, 2005 at 4:45 PM

This was due to GETBULK requests not properly selection the next variable to
query in a multi query table walk. This happened on devices with more than say
70 interfaces (but maybe as low as 55) that don't walk their tables contiguously.

The code was checked into the OPENNMS_1_2 branch and will be part of 1.2.1

Matt

David Hustace February 25, 2005 at 4:27 PM

Say that the the agent reports ifNumber.0 as 100, in this case, and when we ask
for 100 in the first getbulk request and get back values 1 - 64 we actually only
get 63 values due to there not being on OID of 63. Our next getbulk request
would be to start at 63 with max reps set to 37. This would give us 64 again
along with the rest of the table and there by be 1 too many replies. Our code
then fails on an array out of bounds error we processing the replies.

-David

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created February 25, 2005 at 4:18 PM
Updated November 5, 2010 at 2:03 PM
Resolved September 9, 2010 at 1:31 PM