com.adventnet.snmp.mibs.agent
Class SnmpMibTrapService
java.lang.Object
|
+--com.adventnet.snmp.snmp2.agent.Cache
|
+--com.adventnet.snmp.snmp2.agent.BaseSnmpStore
|
+--com.adventnet.snmp.snmp2.agent.BaseSnmpTrapService
|
+--com.adventnet.snmp.snmp2.agent.SnmpTrapService
|
+--com.adventnet.snmp.mibs.agent.SnmpMibTrapService
- public class SnmpMibTrapService
- extends SnmpTrapService
Used to send SNMP V1 & SNMP V2c Traps.
Provides MIB support for traps by looking up for node Labels
argument. It will convert into corresponding SnmpVarBind and SnmpOID
by using the MibOperations instance.
- See Also:
- , Serialized Form
|
Field Summary |
(package private) java.lang.String |
mibModules
|
| Fields inherited from class com.adventnet.snmp.snmp2.agent.SnmpTrapService |
fileToVector,
forTable,
hdlr,
isPersistence,
isReliableTraps,
notifHdlr1,
notifVarHdlr1,
numRowsforRelTraps,
selectedPort,
snmpTrap,
trapPathName,
trapPDU,
trapSet,
trapTableName,
v3ForTable,
v3TrapTableName |
| Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpTrapService |
agentAddr,
community,
enterprise,
forTable,
hdlr,
isInformRequest,
listener,
managerHost,
managerPort,
rowIndex,
selectedPort,
sessionPort,
snmpLog,
tfTable,
trapIndex,
trapPDU,
trapSource,
trapSourceDefault,
varb,
version |
| Fields inherited from class com.adventnet.snmp.snmp2.agent.Cache |
cache,
debug |
|
Method Summary |
MibModule |
addMib(java.lang.String mibFile)
adds the Mib to the list of modules already loaded |
void |
addTrapRequest(TrapRequestEvent te)
This is the listener method for TrapRequestEvents
Source beans would call this method when they need
to issue Traps |
java.lang.String |
getMibModules()
Get the MIBs loaded in this applet/application |
(package private) SnmpVarBind |
getVarBind(OidandValue oidValue)
adds the varbind with specified oid, type and value to the pdu |
int |
getVersion()
get the Snmp Version |
static void |
main(java.lang.String[] args)
It can also used as a stand-alone application
|
void |
sendTrap(java.lang.String managerNode,
int managerPort,
SnmpOID enterpriseOID,
java.lang.String community,
int trapIndex,
long timeticks,
java.util.Vector varbindings)
Used by SnmpAgent to send SNMPV1 & SNMPV2 traps |
void |
sendTrap(java.lang.String managerNode,
int managerPort,
java.lang.String enterprise,
java.lang.String community,
int trapIndex,
long timeticks,
OidandValue[] varbindings)
Using the AgentMibOperations instance this method resolves the
enterprise & OidandValue into corresponding SnmpOID and SnmpVarBind
variables. |
void |
setMibModules(java.lang.String mibFiles)
parse the MibFiles in this application
and setupAgent clauses |
void |
setMibOperations(AgentMibOperations mibOps)
Setter for MibOperations which loads the MIB etc
Note that the MibOperations are shared |
void |
setVersion(int snmpVersion)
sets the Snmp version |
(package private) void |
updateMibs(java.lang.String mibModules)
|
| Methods inherited from class com.adventnet.snmp.snmp2.agent.SnmpTrapService |
addSnmpV2TrapHeader,
doRegistration,
getContextName,
getSecurityLevel,
getSecurityModel,
getTrapFlag,
getTrapObject,
getTrapPathName,
getTrapTableName,
getUserName,
getV3TrapTableName,
isPersistence,
isReliableTraps,
nativeInitTrapService,
printDecodedPDU,
sendTrap,
sendTrap,
sendTrap,
sendTrapToManagersInTable,
setContextName,
setFToVPersistence,
setHandler,
setPersistence,
setRefreshTrapTable,
setReliableTraps,
setSecurityLevel,
setSecurityModel,
setTrapFlag,
setTrapForwardingTable,
setTrapObject,
setTrapPathName,
setTrapTableName,
setUserName,
setV3TrapTableName,
setWriter |
| Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpTrapService |
addRegistrationListener,
addSnmpV1TrapHeader,
closeTrapSession,
createProtocolOptions,
getAgentAddr,
getCommunity,
getEnterpriseOID,
getInformFlag,
getLocalAddress,
getManagerHost,
getManagerPort,
getTrapForwardingTable,
getTrapIndex,
getTrapSession,
getVarbind,
initSeperateTrapSession,
isTrapSessionAlive,
isTrapSourceDefault,
isUsesSeperateSession,
oidEqualsSnmp,
oidEqualsSnmp,
removeRegistrationListener,
sendTrap,
sendTrap,
sendTrap,
sendTrapDefault,
sendTrapToManagers,
setAgentAddr,
setCommunity,
setDebug,
setDefaultTrap,
setEnterpriseOID,
setForwardingEntryOID,
setHandler,
setInformFlag,
setLocalAddress,
setManagerHost,
setManagerPort,
setProtocol,
setTrapIndex,
setTrapSession,
setTrapSessionPort,
setTrapSourceDefault,
setUsesSeperateSession,
setVarbind,
validateTrap |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
mibModules
java.lang.String mibModules
SnmpMibTrapService
public SnmpMibTrapService(AgentMibOperations mibOperations)
- constructor with param MibOperations
SnmpMibTrapService
public SnmpMibTrapService()
- No Arg constructor
creates a MibOperations reference if the Cache
doesnt have one
setMibOperations
public void setMibOperations(AgentMibOperations mibOps)
- Setter for MibOperations which loads the MIB etc
Note that the MibOperations are shared
main
public static void main(java.lang.String[] args)
- It can also used as a stand-alone application
usage: SnmpTrap [-d] [-M managerNode] [-m MIB_file] [-m2 Second_MIB_file] [-p port] [-t timeticks]
sendTrap
public void sendTrap(java.lang.String managerNode,
int managerPort,
SnmpOID enterpriseOID,
java.lang.String community,
int trapIndex,
long timeticks,
java.util.Vector varbindings)
- Used by SnmpAgent to send SNMPV1 & SNMPV2 traps
- Parameters:
enterpriseOID - enterprise-oid (in OID format )varbindings - Vector of type Snmp.SnmpVarBind- See Also:
SnmpVarBind
sendTrap
public void sendTrap(java.lang.String managerNode,
int managerPort,
java.lang.String enterprise,
java.lang.String community,
int trapIndex,
long timeticks,
OidandValue[] varbindings)
- Using the AgentMibOperations instance this method resolves the
enterprise & OidandValue into corresponding SnmpOID and SnmpVarBind
variables.
- Parameters:
enterprise - enterprise-oid(in string)varbindings - Vector in OidandValue- See Also:
OidandValue
setVersion
public void setVersion(int snmpVersion)
- sets the Snmp version
- Overrides:
- setVersion in class BaseSnmpTrapService
- Parameters:
SnmpAPI - version constant
getVersion
public int getVersion()
- get the Snmp Version
- Overrides:
- getVersion in class BaseSnmpTrapService
- Returns:
- Snmp version value
- See Also:
version constans like SnmpAPI.SNMP_VERSION_1 etc..
getVarBind
SnmpVarBind getVarBind(OidandValue oidValue)
- adds the varbind with specified oid, type and value to the pdu
addTrapRequest
public void addTrapRequest(TrapRequestEvent te)
- This is the listener method for TrapRequestEvents
Source beans would call this method when they need
to issue Traps
- Overrides:
- addTrapRequest in class SnmpTrapService
- Tags copied from class: SnmpTrapService
- Parameters:
te - the trap event- See Also:
TrapRequestEvent
setMibModules
public void setMibModules(java.lang.String mibFiles)
- parse the MibFiles in this application
and setupAgent clauses
- Parameters:
a - white-space separated list of mib files
getMibModules
public java.lang.String getMibModules()
- Get the MIBs loaded in this applet/application
- Returns:
- a white-space separated list of mib files.
updateMibs
void updateMibs(java.lang.String mibModules)
addMib
public MibModule addMib(java.lang.String mibFile)
- adds the Mib to the list of modules already loaded
- Returns:
- null on errors