Package org.opennms.netmgt.collectd
Class DefaultSnmpCollectionAgent
- java.lang.Object
-
- org.opennms.netmgt.collection.core.DefaultCollectionAgent
-
- org.opennms.netmgt.collectd.DefaultSnmpCollectionAgent
-
- All Implemented Interfaces:
SnmpCollectionAgent
,CollectionAgent
,StorageStrategyService
public class DefaultSnmpCollectionAgent extends DefaultCollectionAgent implements SnmpCollectionAgent
Represents a remote SNMP agent on a specific IPv4 interface.- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.collection.core.DefaultCollectionAgent
m_agentService
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultSnmpCollectionAgent(SnmpCollectionAgentService agentService, java.lang.String location)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SnmpCollectionAgent
create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr)
createstatic SnmpCollectionAgent
create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr, java.lang.String location)
SnmpAgentConfig
getAgentConfig()
getAgentConfigint
getSavedIfCount()
getSavedIfCountjava.util.Set<IfInfo>
getSnmpInterfaceInfo(IfResourceType type)
getSnmpInterfaceInfojava.lang.String
getSnmpInterfaceLabel(int ifIndex)
This method is used on StorageStrategy implementation when the resource index is associated to a physical interface like frame relay resources.java.lang.String
getSysObjectId()
getSysObjectIdprotected void
logCollectionParms()
protected void
logCompletion()
void
setSavedIfCount(int ifCount)
setSavedIfCountvoid
validateAgent()
validateAgent-
Methods inherited from class org.opennms.netmgt.collection.core.DefaultCollectionAgent
getAddress, getAttribute, getAttributeNames, getForeignId, getForeignSource, getHostAddress, getLocationName, getNodeId, getNodeLabel, getSavedSysUpTime, getStorageResourcePath, isStoreByForeignSource, setAttribute, setSavedSysUpTime, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.collection.api.CollectionAgent
getAddress, getAttribute, getAttributeNames, getForeignId, getForeignSource, getHostAddress, getLocationName, getNodeId, getNodeLabel, getSavedSysUpTime, getStorageResourcePath, isStoreByForeignSource, setAttribute, setSavedSysUpTime
-
-
-
-
Constructor Detail
-
DefaultSnmpCollectionAgent
protected DefaultSnmpCollectionAgent(SnmpCollectionAgentService agentService, java.lang.String location)
-
-
Method Detail
-
create
public static SnmpCollectionAgent create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr)
create
- Parameters:
ifaceId
- aInteger
object.ifaceDao
- aIpInterfaceDao
object.transMgr
- aPlatformTransactionManager
object.- Returns:
- a
CollectionAgent
object.
-
create
public static SnmpCollectionAgent create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr, java.lang.String location)
-
setSavedIfCount
public void setSavedIfCount(int ifCount)
setSavedIfCount
- Specified by:
setSavedIfCount
in interfaceSnmpCollectionAgent
- Parameters:
ifCount
- a int.
-
getSavedIfCount
public int getSavedIfCount()
getSavedIfCount
- Specified by:
getSavedIfCount
in interfaceSnmpCollectionAgent
- Returns:
- a int.
-
getSysObjectId
public java.lang.String getSysObjectId()
getSysObjectId
- Specified by:
getSysObjectId
in interfaceSnmpCollectionAgent
- Returns:
- a
String
object.
-
logCompletion
protected void logCompletion()
- Overrides:
logCompletion
in classDefaultCollectionAgent
-
logCollectionParms
protected void logCollectionParms()
- Overrides:
logCollectionParms
in classDefaultCollectionAgent
-
validateAgent
public void validateAgent() throws CollectionInitializationException
validateAgent
- Specified by:
validateAgent
in interfaceSnmpCollectionAgent
- Throws:
CollectionInitializationException
-
getAgentConfig
public SnmpAgentConfig getAgentConfig()
Description copied from interface:StorageStrategyService
getAgentConfig
- Specified by:
getAgentConfig
in interfaceStorageStrategyService
- Returns:
- a
SnmpAgentConfig
object.
-
getSnmpInterfaceInfo
public java.util.Set<IfInfo> getSnmpInterfaceInfo(IfResourceType type)
getSnmpInterfaceInfo
- Specified by:
getSnmpInterfaceInfo
in interfaceSnmpCollectionAgent
- Parameters:
type
- aIfResourceType
object.- Returns:
- a
Set
object.
-
getSnmpInterfaceLabel
public java.lang.String getSnmpInterfaceLabel(int ifIndex)
This method is used on StorageStrategy implementation when the resource index is associated to a physical interface like frame relay resources. OpenNMS always track changes on ifTable so, make SNMP queries on this table is redundant, and implementations of CollectionAgent know ifTable content always. This method give interface information from a specific ifIndex.- Specified by:
getSnmpInterfaceLabel
in interfaceStorageStrategyService
- Parameters:
ifIndex
- a int.- Returns:
- a
String
object.
-
-