Class SnmpDetector
- java.lang.Object
-
- org.opennms.netmgt.provision.support.AbstractDetector
-
- org.opennms.netmgt.provision.support.AgentBasedSyncAbstractDetector<SnmpAgentConfig>
-
- org.opennms.netmgt.provision.detector.snmp.SnmpDetector
-
- All Implemented Interfaces:
ServiceDetector
,SyncServiceDetector
- Direct Known Subclasses:
BgpSessionDetector
,CiscoIpSlaDetector
,DiskUsageDetector
,HostResourceSWRunDetector
,OmsaStorageDetector
,OpenManageChassisDetector
,PercDetector
,Win32ServiceDetector
public class SnmpDetector extends AgentBasedSyncAbstractDetector<SnmpAgentConfig>
SnmpDetector class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnmpDetector.MatchType
-
Field Summary
Fields Modifier and Type Field Description protected static String
DEFAULT_SERVICE_NAME
ConstantDEFAULT_SERVICE_NAME="SNMP"
-
Fields inherited from class org.opennms.netmgt.provision.support.AgentBasedSyncAbstractDetector
HAS_MULTIPLE_AGENT_CONFIGS
-
-
Constructor Summary
Constructors Constructor Description SnmpDetector()
Constructor for SnmpDetector.SnmpDetector(String serviceName, int port)
Constructor for creating a non-default service based on this protocol
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureAgentPTR(SnmpAgentConfig agentConfig)
configureAgentPTRprotected void
configureAgentVersion(SnmpAgentConfig agentConfig)
configureAgentVersionvoid
dispose()
disposeSnmpAgentConfig
getAgentConfig(DetectRequest request)
String
getForceVersion()
getForceVersionString
getHex()
String
getIsTable()
List<SnmpAgentConfig>
getListOfAgentConfigs(DetectRequest request)
Override this if detector can support multiple agent configs.String
getMatchType()
String
getOid()
getOidString
getTtl()
String
getUseSnmpProfiles()
protected static String
getValue(SnmpAgentConfig agentConfig, String oid, boolean hex)
getValueString
getVbvalue()
getVbvalueprotected boolean
isHex()
boolean
isServiceDetected(InetAddress address, List<SnmpAgentConfig> agentConfigList)
boolean
isServiceDetected(InetAddress address, SnmpAgentConfig agentConfig)
protected void
onInit()
onInitvoid
setForceVersion(String forceVersion)
setForceVersionvoid
setHex(String hex)
void
setIsTable(String table)
void
setMatchType(String matchType)
void
setOid(String oid)
setOidvoid
setSnmpDetectorExecutor(ExecutorService snmpDetectorExecutor)
void
setTtl(String ttl)
void
setUseSnmpProfiles(String useSnmpProfiles)
void
setVbvalue(String vbvalue)
setVbvalue-
Methods inherited from class org.opennms.netmgt.provision.support.AgentBasedSyncAbstractDetector
detect, hasMultipleAgentConfigs
-
Methods inherited from class org.opennms.netmgt.provision.support.AbstractDetector
getIpMatch, getPort, getRetries, getServiceName, getTimeout, init, setIpMatch, setPort, setRetries, setServiceName, setTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.provision.ServiceDetector
getIpMatch, getPort, getServiceName, getTimeout, init, setIpMatch, setPort, setServiceName, setTimeout
-
-
-
-
Field Detail
-
DEFAULT_SERVICE_NAME
protected static final String DEFAULT_SERVICE_NAME
ConstantDEFAULT_SERVICE_NAME="SNMP"
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIsTable
public String getIsTable()
-
setIsTable
public void setIsTable(String table)
-
setHex
public void setHex(String hex)
-
getHex
public String getHex()
-
isHex
protected boolean isHex()
-
getAgentConfig
public SnmpAgentConfig getAgentConfig(DetectRequest request)
- Specified by:
getAgentConfig
in classAgentBasedSyncAbstractDetector<SnmpAgentConfig>
-
isServiceDetected
public boolean isServiceDetected(InetAddress address, SnmpAgentConfig agentConfig)
- Specified by:
isServiceDetected
in classAgentBasedSyncAbstractDetector<SnmpAgentConfig>
-
getListOfAgentConfigs
public List<SnmpAgentConfig> getListOfAgentConfigs(DetectRequest request)
Description copied from class:AgentBasedSyncAbstractDetector
Override this if detector can support multiple agent configs.- Overrides:
getListOfAgentConfigs
in classAgentBasedSyncAbstractDetector<SnmpAgentConfig>
-
isServiceDetected
public boolean isServiceDetected(InetAddress address, List<SnmpAgentConfig> agentConfigList)
- Overrides:
isServiceDetected
in classAgentBasedSyncAbstractDetector<SnmpAgentConfig>
-
configureAgentVersion
protected void configureAgentVersion(SnmpAgentConfig agentConfig)
configureAgentVersion
- Parameters:
agentConfig
- aSnmpAgentConfig
object.
-
configureAgentPTR
protected void configureAgentPTR(SnmpAgentConfig agentConfig)
configureAgentPTR
- Parameters:
agentConfig
- aSnmpAgentConfig
object.
-
getValue
protected static String getValue(SnmpAgentConfig agentConfig, String oid, boolean hex)
getValue
- Parameters:
agentConfig
- aSnmpAgentConfig
object.oid
- aString
object.- Returns:
- a
String
object.
-
setForceVersion
public void setForceVersion(String forceVersion)
setForceVersion
- Parameters:
forceVersion
- aString
object.
-
setVbvalue
public void setVbvalue(String vbvalue)
setVbvalue
- Parameters:
vbvalue
- aString
object.
-
onInit
protected void onInit()
onInit
- Specified by:
onInit
in classAbstractDetector
-
dispose
public void dispose()
dispose
- Specified by:
dispose
in interfaceServiceDetector
- Specified by:
dispose
in classAbstractDetector
-
setMatchType
public void setMatchType(String matchType)
-
getMatchType
public String getMatchType()
-
setSnmpDetectorExecutor
public void setSnmpDetectorExecutor(ExecutorService snmpDetectorExecutor)
-
getTtl
public String getTtl()
-
setTtl
public void setTtl(String ttl)
-
setUseSnmpProfiles
public void setUseSnmpProfiles(String useSnmpProfiles)
-
getUseSnmpProfiles
public String getUseSnmpProfiles()
-
-