/** * Send a newSuspect event for the interface construct event with 'linkd' as source * * @param ipInterface The interface for which the newSuspect event is to be generated * @param ipowner The host that hold this ipInterface information * @pkgName The package Name of the ready runnable involved */ void sendNewSuspectEvent(InetAddress ipaddress, InetAddress ipowner, String pkgName) { if (m_newSuspectEventsIpAddr.contains(ipaddress)) { LogUtils.infof( this, "sendNewSuspectEvent: nothing to send, suspect event previously sent for IP address: %s", str(ipaddress)); return; } else if (!isInterfaceInPackageRange(ipaddress, pkgName)) { LogUtils.infof( this, "sendNewSuspectEvent: nothing to send for IP address: %s, not in package: %s", str(ipaddress), pkgName); return; } org.opennms.netmgt.config.linkd.Package pkg = m_linkdConfig.getPackage(pkgName); boolean autodiscovery = false; if (pkg.hasAutoDiscovery()) autodiscovery = pkg.getAutoDiscovery(); else autodiscovery = m_linkdConfig.isAutoDiscoveryEnabled(); if (autodiscovery) { EventBuilder bldr = new EventBuilder(EventConstants.NEW_SUSPECT_INTERFACE_EVENT_UEI, "linkd"); bldr.setHost(str(ipowner)); bldr.setInterface(ipaddress); m_eventForwarder.sendNow(bldr.getEvent()); m_newSuspectEventsIpAddr.add(ipaddress); } }