public String getDisplayString(String key) { SnmpValue val = getValue(key); return (val == null ? null : val.toDisplayString()); }
private String getIfDescr() { final SnmpValue value = getValue(IF_DESCR); return value == null ? null : value.toDisplayString(); }
private String getIfDescr() { final SnmpValue value = getValue(IF_DESCR); return value == null ? null : value.toDisplayString(); }
private String getIfName() { final SnmpValue value = getValue(IF_NAME); return value == null ? null : value.toDisplayString(); }
private String getIfAlias() { final SnmpValue value = getValue(IF_ALIAS); return value == null ? null : value.toDisplayString(); }
private String getIfAlias() { final SnmpValue value = getValue(IF_ALIAS); return value == null ? null : value.toDisplayString(); }
public static String getDisplayable(final SnmpValue snmpValue) { String decodedsnmpValue = snmpValue.toHexString(); try { if (snmpValue.isDisplayable()) decodedsnmpValue = snmpValue.toDisplayString(); } catch (Exception e) { LOG.debug("getDisplayable: got not displayable Value {}", e.getMessage()); } return decodedsnmpValue; }
private String toLogString(final SnmpValue val) { if (val.getType() == SnmpValue.SNMP_OCTET_STRING) { return val.toDisplayString() + " (" + val.toHexString() + ")"; } return val.toString(); }
@Override public void storeResult(ScanContext scanContext, SnmpResult res) { scanContext.updateSysDescription(res.getValue().toDisplayString()); } };
@Override public void storeResult(ScanContext scanContext, SnmpResult res) { scanContext.updateSysLocation(res.getValue().toDisplayString()); } };
@Override public void storeResult(ScanContext scanContext, SnmpResult res) { scanContext.updateSysObjectId(res.getValue().toDisplayString()); } };
@Override public void storeResult(ScanContext scanContext, SnmpResult res) { scanContext.updateSysName(res.getValue().toDisplayString()); } };
@Override public void storeResult(ScanContext scanContext, SnmpResult res) { scanContext.updateSysContact(res.getValue().toDisplayString()); } };
public String getLldpRemPortDescr() { if (getValue(LLDP_REM_PORT_DESCR) != null) return getValue(LLDP_REM_PORT_DESCR).toDisplayString(); return ""; }
@Override protected void storeResult(SnmpResult result) { LOG.trace("Collected SnmpValue '{}'", result); SnmpValue value = result.getValue(); String metricType = value == null ? "unknown" : typeToString(value.getType()); collectionJob.setMetricValue(metricObjId, metricType, value == null ? null : value.toDisplayString()); }
@Override protected void storeResult(SnmpResult result) { logger.trace("Collected SnmpValue '{}'", result); SnmpValue value = result.getValue(); String compositeResult = getCompositeValue(keyword, value.toDisplayString()); collectionJob.setMetricValue(metricObjId, "int32", compositeResult); }
private String getDisplayableCdpCacheAddress() { SnmpValue cdpCacheAddressValue = getValue(CDP_CACHE_ADDRESS); try { if (cdpCacheAddressValue.isDisplayable()) return cdpCacheAddressValue.toDisplayString(); } catch (Exception e) { return cdpCacheAddressValue.toHexString(); } return "not able to diplay"; }
/** * <p>getCdpCacheDevicePort</p> * * @return a {@link java.lang.String} object. */ public String getCdpCacheDevicePort() { if (getValue(CDP_CACHE_DEVICE_PORT).isDisplayable()) return getValue(CDP_CACHE_DEVICE_PORT).toDisplayString(); return getValue(CDP_CACHE_DEVICE_PORT).toHexString(); }
/** * <p>getCdpCacheDeviceId</p> * * @return a {@link java.lang.String} object. */ public String getCdpCacheDeviceId() { if (getValue(CDP_CACHE_DEVICE_ID).isDisplayable()) return getValue(CDP_CACHE_DEVICE_ID).toDisplayString(); return getValue(CDP_CACHE_DEVICE_ID).toHexString(); }
public CdpLink get(CdpLink link) { SnmpValue ifName = getInterfaceNameFromCiscoCdpMib(link.getCdpCacheIfIndex()); if (ifName == null) { ifName = getInterfaceNameFromMib2(link.getCdpCacheIfIndex()); } if (ifName != null) link.setCdpInterfaceName(ifName.toDisplayString()); return link; }