@Override public Set<OnmsAttribute> load() { Set<OnmsAttribute> attributes = m_resourceStorageDao.getAttributes(m_path); if (m_snmpInterface != null) { attributes.add(new ExternalValueAttribute("nodeId", m_snmpInterface.getNodeId().toString())); attributes.add(new ExternalValueAttribute("ifIndex", m_snmpInterface.getIfIndex().toString())); if (m_snmpInterface.getIfSpeed() != null) { String ifSpeedFriendly = SIUtils.getHumanReadableIfSpeed(m_snmpInterface.getIfSpeed()); attributes.add(new ExternalValueAttribute("ifSpeed", m_snmpInterface.getIfSpeed().toString())); attributes.add(new ExternalValueAttribute("ifSpeedFriendly", ifSpeedFriendly)); } } return attributes; } }
public static SnmpInterfaceTopologyEntity create(OnmsSnmpInterface snmpInterface) { return new SnmpInterfaceTopologyEntity( snmpInterface.getId(), snmpInterface.getIfIndex(), snmpInterface.getIfName(), snmpInterface.getIfSpeed(), Optional.ofNullable(snmpInterface.getNode()).map(OnmsNode::getId).orElse(null) ); }
/** * <p>toString</p> * * @return a {@link java.lang.String} object. */ @Override public String toString() { return MoreObjects.toStringHelper(this) .add("snmpphysaddr", getPhysAddr()) .add("snmpifindex", getIfIndex()) .add("snmpifdescr", getIfDescr()) .add("snmpiftype", getIfType()) .add("snmpifname", getIfName()) .add("snmpifspeed", getIfSpeed()) .add("snmpifadminstatus", getIfAdminStatus()) .add("snmpifoperstatus", getIfOperStatus()) .add("snmpifalias", getIfAlias()) .add("snmpCollect", getCollect()) .add("snmpPoll", getPoll()) .add("nodeId", getNode() == null ? null : getNode().getId()) .add("lastCapsdPoll", getLastCapsdPoll()) .add("lastSnmpPoll", getLastSnmpPoll()) .add("hasFlows", getHasFlows()) .toString(); }
/** * <p>Constructor for SnmpIfData.</p> * * @param snmpIface a {@link org.opennms.netmgt.model.OnmsSnmpInterface} object. */ public SnmpIfData(OnmsSnmpInterface snmpIface) { m_nodeId = nullSafeUnbox(snmpIface.getNode().getId(), -1); m_collectionEnabled = snmpIface.isCollectionEnabled(); m_ifIndex = nullSafeUnbox(snmpIface.getIfIndex(), -1); m_ifType = nullSafeUnbox(snmpIface.getIfType(), -1); m_rrdLabel = snmpIface.computeLabelForRRD(); m_ifAlias = snmpIface.getIfAlias(); m_attributes.put("snmpphysaddr", snmpIface.getPhysAddr()); m_attributes.put("snmpifindex", Integer.toString(m_ifIndex)); m_attributes.put("snmpifdescr", snmpIface.getIfDescr()); m_attributes.put("snmpiftype", Integer.toString(m_ifType)); m_attributes.put("snmpifname", snmpIface.getIfName()); m_attributes.put("snmpifadminstatus", Integer.toString(nullSafeUnbox(snmpIface.getIfAdminStatus(), -1))); m_attributes.put("snmpifoperstatus", Integer.toString(nullSafeUnbox(snmpIface.getIfOperStatus(), -1))); m_attributes.put("snmpifspeed", Long.toString(nullSafeUnbox(snmpIface.getIfSpeed(), -1))); m_attributes.put("snmpifalias", m_ifAlias); }
info.put("snmpiftype", String.valueOf(iface.getIfType())); info.put("snmpifname", String.valueOf(iface.getIfName())); info.put("snmpifspeed", String.valueOf(iface.getIfSpeed())); info.put("snmpifadminstatus", String.valueOf(iface.getIfAdminStatus())); info.put("snmpifoperstatus", String.valueOf(iface.getIfOperStatus()));
if ((snmpInterface.getIfSpeed() != null) && (snmpInterface.getIfSpeed() != 0)) { ifSpeed = snmpInterface.getIfSpeed(); ifSpeedFriendly = SIUtils.getHumanReadableIfSpeed(ifSpeed); if (parenString.length() > 0) {
builder.setIfName(snmpInterface.getIfName()); if (snmpInterface.getIfSpeed() != null) { builder.setIfSpeed(snmpInterface.getIfSpeed());
if (!nullSafeEquals(snmpIface.getIfSpeed(), importedSnmpIface.getIfSpeed())) { snmpIface.setIfSpeed(importedSnmpIface.getIfSpeed());
builder.setIfName(snmpInterface.getIfName()); if (snmpInterface.getIfSpeed() != null) { builder.setIfSpeed(snmpInterface.getIfSpeed());
if (hasNewValue(scannedSnmpIface.getIfSpeed(), getIfSpeed())) { setIfSpeed(scannedSnmpIface.getIfSpeed());