|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.trapd.TrapQueueProcessor
The TrapQueueProcessor handles the conversion of V1 and V2 traps to events and sending them out the JSDT channel that eventd is listening on
Field Summary | |
private static char |
DOT_CHAR
The dot separator in an OID |
private static java.lang.String |
EXTREME_SNMP_SYSUPTIME_OID
The sysUpTimeOID, which should be the first varbind in a V2 trap, but in the case of Extreme Networks only mostly |
private static java.util.ArrayList |
GENERIC_TRAPS
The standard traps list |
private FifoQueue |
m_backlogQ
The input queue |
private java.lang.String |
m_localAddr
The name of the local host. |
private boolean |
m_newSuspect
Whether or not a newSuspect event should be generated with a trap from an unknown IP address |
private int |
m_status
Current status of the fiber |
private java.lang.Thread |
m_worker
The thread that is executing the run method on behalf of
the fiber. |
private static java.lang.String |
SNMP_SYSUPTIME_OID
The sysUpTimeOID, which should be the first varbind in a V2 trap |
private static int |
SNMP_SYSUPTIME_OID_INDEX
The snmp sysUpTime OID is the first varbind |
private static java.lang.String |
SNMP_TRAP_ENTERPRISE_ID
The snmp trap enterprise OID, which if present in a V2 trap is the last varbind. |
private static java.lang.String |
SNMP_TRAP_OID
The snmpTrapOID, which should be the second varbind in a V2 trap |
private static int |
SNMP_TRAP_OID_INDEX
The snmp trap OID is the second varbind |
private static java.lang.String |
SNMP_TRAPS
The snmpTraps value to be used in case a standard trap comes in without the SNMP_TRAP_ENTERPRISE_ID as the last varbind. |
Fields inherited from interface org.opennms.core.fiber.PausableFiber |
PAUSE_PENDING, PAUSED, RESUME_PENDING |
Fields inherited from interface org.opennms.core.fiber.Fiber |
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED |
Constructor Summary | |
(package private) |
TrapQueueProcessor(FifoQueue backlog,
boolean newSuspect)
The constructor |
Method Summary | |
java.lang.String |
getName()
Returns the name of the fiber. |
int |
getStatus()
Returns the current status of the fiber |
void |
pause()
Pauses the current fiber. |
private void |
process(Trapd.V1TrapInformation info)
Process a V1 trap and convert it to an event. |
private void |
process(Trapd.V2TrapInformation info)
Process a V2 trap and convert it to an event for transmission. |
void |
resume()
Resumes the currently paused fiber. |
void |
run()
Reads off of the input queue and depending on the type (V1 or V2 trap) of object read, process the traps to convert them to events and send them out |
private void |
sendNewSuspectEvent(java.lang.String trapInterface)
Send a newSuspect event for the interface |
void |
start()
Starts the current fiber. |
private boolean |
statusOK()
Returns true if the status is ok and the thread should continue running. |
void |
stop()
Stops this fiber. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String SNMP_SYSUPTIME_OID
private static final java.lang.String EXTREME_SNMP_SYSUPTIME_OID
private static final java.lang.String SNMP_TRAP_OID
private static final java.lang.String SNMP_TRAP_ENTERPRISE_ID
private static final java.lang.String SNMP_TRAPS
private static final java.util.ArrayList GENERIC_TRAPS
private static final int SNMP_SYSUPTIME_OID_INDEX
private static final int SNMP_TRAP_OID_INDEX
private static final char DOT_CHAR
private FifoQueue m_backlogQ
private java.lang.String m_localAddr
private int m_status
private java.lang.Thread m_worker
run
method on behalf of
the fiber.
private boolean m_newSuspect
Constructor Detail |
TrapQueueProcessor(FifoQueue backlog, boolean newSuspect)
Method Detail |
private void process(Trapd.V2TrapInformation info)
From RFC2089 ('Mapping SNMPv2 onto SNMPv1'), section 3.3 ('Processing an outgoing SNMPv2 TRAP')
2b
If the snmpTrapOID.0 value is one of the standard traps the specific-trap field is set to zero and the generic trap field is set according to this mapping:
value of snmpTrapOID.0 generic-trap =============================== ============ 1.3.6.1.6.3.1.1.5.1 (coldStart) 0 1.3.6.1.6.3.1.1.5.2 (warmStart) 1 1.3.6.1.6.3.1.1.5.3 (linkDown) 2 1.3.6.1.6.3.1.1.5.4 (linkUp) 3 1.3.6.1.6.3.1.1.5.5 (authenticationFailure) 4 1.3.6.1.6.3.1.1.5.6 (egpNeighborLoss) 5
The enterprise field is set to the value of snmpTrapEnterprise.0 if this varBind is present, otherwise it is set to the value snmpTraps as defined in RFC1907 [4].
2c.
If the snmpTrapOID.0 value is not one of the standard traps, then the generic-trap field is set to 6 and the specific-trap field is set to the last subid of the snmpTrapOID.0 value.
If the next to last subid of snmpTrapOID.0 is zero, then the enterprise field is set to snmpTrapOID.0 value and the last 2 subids are truncated from that value. If the next to last subid of snmpTrapOID.0 is not zero, then the enterprise field is set to snmpTrapOID.0 value and the last 1 subid is truncated from that value.
In any event, the snmpTrapEnterprise.0 varBind (if present) is ignored in this case.
info
- V2 trapprivate void process(Trapd.V1TrapInformation info)
info
- V1 trapprivate void sendNewSuspectEvent(java.lang.String trapInterface)
trapInterface
- The interface for which the newSuspect event is to be
generatedprivate boolean statusOK()
public void start()
start
in interface Fiber
java.lang.IllegalStateException
- Thrown if the fiber has already been started.public void pause()
pause
in interface PausableFiber
public void resume()
resume
in interface PausableFiber
public void stop()
Stops this fiber. If the fiber has never been started then an
IllegalStateExceptio
is generated.
stop
in interface Fiber
java.lang.IllegalStateException
- Thrown if the fiber has never been started.public java.lang.String getName()
getName
in interface Fiber
public int getStatus()
getStatus
in interface Fiber
public void run()
run
in interface java.lang.Runnable
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |