interfaceSnmpByIfIndex fails if SNMP interface has no physical address

Description

When trying to fetch interface metrics for an SNMP interface, resource retrieval from Newts fails if the interface has no physical address attached.

Steps to reproduce:
1) Import a node into OpenNMS and configure SNMP to collect interfaces.
2) Attempt to retrieve measurements for an interface which has no physical address: 

An error will be thrown in web.log:

I believe this is due to how potential resource keys are computed in InterfaceSnmpResourceType.getKeysFor(): https://github.com/OpenNMS/opennms/blob/opennms-26.1.0-1/opennms-dao/src/main/java/org/opennms/netmgt/dao/support/InterfaceSnmpResourceType.java#L180

The computed keys do not factor resources in newts without a mac address or trailing hyphen:

 

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Benjamin Reed July 22, 2020 at 7:38 PM

Merged to foundation-2019

Chandra Gorantla July 15, 2020 at 3:28 PM

 Can you rebase your branch to foundation-2019

 

Justin Wood July 15, 2020 at 3:04 PM

Re-targeted PR to foundation-2019

Chandra Gorantla July 15, 2020 at 2:49 PM

Chandra Gorantla July 15, 2020 at 2:49 PM
Edited

  Please re-target this to foundation-2019 branch 

Fixed

Details

Assignee

Reporter

HB Grooming Date

HB Backlog Status

Components

Sprint

Affects versions

Priority

PagerDuty

Created June 24, 2020 at 5:19 PM
Updated July 22, 2020 at 7:38 PM
Resolved July 22, 2020 at 7:38 PM