public interface ServiceCollector
CollectionAgent
in
both OpenNMS and Minion.
The order of the calls made to this interface depend on whether
we are running in OpenNMS or Minion.
In OpenNMS when collecting in OpenNMS:
* initialize()
* getEffectiveLocation()
* getRuntimeAttributes()
* collect()
* getRrdRepository()
In OpenNMS when collection in Minion:
* initialize()
* getEffectiveLocation()
* getRuntimeAttributes()
* marshalParameters()
* (RPC Invocation of collect())
* getRrdRepository()
In Minion:
* unmarshalParameters()
* collect()Modifier and Type | Method and Description |
---|---|
CollectionSet |
collect(CollectionAgent agent,
Map<String,Object> parameters)
Invokes a collection on the object.
|
String |
getEffectiveLocation(String location)
Allows the collector to override the location at which it should be run.
|
RrdRepository |
getRrdRepository(String collectionName)
Retrieve the
RrdRepository configuration for the given collection. |
Map<String,Object> |
getRuntimeAttributes(CollectionAgent agent,
Map<String,Object> parameters)
Invoked before every call to
#collect(CollectionAgent, EventProxy, Map) in order
to retrieve state/runtime information required for perform the collection. |
void |
initialize()
Initialize the collector.
|
Map<String,String> |
marshalParameters(Map<String,Object> parameters)
Marshal the parameter values to strings, which is necessary for
passing the parameters over the wire for the RPC call.
|
Map<String,Object> |
unmarshalParameters(Map<String,String> parameters)
Unmarshal the parameter values from strings.
|
void |
validateAgent(CollectionAgent agent,
Map<String,Object> parameters)
Validate whether or not this collector should be scheduled
to run against the given agent.
|
void initialize() throws CollectionInitializationException
void validateAgent(CollectionAgent agent, Map<String,Object> parameters) throws CollectionInitializationException
CollectionInitializationException
must be thrown.
In the case of the SNMP collector, this is used to prevent
collect from scheduling interfaces other than the those
marked as primary on a given node.agent
- parameters
- CollectionInitializationException
CollectionSet collect(CollectionAgent agent, Map<String,Object> parameters) throws CollectionException
agent
- a org.opennms.netmgt.collectd.CollectionAgent
object.parameters
- a Map
object.org.opennms.netmgt.config.collector.CollectionSet
object.org.opennms.netmgt.collectd.CollectionException
- if any.CollectionException
RrdRepository getRrdRepository(String collectionName)
RrdRepository
configuration for the given collection.
This call will always be performed in OpenNMS.collectionName
- a String
object.RrdRepository
object.Map<String,Object> getRuntimeAttributes(CollectionAgent agent, Map<String,Object> parameters)
#collect(CollectionAgent, EventProxy, Map)
in order
to retrieve state/runtime information required for perform the collection.
This call will always be performed in OpenNMS.agent
- Includes details about to the agent from which we wish to collect.parameters
- Includes the service parameters defined in collectd-configuration.xml.#collect(CollectionAgent, EventProxy, Map)
.String getEffectiveLocation(String location)
location
- location associated with the service to be monitoredMap<String,String> marshalParameters(Map<String,Object> parameters)
ServiceCollector
instead of handling
it elsewhere since the API, and RPC module do not have access
to the model objects used by the collector.
This will only be called in OpenNMS when the collector is to be executed remotely.parameters
- Copyright © 2021. All rights reserved.