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 protectedDefaultSnmpCollectionAgent(SnmpCollectionAgentService agentService, String location)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SnmpCollectionAgentcreate(Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr)createstatic SnmpCollectionAgentcreate(Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr, String location)SnmpAgentConfiggetAgentConfig()getAgentConfigintgetSavedIfCount()getSavedIfCountSet<IfInfo>getSnmpInterfaceInfo(IfResourceType type)getSnmpInterfaceInfoStringgetSnmpInterfaceLabel(int ifIndex)This method is used on StorageStrategy implementation when the resource index is associated to a physical interface like frame relay resources.StringgetSysObjectId()getSysObjectIdprotected voidlogCollectionParms()protected voidlogCompletion()voidsetSavedIfCount(int ifCount)setSavedIfCountvoidvalidateAgent()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, String location)
-
-
Method Detail
-
create
public static SnmpCollectionAgent create(Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr)
create
- Parameters:
ifaceId- aIntegerobject.ifaceDao- aIpInterfaceDaoobject.transMgr- aPlatformTransactionManagerobject.- Returns:
- a
CollectionAgentobject.
-
create
public static SnmpCollectionAgent create(Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr, String location)
-
setSavedIfCount
public void setSavedIfCount(int ifCount)
setSavedIfCount
- Specified by:
setSavedIfCountin interfaceSnmpCollectionAgent- Parameters:
ifCount- a int.
-
getSavedIfCount
public int getSavedIfCount()
getSavedIfCount
- Specified by:
getSavedIfCountin interfaceSnmpCollectionAgent- Returns:
- a int.
-
getSysObjectId
public String getSysObjectId()
getSysObjectId
- Specified by:
getSysObjectIdin interfaceSnmpCollectionAgent- Returns:
- a
Stringobject.
-
logCompletion
protected void logCompletion()
- Overrides:
logCompletionin classDefaultCollectionAgent
-
logCollectionParms
protected void logCollectionParms()
- Overrides:
logCollectionParmsin classDefaultCollectionAgent
-
validateAgent
public void validateAgent() throws CollectionInitializationExceptionvalidateAgent
- Specified by:
validateAgentin interfaceSnmpCollectionAgent- Throws:
CollectionInitializationException
-
getAgentConfig
public SnmpAgentConfig getAgentConfig()
Description copied from interface:StorageStrategyServicegetAgentConfig
- Specified by:
getAgentConfigin interfaceStorageStrategyService- Returns:
- a
SnmpAgentConfigobject.
-
getSnmpInterfaceInfo
public Set<IfInfo> getSnmpInterfaceInfo(IfResourceType type)
getSnmpInterfaceInfo
- Specified by:
getSnmpInterfaceInfoin interfaceSnmpCollectionAgent- Parameters:
type- aIfResourceTypeobject.- Returns:
- a
Setobject.
-
getSnmpInterfaceLabel
public 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:
getSnmpInterfaceLabelin interfaceStorageStrategyService- Parameters:
ifIndex- a int.- Returns:
- a
Stringobject.
-
-