/** * <p>setCollectionEnabled</p> * * @param collect a boolean. * @return a {@link org.opennms.netmgt.model.SnmpInterfaceBuilder} object. */ public SnmpInterfaceBuilder setCollectionEnabled(boolean collect) { m_snmpIf.setCollectionEnabled(collect); return this; }
/** * <p>setCollectionEnabled</p> * * @param shouldCollect a boolean. */ public void setCollectionEnabled(boolean shouldCollect) { setCollectionEnabled(shouldCollect, false); }
/** {@inheritDoc} */ @Override public OnmsSnmpInterface act(OnmsSnmpInterface iface) { switch (m_action) { case DO_NOT_PERSIST: LOG.debug("NOT Persisting {} according to policy", iface); return null; case DISABLE_COLLECTION: iface.setCollectionEnabled(false); LOG.debug("Disabled collection for {} according to policy", iface); return iface; case ENABLE_COLLECTION: iface.setCollectionEnabled(true); LOG.debug("Enabled collection for {} according to policy", iface); return iface; case ENABLE_POLLING: iface.setPoll("P"); LOG.debug("Enabled polling for {} according to policy", iface); return iface; case DISABLE_POLLING: iface.setPoll("N"); LOG.debug("Disabled polling for {} according to policy", iface); return iface; default: return iface; } }
case DISABLE_COLLECTION: LOG.debug("Disabled collection for {} according to policy", iface); snmpiface.setCollectionEnabled(false); iface.setSnmpInterface(snmpiface); return iface; case ENABLE_COLLECTION: LOG.debug("Enabled collection for {} according to policy", iface); snmpiface.setCollectionEnabled(true); iface.setSnmpInterface(snmpiface); return iface;
public OnmsIpInterface createInterfaceFromRow() { final Integer ifIndex = getIfIndex(); final String ipAddr = getIpAddress(); final Integer type = getType(); final InetAddress netMask = getNetMask(); LOG.debug("createInterfaceFromRow: ifIndex = {}, ipAddress = {}, type = {}, netmask = {}", ifIndex, ipAddr, type, netMask); if (type != IP_ADDRESS_TYPE_UNICAST || ipAddr == null) { return null; } final InetAddress inetAddress = InetAddressUtils.addr(ipAddr); final OnmsIpInterface iface = new OnmsIpInterface(inetAddress, null); iface.setNetMask(netMask); if (ifIndex != null) { final OnmsSnmpInterface snmpIface = new OnmsSnmpInterface(null, ifIndex); snmpIface.setCollectionEnabled(true); iface.setSnmpInterface(snmpIface); iface.setIfIndex(ifIndex); } String hostName = null; if (inetAddress != null) hostName = inetAddress.getHostName(); if (hostName == null) hostName = normalize(ipAddr); LOG.debug("setIpHostName: {}", hostName); iface.setIpHostName(hostName == null? ipAddr : hostName); return iface; }
public OnmsIpInterface createInterfaceFromRow() { final Integer ifIndex = getIfIndex(); final String ipAddr = getIpAddress(); final InetAddress netMask = getNetMask(); LOG.debug("createInterfaceFromRow: ifIndex = {}, ipAddress = {}, netmask = {}", ifIndex, ipAddr, netMask); if (ipAddr == null) { return null; } final InetAddress inetAddress = InetAddressUtils.addr(ipAddr); final OnmsIpInterface iface = new OnmsIpInterface(inetAddress, null); iface.setNetMask(netMask); if (ifIndex != null) { final OnmsSnmpInterface snmpIface = new OnmsSnmpInterface(null, ifIndex); snmpIface.setCollectionEnabled(true); iface.setSnmpInterface(snmpIface); iface.setIfIndex(ifIndex); } String hostName = null; if (inetAddress != null) hostName = inetAddress.getHostName(); if (hostName == null) hostName = InetAddressUtils.normalize(ipAddr); iface.setIpHostName(hostName == null? ipAddr : hostName); return iface; }
public OnmsIpInterface createInterfaceFromRow() { final Integer ifIndex = getIfIndex(); final String ipAddr = getIpAddress(); final InetAddress netMask = getNetMask(); LOG.debug("createInterfaceFromRow: ifIndex = {}, ipAddress = {}, netmask = {}", ifIndex, ipAddr, netMask); if (ipAddr == null) { return null; } final InetAddress inetAddress = InetAddressUtils.addr(ipAddr); final OnmsIpInterface iface = new OnmsIpInterface(inetAddress, null); iface.setNetMask(netMask); if (ifIndex != null) { final OnmsSnmpInterface snmpIface = new OnmsSnmpInterface(null, ifIndex); snmpIface.setCollectionEnabled(true); iface.setSnmpInterface(snmpIface); iface.setIfIndex(ifIndex); } String hostName = null; if (inetAddress != null) hostName = inetAddress.getHostName(); if (hostName == null) hostName = InetAddressUtils.normalize(ipAddr); iface.setIpHostName(hostName == null? ipAddr : hostName); return iface; }
public OnmsIpInterface createInterfaceFromRow() { final Integer ifIndex = getIfIndex(); final String ipAddr = getIpAddress(); final Integer type = getType(); final InetAddress netMask = getNetMask(); LOG.debug("createInterfaceFromRow: ifIndex = {}, ipAddress = {}, type = {}, netmask = {}", ifIndex, ipAddr, type, netMask); if (type != IP_ADDRESS_TYPE_UNICAST || ipAddr == null) { return null; } final InetAddress inetAddress = InetAddressUtils.addr(ipAddr); final OnmsIpInterface iface = new OnmsIpInterface(inetAddress, null); iface.setNetMask(netMask); if (ifIndex != null) { final OnmsSnmpInterface snmpIface = new OnmsSnmpInterface(null, ifIndex); snmpIface.setCollectionEnabled(true); iface.setSnmpInterface(snmpIface); iface.setIfIndex(ifIndex); } String hostName = null; if (inetAddress != null) hostName = inetAddress.getHostName(); if (hostName == null) hostName = normalize(ipAddr); LOG.debug("setIpHostName: {}", hostName); iface.setIpHostName(hostName == null? ipAddr : hostName); return iface; }
private OnmsEntity createSnmpInterface(final int ifIndex, final int ifType, final String ifName, final boolean collectionEnabled) { final OnmsSnmpInterface m_snmpIface = new OnmsSnmpInterface(); m_snmpIface.setIfIndex(ifIndex); m_snmpIface.setIfType(ifType); m_snmpIface.setIfName(ifName); m_snmpIface.setCollectionEnabled(collectionEnabled); m_node.addSnmpInterface(m_snmpIface); return m_snmpIface; }
snmpIf.setCollectionEnabled(true);
snmpIf.setCollectionEnabled(true);
private static SnmpIfData createSnmpIfData(String ipAddress, String ifName, Long ifSpeed, Integer ifIndex, boolean collectionEnabled) { OnmsNode node = new OnmsNode(); node.setId(1); node.setLabel("testNode"); OnmsSnmpInterface snmpIface = new OnmsSnmpInterface(node, ifIndex); snmpIface.setIfDescr(ifName); snmpIface.setIfName(ifName); snmpIface.setIfAlias(ifName); snmpIface.setIfSpeed(ifSpeed); // If the SNMP interface doesn't have collection enable, threshold processing will be ignored for the interface snmpIface.setCollectionEnabled(collectionEnabled); return new SnmpIfData(snmpIface); }
snmpIf.setCollectionEnabled(true);
null0.setPoll("P"); null0.setIfType(6); null0.setCollectionEnabled(false); null0.setIfOperStatus(2); null0.setIfDescr("Null0"); fa0.setPoll("P"); fa0.setIfType(6); fa0.setCollectionEnabled(false); fa0.setIfOperStatus(1); fa0.setIfDescr("FastEthernet0"); eth0.setPoll("P"); eth0.setIfType(6); eth0.setCollectionEnabled(false); eth0.setIfOperStatus(1); eth0.setIfDescr("Ethernet0"); eth1.setPoll("P"); eth1.setIfType(6); eth1.setCollectionEnabled(false); eth1.setIfOperStatus(1); eth1.setIfDescr("Ethernet1");
setCollectionEnabled(scannedSnmpIface.isCollectionEnabled(), scannedSnmpIface.isCollectionUserSpecified());