[SNMP4J] SNMP trap message parsing using SNMP4J APIs

Shlomo shlomo at tikalk.com
Tue Aug 10 18:50:22 CEST 2010


Hi,
Is this what you need?

public void processPdu(
CommandResponderEvent e) {
         logger.debug("processPdu start ...");
         PDU command = e.getPDU();
         if (command != null) {
           System.out.println(command.toString());


On Tue, Aug 10, 2010 at 7:40 PM, Murali Natarajan <
murali.natarajan at jpmchase.com> wrote:

> Yes but in my case the difference is some other code (not the SNMP4J
> listeners) is receiving the incoming trap as a byte array. So I need to:
>
> 1. Convert this byte array to a trap object or a PDU; figure out what
> version etc in doing that conversion
> 2. Extract information from the trap object.
>
> It is for the step 1, I am looking for APIs in SNMP4J.
>
> Thanks.
>
> Murali Natarajan
> CIG TSS Admin Center Architecture
> 312-954-1670
> murali.natarajan at jpmchase.com
>
>
> -----Original Message-----
> From: Mackay, Scott [mailto:scott.mackay at progeny.net]
> Sent: Tuesday, August 10, 2010 4:23 AM
> To: Murali Natarajan; snmp4j at agentpp.org
> Subject: RE: [SNMP4J] SNMP trap message parsing using SNMP4J APIs
>
>
> A good method is following the steps used in the SnmpRequest.java from the
> source code.  The code is located in src/org/snmp4j/tools/console and is 1
> file.  As a note, if you are in that directory you can run the jarred
> version for comparison as: "java -cp ../../../../../dist/snmp4j-1.10.2.jar
> org.snmp4j/tools/console/SnmpRequest"
> You will notice there is an option, -Ol, which will listen for traps and
> such.  I would follow through the code on how that is set up, waited on, and
> processed.
>
>
> -Scott
>
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org on behalf of Murali Natarajan
> Sent: Mon 8/9/2010 3:56 PM
> To: snmp4j at agentpp.org
> Subject: (nwl)  [SNMP4J] SNMP trap message parsing using SNMP4J APIs
>
> Hi,
>
> I have an SNMP trap message being received as a byte array by an ESB tool.
> I am trying to understand how to parse and extract the trap message details
> (OIDs, their values, etc) from this byte array - using SNMP4J APIs.
>
> Is there a reference sample code available for this? If not, what are the
> specific APIs to use etc?
>
> Murali Natarajan
> CIG TSS Admin Center Architecture
> 312-954-1670
> murali.natarajan at jpmchase.com<mailto:murali.natarajan at jpmchase.com>
>
>
>
> This communication is for informational purposes only. It is not
> intended as an offer or solicitation for the purchase or sale of
> any financial instrument or as an official confirmation of any
> transaction. All market prices, data and other information are not
> warranted as to completeness or accuracy and are subject to change
> without notice. Any comments or statements made herein do not
> necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
> and affiliates.
>
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law. If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED. Although this transmission and any
> attachments are believed to be free of any virus or other defect
> that might affect any computer system into which it is received and
> opened, it is the responsibility of the recipient to ensure that it
> is virus free and no responsibility is accepted by JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable, for any loss
> or damage arising in any way from its use. If you received this
> transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard
> copy format. Thank you.
>
> Please refer to http://www.jpmorgan.com/pages/disclosures for
> disclosures relating to European legal entities.
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>



More information about the SNMP4J mailing list