@Override public OnmsSnmpInterface query() { final OnmsSnmpInterface dbSnmpIface = m_snmpInterfaceDao.findByNodeIdAndIfIndex(nodeId, snmpInterface.getIfIndex()); LOG.debug("nodeId = {}, ifIndex = {}, dbSnmpIface = {}", nodeId, snmpInterface.getIfIndex(), dbSnmpIface); return dbSnmpIface; }
@Override public OnmsSnmpInterface query() { final OnmsSnmpInterface dbSnmpIface = m_snmpInterfaceDao.findByNodeIdAndIfIndex(nodeId, snmpInterface.getIfIndex()); LOG.debug("nodeId = {}, ifIndex = {}, dbSnmpIface = {}", nodeId, snmpInterface.getIfIndex(), dbSnmpIface); return dbSnmpIface; }
/** * Return the ifLabel as a string for the given node and ifIndex. Intended for * use with non-ip interfaces. * * @return String * @param nodeId a int. * @param ifIndex a int. */ @Override public String getIfLabelfromSnmpIfIndex(final int nodeId, final int ifIndex) { OnmsSnmpInterface iface = m_snmpInterfaceDao.findByNodeIdAndIfIndex(nodeId, ifIndex); String name = iface.getIfName(); String descr = iface.getIfDescr(); String physAddr = iface.getPhysAddr(); if (name != null || descr != null) { return getIfLabel(name, descr, physAddr); } else { LOG.warn("Interface (nodeId/ifIndex={}/{}) has no ifName and no ifDescr...setting to label to '{}'.", nodeId, ifIndex, IfLabel.NO_IFLABEL); return IfLabel.NO_IFLABEL; } } }
/** {@inheritDoc} */ @Override public void update(OnmsSnmpInterface snmpinterface) { OnmsSnmpInterface dbSnmpInterface = getSnmpInterfaceDao().findByNodeIdAndIfIndex(snmpinterface.getNode().getId(), snmpinterface.getIfIndex()); if (dbSnmpInterface == null) { log().debug("updating SnmpInterface: no interface found on db for: " + snmpinterface.toString()); } else { dbSnmpInterface.setIfOperStatus(snmpinterface.getIfOperStatus()); dbSnmpInterface.setIfAdminStatus(snmpinterface.getIfAdminStatus()); dbSnmpInterface.setLastSnmpPoll(snmpinterface.getLastSnmpPoll()); log().debug("updating SnmpInterface: " + dbSnmpInterface.toString()); getSnmpInterfaceDao().update(dbSnmpInterface); } }