Is there a sample code somewhere for this? That would be a helpful reference.

Murali Natarajan
CIG TSS Admin Center Architecture 
312-954-1670
murali.natara...@jpmchase.com

-----Original Message-----
From: Mackay, Scott [mailto:scott.mac...@progeny.net] 
Sent: Tuesday, August 10, 2010 12:33 PM
To: Murali Natarajan
Cc: snmp4j@agentpp.org
Subject: RE: [SNMP4J] SNMP trap message parsing using SNMP4J APIs


Have you looked at the MessageProcessingModel (and MPv3,MPv1, MPv2c)?  There is 
a method prepareDataElements() which seems responsible for converting streams 
into the SNMP4j classes though I have not done that myself.

-Scott

-----Original Message-----
From: Murali Natarajan [mailto:murali.natara...@jpmchase.com]
Sent: Tue 8/10/2010 1:20 PM
To: Shlomo
Cc: Mackay, Scott; snmp4j@agentpp.org
Subject: RE: [SNMP4J] SNMP trap message parsing using SNMP4J APIs
 
Nope.

This part is being handled by another tool. It will receive the incoming trap 
and return a byte []. That is my starting point 1) to convert that into a trap 
object 2) extract details from there etc

Murali Natarajan
CIG TSS Admin Center Architecture
312-954-1670
murali.natara...@jpmchase.com<mailto:murali.natara...@jpmchase.com>

From: Shlomo [mailto:shl...@tikalk.com]
Sent: Tuesday, August 10, 2010 11:50 AM
To: Murali Natarajan
Cc: Mackay, Scott; snmp4j@agentpp.org
Subject: Re: [SNMP4J] SNMP trap message parsing using SNMP4J APIs

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.natara...@jpmchase.com<mailto:murali.natara...@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.natara...@jpmchase.com<mailto:murali.natara...@jpmchase.com>

-----Original Message-----
From: Mackay, Scott 
[mailto:scott.mac...@progeny.net<mailto:scott.mac...@progeny.net>]
Sent: Tuesday, August 10, 2010 4:23 AM
To: Murali Natarajan; snmp4j@agentpp.org<mailto:snmp4j@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-boun...@agentpp.org<mailto:snmp4j-boun...@agentpp.org> on behalf 
of Murali Natarajan
Sent: Mon 8/9/2010 3:56 PM
To: snmp4j@agentpp.org<mailto:snmp4j@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.natara...@jpmchase.com<mailto:murali.natara...@jpmchase.com><mailto:murali.natara...@jpmchase.com<mailto:murali.natara...@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@agentpp.org<mailto:SNMP4J@agentpp.org>
http://lists.agentpp.org/mailman/listinfo/snmp4j

_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org<mailto:SNMP4J@agentpp.org>
http://lists.agentpp.org/mailman/listinfo/snmp4j



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@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to