public Map<String, String> getRuntimeAttributes(String location, InetAddress address) { if (m_agentConfigFactory == null) { throw new IllegalStateException("Cannot determine agent configuration without a SnmpAgentConfigFactory."); } return m_agentConfigFactory.getAgentConfig(address, location).toMap(); }
private SnmpAgentConfig getAgentConfig(InetAddress primaryAddress) { return getAgentConfigFactory().getAgentConfig(primaryAddress, (m_location == null) ? null : m_location.getLocationName()); }
private SnmpAgentConfig getAgentConfig(InetAddress primaryAddress) { return getAgentConfigFactory().getAgentConfig(primaryAddress, (m_location == null) ? null : m_location.getLocationName()); }
@Override public Object execute() throws Exception { LOG.debug("snmp:walk {} {} {}", m_location != null ? "-l " + m_location : "", m_host, m_oids); final List<SnmpObjId> snmpObjIds = m_oids.stream() .map(SnmpObjId::get) .collect(Collectors.toList()); final SnmpAgentConfig agent = snmpAgentConfigFactory.getAgentConfig(InetAddress.getByName(m_host), m_location); final CompletableFuture<List<SnmpResult>> future = locationAwareSnmpClient.walk(agent, snmpObjIds) .withDescription("snmp:walk") .withLocation(m_location) .withSystemId(m_systemId) .execute(); while (true) { try { future.get(1, TimeUnit.SECONDS).stream() .forEach(res -> { System.out.printf("[%s].[%s] = %s%n", res.getBase(), res.getInstance(), res.getValue()); }); break; } catch (TimeoutException e) { // pass } System.out.print("."); } return null; } }
@Override public Object execute() throws Exception { final InetAddress agentAdress = InetAddress.getByName(m_host); final SnmpAgentConfig agent = snmpAgentConfigFactory.getAgentConfig(agentAdress, m_location);
/** {@inheritDoc} */ @Override public void scan(ScanContext context) throws InterruptedException { InetAddress agentAddress = context.getAgentAddress("SNMP"); if (agentAddress == null) { return; } SnmpAgentConfig agentConfig = m_snmpAgentConfigFactory.getAgentConfig(agentAddress, null); try(SnmpWalker walker = SnmpUtils.createWalker(agentConfig, getName(), createCollectionTracker(context))) { walker.start(); walker.waitFor(); } }
OnmsMonitoringLocation location = node.getLocation(); String locationName = (location == null) ? null : location.getLocationName(); final SnmpAgentConfig snmpAgentConfig = m_snmpAgentConfigFactory.getAgentConfig(node.getPrimaryInterface().getIpAddress(), locationName); collectionJob.setProtocolConfiguration(snmpAgentConfig.toProtocolConfigString()); collectionJob.setNetInterface(node.getPrimaryInterface().getIpAddress().getHostAddress());
public void detectPhysicalInterfaces(final BatchTask currentPhase) { if (isAborted()) { return; } String locationName = getLocation()== null ? null : getLocation().getLocationName(); final SnmpAgentConfig agentConfig = getAgentConfigFactory().getAgentConfig(getAgentAddress(), locationName); Assert.notNull(getAgentConfigFactory(), "agentConfigFactory was not injected");
public void detectPhysicalInterfaces(final BatchTask currentPhase) { if (isAborted()) { return; } String locationName = getLocation()== null ? null : getLocation().getLocationName(); final SnmpAgentConfig agentConfig = getAgentConfigFactory().getAgentConfig(getAgentAddress(), locationName); Assert.notNull(getAgentConfigFactory(), "agentConfigFactory was not injected");
final SnmpAgentConfig agentConfig = m_snmpConfigDao.getAgentConfig(ipaddress, locationName);
agentConfig = m_snmpConfigDao.getAgentConfig(ipaddress, locationName);
final SnmpAgentConfig agentConfig = m_snmpConfigDao.getAgentConfig(ipaddress, locationName);
agentConfig = m_snmpConfigDao.getAgentConfig(ipaddress, locationName);
final SnmpAgentConfig agentConfig = getAgentConfigFactory().getAgentConfig(getAgentAddress(), locationName); m_provisionService.getLocationAwareSnmpClient().walk(agentConfig, tracker) .withDescription("IP address tables")
final SnmpAgentConfig agentConfig = getAgentConfigFactory().getAgentConfig(getAgentAddress(), locationName); m_provisionService.getLocationAwareSnmpClient().walk(agentConfig, tracker) .withDescription("IP address tables")
SnmpAgentConfig agentConfig = m_snmpConfigDao.getAgentConfig(ipAddress, locationName); final OnmsHwEntity newRoot = getRootEntity(agentConfig, node); newRoot.setNode(node);