[SNMP4J] Question about identifying different traps
Deon van der Merwe
dvdm at truteq.co.za
Fri Dec 23 23:00:00 CET 2005
Hi Rabun,
Here is how we extract the OID from the CommandResponderEvent. We then use
the OID in a lottle lookup table in order to process it further...
protected void newTrap(
com.truteq.protocol.counter.snmp4j.Message aMessage) {
org.snmp4j.CommandResponderEvent vEvent = aMessage.getPDU();
org.snmp4j.PDU vPDU = vEvent.getPDU();
mLogger.information("Received new trap message from " +
vEvent.getPeerAddress() + ": " + vPDU);
for (int vIndex = 0; vIndex < vPDU.size(); ++vIndex) {
org.snmp4j.smi.VariableBinding vVB = vPDU.get(vIndex);
org.snmp4j.smi.OID vOID = vVB.getOid();
org.snmp4j.smi.Variable vVariable = vVB.getVariable();
mLogger.information("rcv: OID = " + vOID + " = " + vVariable);
}
}
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org
> [mailto:snmp4j-bounces at agentpp.org] On Behalf Of Rabun Jones
> Sent: Friday, December 23, 2005 15:50
> To: snmp4j at agentpp.org
> Subject: [SNMP4J] Question about identifying different traps
>
> If I send multiple trap messages to a single listener how does it know
> the difference between how to handle the messages. Is it the
> OID? If so
> how do I extract this information given a
> CommandResponderEvent? Thanks
> for all the help in advance guys.
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
More information about the SNMP4J
mailing list