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:
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: