use of org.opennms.netmgt.config.collectd.Package in project opennms by OpenNMS.
the class HttpCollectorIT method doTestNMS4886.
public final void doTestNMS4886(String svcName) throws Exception {
HttpCollector collector = new HttpCollector();
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("http-collection", "default");
parameters.put("port", "10342");
collector.initialize();
Package pkg = new Package();
Filter filter = new Filter();
filter.setContent("IPADDR IPLIKE *.*.*.*");
pkg.setFilter(filter);
Service service = new Service();
service.setName(svcName);
Parameter collectionParm = new Parameter();
collectionParm.setKey("http-collection");
collectionParm.setValue("default");
service.addParameter(collectionParm);
Parameter portParm = new Parameter();
portParm.setKey("port");
portParm.setValue("10342");
service.addParameter(portParm);
pkg.addService(service);
CollectionSpecification collectionSpecification = new CollectionSpecification(pkg, svcName, collector, new DefaultCollectdInstrumentation(), CollectorTestUtils.createLocationAwareCollectorClient());
CollectionSet collectionSet = collectionSpecification.collect(m_collectionAgent);
assertEquals("collection status", CollectionStatus.SUCCEEDED, collectionSet.getStatus());
CollectorTestUtils.persistCollectionSet(m_rrdStrategy, m_resourceStorageDao, collectionSpecification, collectionSet);
}
Aggregations