All work

Select view

Select search mode

 

capsd does not handle empty ifSpeed

Fixed

Description

When capsd runs on a specific device type, I get this in the logs:

2008-05-01 12:50:03,578 DEBUG [Capsd Rescan Pool-fiber0] RescanProcessor: updateNonIpInterface: node= 151 ifIndex= 3
2008-05-01 12:50:03,578 DEBUG [Capsd Rescan Pool-fiber0] RescanProcessor: updateNonIpInterface: updating non-IP snmp interface with nodeId=1
51 and ifIndex=3
2008-05-01 12:50:03,580 DEBUG [Capsd Rescan Pool-fiber0] RescanProcessor: updateNonIpInterface: non-IP SNMP interface with ifIndex 3 not in
database, creating new snmpInterface object.
2008-05-01 12:50:03,581 DEBUG [Capsd Rescan Pool-fiber0] RescanProcessor: updateNonIpInterface: found match for ifIndex: 3
2008-05-01 12:50:03,581 DEBUG [Capsd Rescan Pool-fiber0] RescanProcessor: updateNonIpInterface: ifIndex: 3 has ifDescription: SLIP-UART
2008-05-01 12:50:03,581 DEBUG [Capsd Rescan Pool-fiber0] RescanProcessor: updateNonIpInterface: ifIndex: 3 has physical address: –
2008-05-01 12:50:03,581 ERROR [Capsd Rescan Pool-fiber0] RescanProcessor: Error updating records for node ID 151: java.lang.NumberFormatExce
ption: empty String
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
at java.lang.Float.valueOf(Float.java:360)
at org.opennms.netmgt.snmp.snmp4j.Snmp4JValue.convertStringToLong(Snmp4JValue.java:206)
at org.opennms.netmgt.snmp.snmp4j.Snmp4JValue.toLong(Snmp4JValue.java:199)
at org.opennms.netmgt.snmp.AbstractSnmpStore.getUInt32(AbstractSnmpStore.java:59)
at org.opennms.netmgt.capsd.snmp.IfTableEntry.getIfSpeed(IfTableEntry.java:219)
at org.opennms.netmgt.capsd.RescanProcessor.updateSnmpInfoForNonIpInterface(RescanProcessor.java:752)
at org.opennms.netmgt.capsd.RescanProcessor.updateNonIpInterface(RescanProcessor.java:608)
at org.opennms.netmgt.capsd.RescanProcessor.updateInterfaces(RescanProcessor.java:519)
at org.opennms.netmgt.capsd.RescanProcessor.run(RescanProcessor.java:3277)
at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:422)
at java.lang.Thread.run(Thread.java:595)

Seems to be trigger due to this:
IF-MIB::ifSpeed.3 = Wrong Type (should be Gauge32 or Unsigned32): ""

Environment

Operating System: Linux Platform: All

Acceptance / Success Criteria

None

Lucidchart Diagrams

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created May 1, 2008 at 9:33 AM
Updated February 3, 2011 at 2:44 PM
Resolved May 12, 2008 at 5:54 PM

Activity

Show:

Benjamin ReedMay 12, 2008 at 5:54 PM

merged to branches/1.6 in r9136

DJ GregorMay 4, 2008 at 2:40 AM

Change was committed to trunk a day or two ago, and now there is a unit test in RescanProcessorTest for this bug in revision 9054 of trunk.

DJ GregorMay 1, 2008 at 9:59 AM

Here's a quick take at a patch... replace the line "Long unit = ifte.getIfSpeed();" in RescanProcessor.java with this:

Long uint;
try {
uint = ifte.getIfSpeed();
} catch (Exception e) {
log.warn("updateNonIpInterface: ifSpeed '" + ifte.getDisplayString(IfTableEntry.IF_SPEED) + "' for ifIndex " + ifIndex + " is invalid, inserting 0: " + e, e);
uint = null;
}