LLDP Failure for non ifIndex references

Description

It appears that the LLDP code does not have the abilities to resolve non-ifIndex interface references? Apologies if it does and this is a fringe case that needs to be handled.

Here is the exception from output.log

Exception in thread "Scheduler-Thread-3-of-5" java.lang.NumberFormatException: For input string: "Eth1/2"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.parseInt(Integer.java:527)
at org.opennms.netmgt.linkd.AbstractQueryManager.getLldpRemIfIndex(AbstractQueryManager.java:348)
at org.opennms.netmgt.linkd.AbstractQueryManager.processLldp(AbstractQueryManager.java:311)
at org.opennms.netmgt.linkd.HibernateEventWriter.storeSnmpCollection(HibernateEventWriter.java:219)
at org.opennms.netmgt.linkd.HibernateEventWriter$$FastClassByCGLIB$$3a4c15a2.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at org.opennms.netmgt.linkd.HibernateEventWriter$$EnhancerByCGLIB$$1e73f412.storeSnmpCollection(<generated>)
at org.opennms.netmgt.linkd.Linkd.updateNodeSnmpCollection(Linkd.java:758)
at org.opennms.netmgt.linkd.SnmpCollection.runCollection(SnmpCollection.java:681)
at org.opennms.netmgt.linkd.SnmpCollection.run(SnmpCollection.java:390)
at org.opennms.netmgt.linkd.scheduler.Scheduler$1.run(Scheduler.java:203)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.opennms.core.concurrent.LogPreservingThreadFactory$3.run(LogPreservingThreadFactory.java:107)
at java.lang.Thread.run(Thread.java:722)

Eth1/2 is for sure not an ifIndex reference.

Looking in AbstractQueryManager.java:

case LldpMibConstants.LLDP_PORTID_SUBTYPE_INTERFACENAME: ifindex=getFromSysnameIfName(lldpRemTableEntry.getLldpRemSysname(), lldpRemTableEntry.getLldpRemPortid());

We still attempt to get a Port ID for an interface name.

LldpRemTableEntry.java:

public Integer getLldpRemPortidSubtype() {
return getInt32(LLDP_REM_PORTID_SUBTYPE_ALIAS);
}

Which is where our exception is thrown.

Acceptance / Success Criteria

None

Attachments

2

Lucidchart Diagrams

Activity

Show:

Antonio Russo June 4, 2013 at 11:36 AM

11641aa..a11cbd0 master -> master

Antonio Russo June 4, 2013 at 11:36 AM

fixed in master and 1.12:

a69267e..d48f134 1.12 -> 1.12

Antonio Russo June 4, 2013 at 5:20 AM

I mean on the cisco access device....this means that the LLDP is supported and the LLDP mib not yet supported...

Antonio Russo June 4, 2013 at 5:18 AM

It is really strange that there is no mib support on the switch device....

Antonio Russo June 4, 2013 at 5:17 AM

Looking at the data I get the following...

LDP-MIB::lldpRemPortIdSubtype.2479332.613.63 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479437.618.64 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479437.619.65 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479527.622.67 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479527.623.66 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479680.32194.69 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479680.33116.68 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479724.34499.70 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479724.34960.71 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479799.39570.72 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479799.40492.73 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479834.41875.75 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2479834.42336.74 = INTEGER: local(7)
LLDP-MIB::lldpRemPortIdSubtype.2480612.610.76 = INTEGER: local(7)

and

LLDP-MIB::lldpRemPortId.2479332.613.63 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479437.618.64 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479437.619.65 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479527.622.67 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479527.623.66 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479680.32194.69 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479680.33116.68 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479724.34499.70 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479724.34960.71 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479799.39570.72 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479799.40492.73 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479834.41875.75 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2479834.42336.74 = STRING: "Eth1/2"
LLDP-MIB::lldpRemPortId.2480612.610.76 = STRING: "Eth1/2"

So I can fix this....considering that my guess was if local then it is the ifindex. I can catch the exception....

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created June 3, 2013 at 11:37 AM
Updated January 27, 2017 at 4:21 PM
Resolved June 4, 2013 at 11:36 AM