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 LocationAwareSnmpClientm_clientstatic StringSNMP_STORAGE_PRIMARYValid 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 CollectionSetcollect(CollectionAgent agent, Map<String,Object> parameters)Invokes a collection on the object.RrdRepositorygetRrdRepository(String collectionName)Retrieve theRrdRepositoryconfiguration for the given collection.voidinitialize()Initialize the collector.StringserviceName()Returns the name of the service that the plug-in collects ("SNMP").voidvalidateAgent(CollectionAgent agent, Map<String,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 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 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:ServiceCollectorInitialize 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:
initializein interfaceServiceCollector- Overrides:
initializein classAbstractServiceCollector
-
validateAgent
public void validateAgent(CollectionAgent agent, Map<String,Object> parameters) throws CollectionInitializationException
Description copied from interface:ServiceCollectorValidate 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, aCollectionInitializationExceptionmust 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:
validateAgentin interfaceServiceCollector- Overrides:
validateAgentin classAbstractServiceCollector- Throws:
CollectionInitializationException
-
collect
public abstract CollectionSet collect(CollectionAgent agent, Map<String,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.CollectionAgentobject.parameters- aMapobject.- Returns:
- a
org.opennms.netmgt.config.collector.CollectionSetobject. - Throws:
CollectionException
-
getRrdRepository
public RrdRepository getRrdRepository(String collectionName)
Retrieve theRrdRepositoryconfiguration for the given collection. This call will always be performed in OpenNMS.- Parameters:
collectionName- aStringobject.- Returns:
- a
RrdRepositoryobject.
-
-