Search in sources :

Example 11 with Package

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);
}
Also used : HashMap(java.util.HashMap) Filter(org.opennms.netmgt.config.collectd.Filter) CollectionSpecification(org.opennms.netmgt.collection.core.CollectionSpecification) Service(org.opennms.netmgt.config.collectd.Service) Parameter(org.opennms.netmgt.config.collectd.Parameter) Package(org.opennms.netmgt.config.collectd.Package) DefaultCollectdInstrumentation(org.opennms.netmgt.collection.core.DefaultCollectdInstrumentation) CollectionSet(org.opennms.netmgt.collection.api.CollectionSet)

Aggregations

Package (org.opennms.netmgt.config.collectd.Package)11 Service (org.opennms.netmgt.config.collectd.Service)8 Filter (org.opennms.netmgt.config.collectd.Filter)7 Parameter (org.opennms.netmgt.config.collectd.Parameter)5 CollectionSpecification (org.opennms.netmgt.collection.core.CollectionSpecification)3 DefaultCollectdInstrumentation (org.opennms.netmgt.collection.core.DefaultCollectdInstrumentation)2 CollectdConfiguration (org.opennms.netmgt.config.collectd.CollectdConfiguration)2 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 TreeMap (java.util.TreeMap)1 Before (org.junit.Before)1 Test (org.junit.Test)1 MockRpcClientFactory (org.opennms.core.rpc.mock.MockRpcClientFactory)1 MockPlatformTransactionManager (org.opennms.core.test.MockPlatformTransactionManager)1 AttributeGroupType (org.opennms.netmgt.collection.api.AttributeGroupType)1 CollectionSet (org.opennms.netmgt.collection.api.CollectionSet)1 ServiceParameters (org.opennms.netmgt.collection.api.ServiceParameters)1 Collector (org.opennms.netmgt.config.collectd.Collector)1 MibObject (org.opennms.netmgt.config.datacollection.MibObject)1