Package org.opennms.netmgt.collectd
Class AbstractSnmpCollector
- java.lang.Object
-
- org.opennms.netmgt.collection.api.AbstractServiceCollector
-
- org.opennms.netmgt.collectd.AbstractSnmpCollector
-
- All Implemented Interfaces:
ServiceCollector
- Direct Known Subclasses:
SnmpCollector
,SnmpCollectorNG
public abstract class AbstractSnmpCollector extends AbstractServiceCollector
Commons between SnmpCollector and SnmpCollectorNG.
- Author:
- Matt Brozowski
-
-
Field Summary
Fields Modifier and Type Field Description protected LocationAwareSnmpClient
m_client
static java.lang.String
SNMP_STORAGE_PRIMARY
Valid values for the 'snmpStorageFlag' attribute in datacollection-config XML file.
-
Constructor Summary
Constructors Constructor Description AbstractSnmpCollector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract CollectionSet
collect(CollectionAgent agent, java.util.Map<java.lang.String,java.lang.Object> parameters)
Invokes a collection on the object.RrdRepository
getRrdRepository(java.lang.String collectionName)
Retrieve theRrdRepository
configuration for the given collection.void
initialize()
Initialize the collector.java.lang.String
serviceName()
Returns the name of the service that the plug-in collects ("SNMP").void
validateAgent(CollectionAgent agent, java.util.Map<java.lang.String,java.lang.Object> parameters)
Validate whether or not this collector should be scheduled to run against the given agent.-
Methods inherited from class org.opennms.netmgt.collection.api.AbstractServiceCollector
getEffectiveLocation, getRuntimeAttributes, marshalParameters, unmarshalParameters
-
-
-
-
Field Detail
-
SNMP_STORAGE_PRIMARY
public static final java.lang.String SNMP_STORAGE_PRIMARY
Valid values for the 'snmpStorageFlag' attribute in datacollection-config XML file. "primary" = only primary SNMP interface should be collected and stored "all" = all primary SNMP interfaces should be collected and stored- See Also:
- Constant Field Values
-
m_client
protected LocationAwareSnmpClient m_client
-
-
Method Detail
-
serviceName
public java.lang.String serviceName()
Returns the name of the service that the plug-in collects ("SNMP").- Returns:
- The service that the plug-in collects.
-
initialize
public void initialize()
Description copied from interface:ServiceCollector
Initialize the collector. This call will be invoked in OpenNMS before any other calls to the collector are made. This function may be invoked several times during the lifetime or the collector.- Specified by:
initialize
in interfaceServiceCollector
- Overrides:
initialize
in classAbstractServiceCollector
-
validateAgent
public void validateAgent(CollectionAgent agent, java.util.Map<java.lang.String,java.lang.Object> parameters) throws CollectionInitializationException
Description copied from interface:ServiceCollector
Validate whether or not this collector should be scheduled to run against the given agent. If the collector cannot, or should not be a run against a given agent, aCollectionInitializationException
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.- Specified by:
validateAgent
in interfaceServiceCollector
- Overrides:
validateAgent
in classAbstractServiceCollector
- Throws:
CollectionInitializationException
-
collect
public abstract CollectionSet collect(CollectionAgent agent, java.util.Map<java.lang.String,java.lang.Object> parameters) throws CollectionException
Invokes a collection on the object. This call will be performed in both OpenNMS and Minion. Perform data collection.- Parameters:
agent
- aorg.opennms.netmgt.collectd.CollectionAgent
object.parameters
- aMap
object.- Returns:
- a
org.opennms.netmgt.config.collector.CollectionSet
object. - Throws:
CollectionException
-
getRrdRepository
public RrdRepository getRrdRepository(java.lang.String collectionName)
Retrieve theRrdRepository
configuration for the given collection. This call will always be performed in OpenNMS.- Parameters:
collectionName
- aString
object.- Returns:
- a
RrdRepository
object.
-
-