use of org.opennms.netmgt.collection.dto.CollectionAgentDTO in project opennms by OpenNMS.
the class CollectCommand method getCollectionAgent.
private CollectionAgent getCollectionAgent() {
final InetAddress hostAddr = InetAddrUtils.addr(host);
if (nodeCriteria != null) {
return collectionAgentFactory.createCollectionAgentAndOverrideLocation(nodeCriteria, hostAddr, location);
} else {
System.out.println("NOTE: Some collectors require a database node and IP interface.\n");
final CollectionAgentDTO agent = new CollectionAgentDTO();
agent.setLocationName(location);
agent.setAddress(hostAddr);
agent.setStorageResourcePath(ResourcePath.fromString(""));
return agent;
}
}
Aggregations