public abstract class AbstractServiceCollector extends Object implements ServiceCollector
ServiceCollector
implementations.
If the ServiceCollector
is expected to run on both OpenNMS and Minion,
consider extending AbstractRemoteServiceCollector
instead.Constructor and Description |
---|
AbstractServiceCollector() |
Modifier and Type | Method and Description |
---|---|
String |
getEffectiveLocation(String location)
Allows the collector to override the location at which it should be run.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
collect, getRrdRepository
public void initialize() throws CollectionInitializationException
ServiceCollector
initialize
in interface ServiceCollector
CollectionInitializationException
public void validateAgent(CollectionAgent agent, Map<String,Object> parameters) throws CollectionInitializationException
ServiceCollector
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.validateAgent
in interface ServiceCollector
CollectionInitializationException
public Map<String,Object> getRuntimeAttributes(CollectionAgent agent, Map<String,Object> parameters)
ServiceCollector
#collect(CollectionAgent, EventProxy, Map)
in order
to retrieve state/runtime information required for perform the collection.
This call will always be performed in OpenNMS.getRuntimeAttributes
in interface ServiceCollector
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)
.public String getEffectiveLocation(String location)
ServiceCollector
getEffectiveLocation
in interface ServiceCollector
location
- location associated with the service to be monitoredpublic Map<String,String> marshalParameters(Map<String,Object> parameters)
ServiceCollector
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.marshalParameters
in interface ServiceCollector
public Map<String,Object> unmarshalParameters(Map<String,String> parameters)
ServiceCollector
unmarshalParameters
in interface ServiceCollector
Copyright © 2021. All rights reserved.