/** * This method is used to convert the event host into a hostname id by * performing a lookup in the database. If the conversion is successful then * the corresponding hostname will be returned to the caller. * * @param nodeId Node ID * @param hostip The event host * * @return The hostname */ @Override public String getHostName(final int nodeId, final String hostip) { OnmsIpInterface ints = ipInterfaceDao.findByNodeIdAndIpAddress(nodeId, hostip); if (ints == null) { return hostip; } else { final String hostname = ints.getIpHostName(); return (hostname == null) ? hostip : hostname; } }
/** * This method is used to convert the event host into a hostname id by * performing a lookup in the database. If the conversion is successful then * the corresponding hostname will be returned to the caller. * * @param nodeId Node ID * @param hostip The event host * * @return The hostname */ @Override public String getHostName(final int nodeId, final String hostip) { OnmsIpInterface ints = ipInterfaceDao.findByNodeIdAndIpAddress(nodeId, hostip); if (ints == null) { return hostip; } else { final String hostname = ints.getIpHostName(); return (hostname == null) ? hostip : hostname; } }
primaryInterface = ipInterface.getIpHostName();
primaryInterface = ipInterface.getIpHostName();
private void update(OnmsIpInterface imported, OnmsIpInterface iface, List<Event> events) { if (!nullSafeEquals(iface.getIsManaged(), imported.getIsManaged())) iface.setIsManaged(imported.getIsManaged()); if (!nullSafeEquals(iface.getIsSnmpPrimary(), imported.getIsSnmpPrimary())) { iface.setIsSnmpPrimary(imported.getIsSnmpPrimary()); // TODO: send snmpPrimary event } if (isSnmpDataForInterfacesUpToDate()) { updateSnmpInterface(imported, iface); } if (!nullSafeEquals(iface.getIpHostName(), imported.getIpHostName())) iface.setIpHostName(imported.getIpHostName()); updateServices(iface, imported, events); }
InetAddress inetAddr = iface.getIpAddress(); ipv4AddrList.add(inetAddr); String hostName = iface.getIpHostName(); InetAddress inetAddr = iface.getIpAddress(); ipv4AddrList.add(inetAddr); String hostName = iface.getIpHostName();
primaryInterface = ipInterface.getIpHostName();
primaryInterface = ipInterface.getIpHostName();
if (hasNewValue(scannedIface.getIpHostName(), getIpHostName())) { setIpHostName(scannedIface.getIpHostName());