From snmp-bounces@snmp.westhawk.co.uk  Mon Sep  8 12:59:23 2003
Return-Path: <snmp-bounces@snmp.westhawk.co.uk>
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h88BxNeZ001873
	for <birgit@incat.westhawk.co.uk>; Mon, 8 Sep 2003 12:59:23 +0100
Received: from snmp.westhawk.co.uk (snmp.westhawk.co.uk [192.67.4.68])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h88BxNN19348;
	Mon, 8 Sep 2003 12:59:23 +0100
Received: from [192.67.4.68] (localhost [127.0.0.1])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88BxHv11266;
	Mon, 8 Sep 2003 12:59:17 +0100 (BST)
Received: from gepetto.dc.luth.se (gepetto.dc.luth.se [130.240.42.40])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88BpQv11239
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 12:51:26 +0100 (BST)
Received: (from www-usr@localhost)
	by gepetto.dc.luth.se (8.12.5/8.12.5) id h88BpPBK027434;
	Mon, 8 Sep 2003 13:51:25 +0200 (MEST)
X-Authentication-Warning: gepetto.dc.luth.se: www-usr set sender to
	freisr-9@webmail.student.luth.se using -f
To: snmp@snmp.westhawk.co.uk
Message-ID: <1063021885.3f5c6d3dbd47d@webmail.student.luth.se>
Date: Mon, 08 Sep 2003 13:51:25 +0200 (MEST)
From: Fredrik Israelsson <freisr-9@student.luth.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: IMP/PHP IMAP webmail program 2.2.5
X-Mailman-Approved-At: Mon, 08 Sep 2003 12:59:14 +0100
Subject: [snmp] Decoding question
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Sender: snmp-bounces@snmp.westhawk.co.uk
Errors-To: snmp-bounces@snmp.westhawk.co.uk
X-Spam-Status: No, hits=-8.0 required=5.0
	tests=BAYES_01,USER_AGENT,X_AUTH_WARNING
	version=2.53
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
Status: RO
X-Status: A
Content-Length: 746
Lines: 17

Hello everybody!
I am a Westhawk SNMP stack newbie and I develope an application that includes 
an snmp trap listener that listens for all incoming snmp traps. 

I have a question of theoretical nature. Why don't the SnmpContext classes have 
a constructor that does not take any argument? I tested a bit, and did not see 
any reason why I can't use the same context, created with "new SnmpContext("any 
valid ip address",any_port) and let it decode all the undecoded incoming SNMPv1 
traps? Am I missing something here, or is it possible to do so, without 
complications?

Best regards
Fredrik Israelsson
_______________________________________________
snmp mailing list
snmp@snmp.westhawk.co.uk
http://snmp.westhawk.co.uk/mailman/listinfo/snmp

From snmp-bounces@snmp.westhawk.co.uk  Mon Sep  8 13:31:39 2003
Return-Path: <snmp-bounces@snmp.westhawk.co.uk>
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h88CVceZ002562
	for <birgit@incat.westhawk.co.uk>; Mon, 8 Sep 2003 13:31:38 +0100
Received: from snmp.westhawk.co.uk (snmp.westhawk.co.uk [192.67.4.68])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h88CVYN19459;
	Mon, 8 Sep 2003 13:31:34 +0100
Received: from [192.67.4.68] (localhost [127.0.0.1])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88CVSv11287;
	Mon, 8 Sep 2003 13:31:28 +0100 (BST)
Received: from way.westhawk.co.uk (mailhost.westhawk.co.uk [192.67.4.187])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88CVOv11279
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 13:31:24 +0100 (BST)
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h88CVNN19455
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 13:31:23 +0100
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h88CVNeZ002553
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 13:31:23 +0100
Received: (from birgit@localhost)
	by incat.westhawk.co.uk (8.12.8/8.12.8/Submit) id h88CVN4B002551
	for snmp@snmp.westhawk.co.uk; Mon, 8 Sep 2003 13:31:23 +0100
Date: Mon, 8 Sep 2003 13:31:23 +0100
From: Birgit Arkesteijn <birgit@westhawk.co.uk>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: [snmp] Re: Decoding question
Message-ID: <20030908123122.GA1258@westhawk.co.uk>
References: <1063021885.3f5c6d3dbd47d@webmail.student.luth.se>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1063021885.3f5c6d3dbd47d@webmail.student.luth.se>
User-Agent: Mutt/1.4.1i
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Sender: snmp-bounces@snmp.westhawk.co.uk
Errors-To: snmp-bounces@snmp.westhawk.co.uk
X-Spam-Status: No, hits=-45.1 required=5.0
	tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
	      REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_LONG_DENSE,
	      USER_AGENT_MUTT
	autolearn=ham version=2.53
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
Status: RO
Content-Length: 2837
Lines: 71

Dear Fredrik,

I agree that the SnmpContext is not very well balanced for trap listener
applications. The stack was originally written for manager applications
and traps were added later. For that reason each SnmpContext needs a
host and port number.

Although your solution might work for SNMPv1 and SNMPv2c, it does not
work for SNMPv3, due to the number of parameters (authentication and
privacy) that you need to decode a message. 

Your solution implies that you do not want to do any checking on  
the trap packet. The IP Address and community name are completely ignored. 
It is subject to debate whether this is correct or not. It might be easy
programming, but I (personally) do think it is wrong. I admit SNMPv1 and 
v2c are not very secure anyway; it only has the community name. 
I don't know either how your application could be affected by a 'false'
trap packet.

We have been debating how to improve the stack when it comes to
listening from incoming packets (both traps and requests). We are not sure
yet how, but it would be nice to be able to configure hostnames and/or
community names that are accepted. 

This requires a whole different setup, specially if it has got to work 
for SNMPv3 as well. Since paid projects have a higher priority, this
might take some time.


I know that none of the above will help you right now. The Stack Usage 
(html) document describes how to receive all incoming traps. If you still 
want to accept every trap packet that comes your way, you can copy 
bits and pieces from the stack source code and write your own context 
that does implements processIncomingTrap(byte[] message).

Cheers, Birgit



On Mon, Sep 08, 2003 at 01:51:25PM +0200, Fredrik Israelsson wrote:
> Hello everybody!
>
> I am a Westhawk SNMP stack newbie and I develop an application that includes 
> an SNMP trap listener that listens for all incoming SNMP traps. 
> 
> I have a question of theoretical nature. Why don't the SnmpContext classes 
> have 
> a constructor that does not take any argument? I tested a bit, and did not 
> see 
> any reason why I can't use the same context, created with "new SnmpContext("any 
> valid IP address",any_port) and let it decode all the undecoded incoming 
> SNMPv1 
> traps? Am I missing something here, or is it possible to do so, without 
> complications?
> 
> Best regards
> Fredrik Israelsson
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>
_______________________________________________
snmp mailing list
snmp@snmp.westhawk.co.uk
http://snmp.westhawk.co.uk/mailman/listinfo/snmp

From snmp-bounces@snmp.westhawk.co.uk  Mon Sep  8 14:31:21 2003
Return-Path: <snmp-bounces@snmp.westhawk.co.uk>
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h88DVLeZ003899
	for <birgit@incat.westhawk.co.uk>; Mon, 8 Sep 2003 14:31:21 +0100
Received: from snmp.westhawk.co.uk (snmp.westhawk.co.uk [192.67.4.68])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h88DVLN19657;
	Mon, 8 Sep 2003 14:31:21 +0100
Received: from [192.67.4.68] (localhost [127.0.0.1])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88DVFv11439;
	Mon, 8 Sep 2003 14:31:15 +0100 (BST)
Received: from il-tlv-smtpout2.icomverse.com (comversegw.icomverse.com
	[192.118.48.248])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88DOQv11410
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 14:24:31 +0100 (BST)
Received: from il-tlv-mbdg2.comverse.com (localhost.localdomain [127.0.0.1])
	by il-tlv-smtpout2.icomverse.com (8.11.6/8.11.6) with ESMTP id
	h88DOCa01115
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 16:24:12 +0300
Received: by il-tlv-mbdg2.comverse.com with Internet Mail Service (5.5.2655.55)
	id <SPYAG057>; Mon, 8 Sep 2003 16:24:20 +0300
Message-ID: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EADF@il-tlv-mail6.comverse.com>
From: Dori Yuval <Yuval.Dori@comverse.com>
To: "'snmp@snmp.westhawk.co.uk'" <snmp@snmp.westhawk.co.uk>
Date: Mon, 8 Sep 2003 16:24:18 +0300 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2655.55)
X-Mailman-Approved-At: Mon, 08 Sep 2003 14:31:12 +0100
Content-Type: text/plain
X-Content-Filtered-By: Mailman/MimeDel 2.1.2
Subject: [snmp] How to sent specific parameters with the trap ?
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Sender: snmp-bounces@snmp.westhawk.co.uk
Errors-To: snmp-bounces@snmp.westhawk.co.uk
X-Spam-Status: No, hits=-6.6 required=5.0
	tests=BAYES_01
	version=2.53
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
Status: RO
Content-Length: 683
Lines: 27

  
Hello SNMP team,
 
I want to send traps using SNMP v1,v2 and v3.
 
I managed to operate yours tests (uk.co.westhawk.examplev1.SendTrap.java,
uk.co.westhawk.examplev2c.SendTrap.java and
uk.co.westhawk.examplev3.SendTrap.java), 
 
but I don't know haw to send specific parameters (except for community) with
the trap using yours API.
 
I think it should be a method of SnmpContext class but I don't find it.
 
Can you help me with that ?
 
Thank you.
 
Yuval Dori
UMS - HMAP R&D, Comverse 
Phone: +972 (3) 766-9144
Mobile: +972 (58) 549144
 
_______________________________________________
snmp mailing list
snmp@snmp.westhawk.co.uk
http://snmp.westhawk.co.uk/mailman/listinfo/snmp

From birgit@westhawk.co.uk Mon Sep  8 14:47:21 2003
Received: from way.westhawk.co.uk (mailhost.westhawk.co.uk [192.67.4.187])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88DlLv11465
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 14:47:21 +0100 (BST)
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h88DlJN19693
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 14:47:19 +0100
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h88DlIeZ004247
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 14:47:18 +0100
Received: (from birgit@localhost)
	by incat.westhawk.co.uk (8.12.8/8.12.8/Submit) id h88DlIhI004245
	for snmp@snmp.westhawk.co.uk; Mon, 8 Sep 2003 14:47:18 +0100
Date: Mon, 8 Sep 2003 14:47:18 +0100
From: Birgit Arkesteijn <birgit@westhawk.co.uk>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] How to sent specific parameters with the trap ?
Message-ID: <20030908134718.GF1258@westhawk.co.uk>
References: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EADF@il-tlv-mail6.comverse.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EADF@il-tlv-mail6.comverse.com>
User-Agent: Mutt/1.4.1i
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 08 Sep 2003 13:47:23 -0000

Dear Yuval,

What do you mean with 'specific parameters'?
The 'community name' is not a PDU parameters, therefore we moved it
(long time ago) to the context.

Again, I don't understand your question, but I doubt that the
SnmpContext should have 'specific' PDU 'parameters'.


The SNMPv1 Trap format and the SNMPv2c (& v3) Trap format are different.

In Trapv1 you can use the following methods to set parameters:
  setEnterprise(java.lang.String var)
  setGenericTrap(int var)
  setIpAddress(byte[] var)
  setSpecificTrap(int var)
  setTimeTicks(long var)

There are no other 'parameters', but you can add varbinds to the varbind 
list (use addOid(xxx)).

In Trapv2 the first 2 OIDs are mandatory (see examplev2c.SendTrap or read 
the RFC), but you can add as many OIDs to the varbind list as you want.

Does this answer your question?

Regards, Birgit



On Mon, Sep 08, 2003 at 04:24:18PM +0300, Dori Yuval wrote:
>   
> Hello SNMP team,
>  
> I want to send traps using SNMP v1,v2 and v3.
>  
> I managed to operate yours tests (uk.co.westhawk.examplev1.SendTrap.java,
> uk.co.westhawk.examplev2c.SendTrap.java and
> uk.co.westhawk.examplev3.SendTrap.java), 
>  
> but I don't know haw to send specific parameters (except for community) with
> the trap using yours API.
>  
> I think it should be a method of SnmpContext class but I don't find it.
>  
> Can you help me with that ?
>  
> Thank you.
>  
> Yuval Dori
> UMS - HMAP R&D, Comverse 
> Phone: +972 (3) 766-9144
> Mobile: +972 (58) 549144
>  
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>

From Yuval.Dori@comverse.com Mon Sep  8 16:39:37 2003
Received: from il-tlv-smtpout2.icomverse.com (comversegw.icomverse.com
	[192.118.48.248])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h88Fdav11592
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 16:39:36 +0100 (BST)
Received: from il-tlv-mbdg1.comverse.com (localhost.localdomain [127.0.0.1])
	by il-tlv-smtpout2.icomverse.com (8.11.6/8.11.6) with ESMTP id
	h88FdOv12746
	for <snmp@snmp.westhawk.co.uk>; Mon, 8 Sep 2003 18:39:24 +0300
Received: by il-tlv-mbdg1.comverse.com with Internet Mail Service (5.5.2655.55)
	id <SPX8PSL8>; Mon, 8 Sep 2003 18:39:34 +0300
Message-ID: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EB0D@il-tlv-mail6.comverse.com>
From: Dori Yuval <Yuval.Dori@comverse.com>
To: "'List for discussion of the Westhawk SNMP stack'"
	<snmp@snmp.westhawk.co.uk>
Subject: RE: [snmp] How to sent specific parameters with the trap ?
Date: Mon, 8 Sep 2003 18:39:33 +0300 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2655.55)
X-Mailman-Approved-At: Mon, 08 Sep 2003 16:41:00 +0100
Content-Type: text/plain
X-Content-Filtered-By: Mailman/MimeDel 2.1.2
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 08 Sep 2003 15:39:39 -0000

Dear Birgit,

Yes I meant varbinds, thanks for the answer.




Yuval Dori
UMS - HMAP R&D, Comverse 
Phone: +972 (3) 766-9144
Mobile: +972 (58) 549144


-----Original Message-----
From: Birgit Arkesteijn [mailto:birgit@westhawk.co.uk] 
Sent: Monday, September 08, 2003 4:47 PM
To: List for discussion of the Westhawk SNMP stack
Subject: Re: [snmp] How to sent specific parameters with the trap ?


Dear Yuval,

What do you mean with 'specific parameters'?
The 'community name' is not a PDU parameters, therefore we moved it (long
time ago) to the context.

Again, I don't understand your question, but I doubt that the SnmpContext
should have 'specific' PDU 'parameters'.


The SNMPv1 Trap format and the SNMPv2c (& v3) Trap format are different.

In Trapv1 you can use the following methods to set parameters:
  setEnterprise(java.lang.String var)
  setGenericTrap(int var)
  setIpAddress(byte[] var)
  setSpecificTrap(int var)
  setTimeTicks(long var)

There are no other 'parameters', but you can add varbinds to the varbind 
list (use addOid(xxx)).

In Trapv2 the first 2 OIDs are mandatory (see examplev2c.SendTrap or read 
the RFC), but you can add as many OIDs to the varbind list as you want.

Does this answer your question?

Regards, Birgit



On Mon, Sep 08, 2003 at 04:24:18PM +0300, Dori Yuval wrote:
>   
> Hello SNMP team,
>  
> I want to send traps using SNMP v1,v2 and v3.
>  
> I managed to operate yours tests 
> (uk.co.westhawk.examplev1.SendTrap.java,
> uk.co.westhawk.examplev2c.SendTrap.java and
> uk.co.westhawk.examplev3.SendTrap.java), 
>  
> but I don't know haw to send specific parameters (except for 
> community) with the trap using yours API.
>  
> I think it should be a method of SnmpContext class but I don't find 
> it.
>  
> Can you help me with that ?
>  
> Thank you.
>  
> Yuval Dori
> UMS - HMAP R&D, Comverse
> Phone: +972 (3) 766-9144
> Mobile: +972 (58) 549144
>  
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk 
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>
_______________________________________________
snmp mailing list
snmp@snmp.westhawk.co.uk http://snmp.westhawk.co.uk/mailman/listinfo/snmp

From Yuval.Dori@comverse.com Tue Sep  9 09:47:18 2003
Received: from il-tlv-smtpout2.icomverse.com (comversegw.icomverse.com
	[192.118.48.248])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h898lGv11960
	for <snmp@snmp.westhawk.co.uk>; Tue, 9 Sep 2003 09:47:17 +0100 (BST)
Received: from il-tlv-mbdg2.comverse.com (localhost.localdomain [127.0.0.1])
	by il-tlv-smtpout2.icomverse.com (8.11.6/8.11.6) with ESMTP id
	h898l9L31932
	for <snmp@snmp.westhawk.co.uk>; Tue, 9 Sep 2003 11:47:09 +0300
Received: by il-tlv-mbdg2.comverse.com with Internet Mail Service (5.5.2655.55)
	id <SPYAH31L>; Tue, 9 Sep 2003 11:47:14 +0300
Message-ID: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EBA1@il-tlv-mail6.comverse.com>
From: Dori Yuval <Yuval.Dori@comverse.com>
To: "'snmp@snmp.westhawk.co.uk'" <snmp@snmp.westhawk.co.uk>
Date: Tue, 9 Sep 2003 11:47:12 +0300 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2655.55)
X-Mailman-Approved-At: Tue, 09 Sep 2003 09:53:02 +0100
Content-Type: text/plain
X-Content-Filtered-By: Mailman/MimeDel 2.1.2
Subject: [snmp] How to add varbinds with a String value ?
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Tue, 09 Sep 2003 08:47:19 -0000

Hello SNMP Team,
 
Can you please tell me how to add to OneTrapPduv1 and OneTrapPduv2 classes a
varbinds with a String value ?
 
Thanks.
 
 

From birgit@westhawk.co.uk Tue Sep  9 10:28:58 2003
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h899Svv12001
	for <snmp@snmp.westhawk.co.uk>; Tue, 9 Sep 2003 10:28:58 +0100 (BST)
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h899SvN23153
	for <snmp@snmp.westhawk.co.uk>; Tue, 9 Sep 2003 10:28:57 +0100
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h899SueZ029980
	for <snmp@snmp.westhawk.co.uk>; Tue, 9 Sep 2003 10:28:56 +0100
Received: (from birgit@localhost)
	by incat.westhawk.co.uk (8.12.8/8.12.8/Submit) id h899SuYn029978
	for snmp@snmp.westhawk.co.uk; Tue, 9 Sep 2003 10:28:56 +0100
Date: Tue, 9 Sep 2003 10:28:56 +0100
From: Birgit Arkesteijn <birgit@westhawk.co.uk>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] How to add varbinds with a String value ?
Message-ID: <20030909092856.GA29004@westhawk.co.uk>
References: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EBA1@il-tlv-mail6.comverse.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EBA1@il-tlv-mail6.comverse.com>
User-Agent: Mutt/1.4.1i
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Tue, 09 Sep 2003 09:29:00 -0000

Dear Dori,

Both classes extend the Pdu class, so you can use the Pdu.addOid(xx) 
methods. For example:
  addOid(java.lang.String oid, AsnObject val) 
  Strings are represented by AsnOctets.

However, how to use the addOid methods or how create a varbind with a 
String value should have been clear from the javadoc and the examples. 

Regards, Birgit


On Tue, Sep 09, 2003 at 11:47:12AM +0300, Dori Yuval wrote:
> Hello SNMP Team,
>  
> Can you please tell me how to add to OneTrapPduv1 and OneTrapPduv2 classes a
> varbinds with a String value ?
>  
> Thanks.
>  
>  
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>

From Yuval.Dori@comverse.com Tue Sep  9 11:14:11 2003
Received: from il-tlv-smtpout2.icomverse.com
	(il-tlv-firewall-main.icomverse.com [192.118.48.248])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h89AEAv12028
	for <snmp@snmp.westhawk.co.uk>; Tue, 9 Sep 2003 11:14:11 +0100 (BST)
Received: from il-tlv-mbdg2.comverse.com (localhost.localdomain [127.0.0.1])
	by il-tlv-smtpout2.icomverse.com (8.11.6/8.11.6) with ESMTP id
	h89AE1706168
	for <snmp@snmp.westhawk.co.uk>; Tue, 9 Sep 2003 13:14:01 +0300
Received: by il-tlv-mbdg2.comverse.com with Internet Mail Service (5.5.2655.55)
	id <SPYAHPQ7>; Tue, 9 Sep 2003 13:14:08 +0300
Message-ID: <380E8F36D3E4D5119F9B0002A5CE8F6A0602EBCB@il-tlv-mail6.comverse.com>
From: Dori Yuval <Yuval.Dori@comverse.com>
To: "'List for discussion of the Westhawk SNMP stack'"
	<snmp@snmp.westhawk.co.uk>
Subject: RE: [snmp] How to add varbinds with a String value ?
Date: Tue, 9 Sep 2003 13:14:07 +0300 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2655.55)
X-Mailman-Approved-At: Tue, 09 Sep 2003 11:21:02 +0100
Content-Type: text/plain
X-Content-Filtered-By: Mailman/MimeDel 2.1.2
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Tue, 09 Sep 2003 10:14:13 -0000

Thank you Birgit,

I'm sorry but the name of the class: AsnOctets
And the class Java doc: "The Java doc This class represents the ASN.1 Octet
class. It can be used for Octets, Ip Addresses and Opaque types".
Are not hint that you should use it on order to add varbind with String
value.

Anyway thanks for the prompt answer.

Yuval Dori


-----Original Message-----
From: Birgit Arkesteijn [mailto:birgit@westhawk.co.uk] 
Sent: Tuesday, September 09, 2003 12:29 PM
To: List for discussion of the Westhawk SNMP stack
Subject: Re: [snmp] How to add varbinds with a String value ?


Dear Dori,

Both classes extend the Pdu class, so you can use the Pdu.addOid(xx) 
methods. For example:
  addOid(java.lang.String oid, AsnObject val) 
  Strings are represented by AsnOctets.

However, how to use the addOid methods or how create a varbind with a 
String value should have been clear from the javadoc and the examples. 

Regards, Birgit


On Tue, Sep 09, 2003 at 11:47:12AM +0300, Dori Yuval wrote:
> Hello SNMP Team,
>  
> Can you please tell me how to add to OneTrapPduv1 and OneTrapPduv2 
> classes a varbinds with a String value ?
>  
> Thanks.
>  
>  
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk 
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>
_______________________________________________
snmp mailing list
snmp@snmp.westhawk.co.uk http://snmp.westhawk.co.uk/mailman/listinfo/snmp

From bruno.matringhen@free.fr Thu Sep 18 14:59:38 2003
Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8IDxbv16168
	for <snmp@snmp.westhawk.co.uk>; Thu, 18 Sep 2003 14:59:37 +0100 (BST)
Received: from imp2-a.free.fr (imp2-a.free.fr [213.228.0.80])
	by postfix4-2.free.fr (Postfix) with ESMTP id 33342C560
	for <snmp@snmp.westhawk.co.uk>; Thu, 18 Sep 2003 15:59:37 +0200 (CEST)
Received: by imp2-a.free.fr (Postfix, from userid 33)
	id 23E45F494; Thu, 18 Sep 2003 15:59:37 +0200 (MEST)
Received: from thon.cora.fr (thon.cora.fr [195.101.248.26]) 
	by imp2-a.free.fr (IMP) with HTTP 
	for <bruno.matringhen@imap.free.fr>; Thu, 18 Sep 2003 15:59:36 +0200
Message-ID: <1063893576.3f69ba48e2846@imp2-a.free.fr>
Date: Thu, 18 Sep 2003 15:59:36 +0200
From: bruno.matringhen@free.fr
To: snmp@snmp.westhawk.co.uk
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 3.2.1
X-Mailman-Approved-At: Thu, 18 Sep 2003 15:05:22 +0100
Subject: [snmp] draw 2 line with the visual package
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 18 Sep 2003 13:59:40 -0000

I use the package visual of the Westhawk's stack.
I would like to draw 2 line with the graph class.
I try to make the superposition of 2 Graph Jpanel but the background of the 
JPanel isn't transparent. So how could i make it transparent?
So it's may be possible to change the class graph to accept an array of 
GraphDataSet, because for the moment, it's a graph of ONE GraphDataSet.

Bruno Matringhen

From birgit@westhawk.co.uk Thu Sep 18 15:56:55 2003
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8IEusv16222
	for <snmp@snmp.westhawk.co.uk>; Thu, 18 Sep 2003 15:56:55 +0100 (BST)
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8IEusR13693
	for <snmp@snmp.westhawk.co.uk>; Thu, 18 Sep 2003 15:56:54 +0100
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h8IEureZ026829
	for <snmp@snmp.westhawk.co.uk>; Thu, 18 Sep 2003 15:56:53 +0100
Received: (from birgit@localhost)
	by incat.westhawk.co.uk (8.12.8/8.12.8/Submit) id h8IEuqI4026826
	for snmp@snmp.westhawk.co.uk; Thu, 18 Sep 2003 15:56:52 +0100
Date: Thu, 18 Sep 2003 15:56:52 +0100
From: Birgit Arkesteijn <birgit@westhawk.co.uk>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] draw 2 line with the visual package
Message-ID: <20030918145652.GA26518@westhawk.co.uk>
References: <1063893576.3f69ba48e2846@imp2-a.free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1063893576.3f69ba48e2846@imp2-a.free.fr>
User-Agent: Mutt/1.4.1i
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 18 Sep 2003 14:56:57 -0000

Dear Bruno,

The visual package? It is ages ago that we wrote it, and we have not
really used it since.

I'm afraid you are going to have to change the code, if you want the
graph to be transparent. You best read about Component.isOpaque() and 
JComponent.setOpaque(boolean isOpaque).

All the best, 
    Birgit

ps 
If you are going to make changes, please do not hesitate to email the
code back to us when you are happy with it. Please do email us 
personally (snmp@westhawk.co.uk), because the mailing list does not accept 
attachments.


On Thu, Sep 18, 2003 at 03:59:36PM +0200, bruno.matringhen@free.fr wrote:
> I use the package visual of the Westhawk's stack.
> I would like to draw 2 line with the graph class.
> I try to make the superposition of 2 Graph JPanel but the background of the 
> JPanel isn't transparent. So how could i make it transparent?
> So it's may be possible to change the class graph to accept an array of 
> GraphDataSet, because for the moment, it's a graph of ONE GraphDataSet.
> 
> Bruno Matringhen
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>

From thp@westhawk.co.uk Fri Sep 19 10:33:58 2003
Received: from way.westhawk.co.uk (mailhost.westhawk.co.uk [192.67.4.187])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8J9Xvv16583
	for <snmp@snmp.westhawk.co.uk>; Fri, 19 Sep 2003 10:33:57 +0100 (BST)
Received: from westhawk.co.uk (atuan.westhawk.co.uk [192.67.4.34])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8J9XvR16781;
	Fri, 19 Sep 2003 10:33:57 +0100
Message-ID: <3F6ACD85.3080302@westhawk.co.uk>
Date: Fri, 19 Sep 2003 10:33:57 +0100
From: Tim Panton <thp@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: snmp@snmp.westhawk.co.uk
References: <3F69DC25.802@westpoint.ltd.uk>
	<20030918163848.GC26518@westhawk.co.uk>
In-Reply-To: <20030918163848.GC26518@westhawk.co.uk>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: 
Subject: [snmp] Re: Requested change to error handling
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: snmp@snmp.westhawk.co.uk
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 19 Sep 2003 09:33:59 -0000

I've sent this message to the mailing list - hope that's ok.

I don't think Rich's solution will work as stated, because
in many situations there are many outstanding PDus, if
you can't decode the packet and read the pduid,
  then it isn't clear who to throw the exception to. The best
you can do is to narrow it down to the context.

We can either throw exceptions to all the inflight pdu's
in the context (overkill I'd say) or add a contextEvent
which is fired to all listeners when  a packet arrives
on our socket that we are not expecting or can't decode.

(see inline comments below)

Birgit Arkesteijn wrote:
> Haie Rich,
> 
> For the time being, please replace AsnDecoder.getAsnSequence() by:
> 
> /**
>  * Reads the input into an asn sequence.
>  */
> AsnSequence getAsnSequence(InputStream in)
> throws IOException, DecodingException
> {
>     AsnSequence asnTopSeq = null;
>     AsnSequence dummy = new AsnSequence();
>     AsnObject obj = dummy.AsnReadHeader(in);
>     if (obj instanceof AsnSequence)
>     {
>         asnTopSeq = (AsnSequence) obj;
>     }
>     else
>     {
>         String msg = "AsnSequence was expected"
>             + " instead of " + obj.getRespTypeString();
>         throw new DecodingException(msg);
>     }
>     return asnTopSeq;
> }
> 

Won't this get caught in the main run() of the rcv thread?
I thought we put a generic catch there to stop the
Fin's stack tester blowing us up.

> 
> 
> On Thu, Sep 18, 2003 at 05:24:05PM +0100, Richard Moore wrote:
> 
>>The current implementation of the stack handles situations where a host 
>>returns non-ASN.1 data by an internal ClassCastException which is then 
>>caught by AbstractSnmpContext.run() in its catch ( Exception ) 
>>statement. This means it isn't possible for me to report that a packet 
>>was received but that it was totally invalid. This can be demonstrated 
>>by connecting to a box that is using netcat to respond on port 161 with 
>>something like this:
>>
>>echo test | nc -u -l -p 161

Naah, it can't.
There are 2 cases:
	1) Listening for Traps - you'd be right there -
except that it is 162, and the whole trap infrastructure
uses listeners and events, not update, and no one _ever_
blocks waiting for a trap. If we get a packet to 162 we can't decode
we just drop it (I think).

	2) Listening for a reply to a set or get request we
sent to an agent - Here the port we are listening on is a High
numbered port, specific to the agent host. You'd have to send a
to do your netcat with the right port number and get in
before the _real_ answer has been received. What's more
I think you'd have to run the netcat on the agent system,
and set the source port to 161!

>>
>>A solution to this problem that springs to mind is to add an addition 
>>public static flag to one of the classes in the stack that specifies 
>>whether the stack should catch the generic Exception class or whether it 
>>should allow it to propogate to the calling application (by rethrowing 
>>it possibly inside a wrapper exception class). The default would 
>>obviously be to retain the current behaviour for compatibility with 
>>existing code.

I think you need to concider what it is you really want to achive
here...

>>
>>Cheers
>>
>>Rich.
>>
> 
> 
T.


From thomas.natterer@thalesatm.com Fri Sep 19 14:03:17 2003
Received: from GWOUT.thalesgroup.com (gwout.thalesgroup.com [195.101.39.227])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8JD2wv16656
	for <snmp@snmp.westhawk.co.uk>; Fri, 19 Sep 2003 14:03:01 +0100 (BST)
Received: from thalescan.corp.thales (200.3.2.3) by GWOUT.thalesgroup.com
	(NPlex 6.5.026) id 3F4C863C001738D3 for snmp@snmp.westhawk.co.uk;
	Fri, 19 Sep 2003 15:05:44 +0200
Received: from atmdeplex.de.tatm.thales ([10.33.11.7]) by thalescan with
	InterScan Messaging Security Suite; Fri, 19 Sep 2003 15:02:48 +0200
Received: from thalesatm.com (149.204.178.103) by atmdeplex.de.tatm.thales
	(NPlex 6.5.026) (authenticated as thomas.natterer@thalesatm.com)
	id 3F61605E0000243F for snmp@snmp.westhawk.co.uk;
	Fri, 19 Sep 2003 15:04:49 +0200
Sender: natterer@snmp.westhawk.co.uk
Message-ID: <3F6AFE77.C23DB445@thalesatm.com>
Date: Fri, 19 Sep 2003 15:02:47 +0200
From: Thomas Natterer <thomas.natterer@thalesatm.com>
Organization: THALES ATM
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.16 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: snmp@snmp.westhawk.co.uk
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailman-Approved-At: Fri, 19 Sep 2003 14:34:41 +0100
Subject: [snmp] Agent Discovery, SnmpEngineId
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 19 Sep 2003 13:03:19 -0000

Hello SNMP team,

I have a question to dicovery the snmp engine id.

As the documentation describes, the class SnmpContextv3
performs discovery of the SnmpEngineId.
I use the example uk.co.westhawk.examplev3.get_next.java.

* If I configure the correct SnmpEngineId in the property file
  the example works fine.
* If I configure no SnmpEngineId in the property file I get
  an exception (See debug output below)
* If I configure a wrong SnmpEngineId in the property file I get
  an endless loop with response of variable 
  snmpProxyDrops (1.3.6.1.6.3.11.2.1.2.0)
  (See debug output below)

************************************************
> runapplication.sh get_next
Util(): Using properties file 'get_next.properties'.
Starting discovery Engine ID ...
 
TimeWindow.setSnmpEngineId(): host slsrx9, port 4702, snmpEngineId
8000137005736C73727839125E
 
TimeWindow.setTimeLine(): snmpEngineId 8000137005736C73727839125E, node
uk.co.westhawk.snmp.stack.TimeWindowNode[engineId=8000137005736C73727839125E,
engineBoots=3, engineTime=86369, latestReceivedEngineTime=86369]
(Complex) pass to key takes 1.718
uk.co.westhawk.snmp.stack.DecodingException: User MD5 does support
authentication, but received message without authentication:
1.3.6.1.6.3.11.2.1.2.0: 78
        at
uk.co.westhawk.snmp.stack.AsnDecoder.processSNMPv3(AsnDecoder.java:400)
        at
uk.co.westhawk.snmp.stack.SnmpContextv3.ProcessIncomingMessage(SnmpContextv3.java:645)
        at
uk.co.westhawk.snmp.stack.AbstractSnmpContext.run(AbstractSnmpContext.java:495)
        at java.lang.Thread.run(Thread.java:536)
PduException: User MD5 does support authentication, but received message
without authentication: 1.3.6.1.6.3.11.2.1.2.0: 78 

**************************************************
slsmgr: >runapplication.sh get_next

Util(): Using properties file 'get_next.properties'.
Starting discovery Engine ID ...

TimeWindow.setSnmpEngineId(): host slsrx9, port 4702, snmpEngineId
8000137005736C73727839125E

TimeWindow.setTimeLine(): snmpEngineId 8000137005736C73727839125E, node
uk.co.westhawk.snmp.stack.TimeWindowNode[engineId=8000137005736C73727839125E,
e
ngineBoots=3, engineTime=92119, latestReceivedEngineTime=92119]
(Complex) pass to key takes 1.26
1.3.6.1.2.1.11.32.0: 2883
1.3.6.1.2.1.11.32.0: 2884
1.3.6.1.2.1.11.32.0: 2885
1.3.6.1.2.1.11.32.0: 2886
1.3.6.1.2.1.11.32.0: 2887
1.3.6.1.2.1.11.32.0: 2888
1.3.6.1.2.1.11.32.0: 2889
1.3.6.1.2.1.11.32.0: 2890
...
*********************************************************

I see both times at the debug output that the correct snmpEngineId is
discovered from the agent. But I don't understand why I get
an excpetion and on the other hand the variable snmpProxyDrops.


Any comments are welcome.

Best regards
T.Natterer

P.S.: Is there a way to get older archives than September 2003.
That would be an interesting knowledge base for Westhawk SNMP user.

From birgit@westhawk.co.uk Mon Sep 22 11:34:16 2003
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8MAYGv17908
	for <snmp@snmp.westhawk.co.uk>; Mon, 22 Sep 2003 11:34:16 +0100 (BST)
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8MAYGR02966
	for <snmp@snmp.westhawk.co.uk>; Mon, 22 Sep 2003 11:34:16 +0100
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h8MAYCiq017279
	for <snmp@snmp.westhawk.co.uk>; Mon, 22 Sep 2003 11:34:12 +0100
Received: (from birgit@localhost)
	by incat.westhawk.co.uk (8.12.8/8.12.8/Submit) id h8MAYCm0017277
	for snmp@snmp.westhawk.co.uk; Mon, 22 Sep 2003 11:34:12 +0100
Date: Mon, 22 Sep 2003 11:34:11 +0100
From: Birgit Arkesteijn <birgit@westhawk.co.uk>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] Agent Discovery, SnmpEngineId
Message-ID: <20030922103411.GA15015@westhawk.co.uk>
References: <3F6AFE77.C23DB445@thalesatm.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3F6AFE77.C23DB445@thalesatm.com>
User-Agent: Mutt/1.4.1i
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 22 Sep 2003 10:34:18 -0000

Dear Thomas,

You are confusing two types of engine IDs. There is the 'contextEngineID' 
and the 'snmpEngineID'.
As the word 'discovery' says: the snmpEngineID is discovered, and
therefore NOT configured!

Your output below show no problem with discovery. In both cases the
timeline is set just fine.

In other words, this email is about misconfiguration of the
contextEngineID.

** I'm addressing the whole mailing list now .. **
SNMPv3 is difficult, please read up on it!!


** Re 'no' contextEngineID:
Note that even when you do not configure a contextEngineID, the
SNMPv3Context will fill in a default of 'byte[0]'.

Your context (user MD5) is configured to use authentication.
Because the authoritative engine found a fault with the message, it can 
only send a response back without authentication and privacy.
Our stack fails to decode the message, because it does not match the context, 
so you get a decoding exception.
BTW:
OID 1.3.6.1.6.3.11.2.1.2.0 = snmpInvalidMsgs.0 


** Re the endless loop (wrong contextEngineID):
> 1.3.6.1.2.1.11.32.0: 2890
> ...
(snmpProxyDrops = 1.3.6.1.2.1.11.32)

The mib (see module SNMPv2-MIB) says (as you could have found out 
searching the web):

snmpProxyDrops OBJECT-TYPE
    SYNTAX     Counter32
    MAX-ACCESS read-only
    STATUS     current
    DESCRIPTION
            "The total number of GetRequest-PDUs, GetNextRequest-PDUs,
            GetBulkRequest-PDUs, SetRequest-PDUs, and InformRequest-PDUs
            delivered to the SNMP entity which were silently dropped
            because the transmission of the (possibly translated)
            message to a proxy target failed in a manner (other than a
            time-out) such that no Response-PDU could be returned."
    ::= { snmp 32 }

so apparently every PDU you send is dropped. That is why there comes 
no end to this get_next loop.


Please realise that the stack is not responsible for the way the 
authoritative engine handles incoming requests.
You are responsible for the correct parameters in SNMPv3. You should not 
be surprised it does not work when you use a wrong one.


** Re the archive:
We've only started this mailing list, so that is all the archive there
is. Hopefully it will grow rapidly. :-)


Hope this helps, Birgit



> Hello SNMP team,
> 
> I have a question to discovery the snmp engine id.
> 
> As the documentation describes, the class SnmpContextv3
> performs discovery of the SnmpEngineId.
> I use the example uk.co.westhawk.examplev3.get_next.java.
> 
> * If I configure the correct SnmpEngineId in the property file
>   the example works fine.
> * If I configure no SnmpEngineId in the property file I get
>   an exception (See debug output below)
> * If I configure a wrong SnmpEngineId in the property file I get
>   an endless loop with response of variable 
>   snmpProxyDrops (1.3.6.1.6.3.11.2.1.2.0)
>   (See debug output below)
> 
> ************************************************
> runapplication.sh get_next
> Util(): Using properties file 'get_next.properties'.
> Starting discovery Engine ID ...
>  
> TimeWindow.setSnmpEngineId(): host slsrx9, port 4702, snmpEngineId
> 8000137005736C73727839125E
>  
> TimeWindow.setTimeLine(): snmpEngineId 8000137005736C73727839125E, node
> uk.co.westhawk.snmp.stack.TimeWindowNode[engineId=8000137005736C73727839125E,
> engineBoots=3, engineTime=86369, latestReceivedEngineTime=86369]
> (Complex) pass to key takes 1.718
> uk.co.westhawk.snmp.stack.DecodingException: User MD5 does support
> authentication, but received message without authentication:
> 1.3.6.1.6.3.11.2.1.2.0: 78
>         at
> uk.co.westhawk.snmp.stack.AsnDecoder.processSNMPv3(AsnDecoder.java:400)
>         at
> uk.co.westhawk.snmp.stack.SnmpContextv3.ProcessIncomingMessage(SnmpContextv3.java:645)
>         at
> uk.co.westhawk.snmp.stack.AbstractSnmpContext.run(AbstractSnmpContext.java:495)
>         at java.lang.Thread.run(Thread.java:536)
> PduException: User MD5 does support authentication, but received message
> without authentication: 1.3.6.1.6.3.11.2.1.2.0: 78 
> 
> **************************************************
> slsmgr: >runapplication.sh get_next
> 
> Util(): Using properties file 'get_next.properties'.
> Starting discovery Engine ID ...
> 
> TimeWindow.setSnmpEngineId(): host slsrx9, port 4702, snmpEngineId
> 8000137005736C73727839125E
> 
> TimeWindow.setTimeLine(): snmpEngineId 8000137005736C73727839125E, node
> uk.co.westhawk.snmp.stack.TimeWindowNode[engineId=8000137005736C73727839125E,
> engineBoots=3, engineTime=92119, latestReceivedEngineTime=92119]
> (Complex) pass to key takes 1.26
> 1.3.6.1.2.1.11.32.0: 2883
> 1.3.6.1.2.1.11.32.0: 2884
> 1.3.6.1.2.1.11.32.0: 2885
> 1.3.6.1.2.1.11.32.0: 2886
> 1.3.6.1.2.1.11.32.0: 2887
> 1.3.6.1.2.1.11.32.0: 2888
> 1.3.6.1.2.1.11.32.0: 2889
> 1.3.6.1.2.1.11.32.0: 2890
> ...
> *********************************************************
> 
> I see both times at the debug output that the correct snmpEngineId is
> discovered from the agent. But I don't understand why I get
> an exception and on the other hand the variable snmpProxyDrops.
> 
> 
> Any comments are welcome.
> 
> Best regards
> T.Natterer
> 
> P.S.: Is there a way to get older archives than September 2003.
> That would be an interesting knowledge base for Westhawk SNMP user.
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>

From bruno.matringhen@free.fr Tue Sep 23 07:25:40 2003
Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8N6Pev18263
	for <snmp@snmp.westhawk.co.uk>; Tue, 23 Sep 2003 07:25:40 +0100 (BST)
Received: from imp2-a.free.fr (imp2-a.free.fr [213.228.0.80])
	by postfix4-2.free.fr (Postfix) with ESMTP id F2340C175
	for <snmp@snmp.westhawk.co.uk>; Tue, 23 Sep 2003 08:25:38 +0200 (CEST)
Received: by imp2-a.free.fr (Postfix, from userid 33)
	id EA5A8FBB8; Tue, 23 Sep 2003 08:25:38 +0200 (MEST)
Received: from thon.cora.fr (thon.cora.fr [195.101.248.26]) 
	by imp2-a.free.fr (IMP) with HTTP 
	for <bruno.matringhen@imap.free.fr>; Tue, 23 Sep 2003 08:25:38 +0200
Message-ID: <1064298338.3f6fe762cd03c@imp2-a.free.fr>
Date: Tue, 23 Sep 2003 08:25:38 +0200
From: bruno.matringhen@free.fr
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] draw 2 line with the visual package
References: <1063893576.3f69ba48e2846@imp2-a.free.fr>
	<20030918145652.GA26518@westhawk.co.uk>
In-Reply-To: <20030918145652.GA26518@westhawk.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 3.2.1
X-Mailman-Approved-At: Tue, 23 Sep 2003 10:05:45 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Tue, 23 Sep 2003 06:25:42 -0000

Dear Birgit,

I've modify the classes BareGraph and Graph, and now I can draw 2 lines.

All the best, 
Bruno

From thp@westhawk.co.uk Fri Sep 26 10:50:20 2003
Received: from way.westhawk.co.uk (mailhost.westhawk.co.uk [192.67.4.187])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8Q9oKv19603
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 10:50:20 +0100 (BST)
Received: from westhawk.co.uk (atuan.westhawk.co.uk [192.67.4.34])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8Q9oDR20051;
	Fri, 26 Sep 2003 10:50:13 +0100
Message-ID: <3F740BD5.4000109@westhawk.co.uk>
Date: Fri, 26 Sep 2003 10:50:13 +0100
From: Tim Panton <thp@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: James Pifer <jpifer@obrien-pifer.com>
References: <000601c38395$4fb9d390$3301a8c0@JEP1250>
In-Reply-To: <000601c38395$4fb9d390$3301a8c0@JEP1250>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: snmp@snmp.westhawk.co.uk
Subject: [snmp] Re: Decoding Traps
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 26 Sep 2003 09:50:22 -0000

Hi James,
	we have recently started a mailing list,
(snmp@snmp.westhawk.co.uk) where we are hoping to try and
build up a bit of a community (and an archive of useful
emails.)

Would you mind subscribing to the list and asking the question again?
(I'll use the time to draft a reply :-) )

That way it will get into the list archives.

Thanks.

Tim.

James Pifer wrote:
> Hi Tim. Wondering if I could get a little assistance with your SNMP
> stack. I'm using your example code for ReceiveTrap and the traps all
> come in undecoded so I'm trying to undecode them. 
> 
> I'm trying to follow the documentation which says to create a context
> and then: Pdu trapPdu = context.processIncomingTrap(byte[ ] message)
> 
> I was trying to make this a part of the following else in TrapReceive: 
> else 
> { 
> int version = evt.getVersion(); 
> String host = evt.getHostAddress(); 
> System.out.println("ReceiveTrap.trapReceived():" + " received undecoded
> trap v " + version + " from host " + host); 
> }
> 
> Quite frankly I'm not sure how to do it. So far I've been unsuccesful
> trying to use the examples and javadocs. I tried creating the context by
> adding this:
>       SnmpContextBasisFace context = trapPdu.getContext();
> 
> But I don't see how or where to use this one (from the documentation)
> for getting the info out of the trap:
> 	trapPdu = context.processIncomingTrap(byte[ ] message);
> 
> If you can give me any help that would be great. 
> 
> Thanks,
> James
> 


From jep@obrien-pifer.com Fri Sep 26 13:23:49 2003
Received: from sammy.tnjinfl.com (obrien-pifer.com [24.73.99.190])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QCNmv19675
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 13:23:48 +0100 (BST)
Received: from tweety.tnjinfl.com ([192.168.1.20])
	by sammy.tnjinfl.com (8.12.8/8.12.8) with ESMTP id h8QCNa2o007829
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 08:23:36 -0400
From: James Pifer <jep@obrien-pifer.com>
To: SNMP <snmp@snmp.westhawk.co.uk>
Content-Type: text/plain
Message-Id: <1064579173.18190.95.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.0 
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-7.4, required 4,
	BAYES_10, USER_AGENT_XIMIAN)
X-Mailman-Approved-At: Fri, 26 Sep 2003 14:12:56 +0100
Subject: [snmp] Decoding Traps Help
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Date: Fri, 26 Sep 2003 12:23:51 -0000
X-Original-Date: 26 Sep 2003 08:26:13 -0400
X-List-Received-Date: Fri, 26 Sep 2003 12:23:51 -0000

I was hoping to get some help from the list. I'm trying to create a
trapd service for collecting my company's traps. Most of the apps out
there, like OpenNMS, do not support de-duplication of traps, which is
something I definitely need. 

-So my plan was to first get something where I'm collecting the traps
and decoding them. 
-Once they are decoded, then I want to somehow run them against the MIBs
to make them more readable.
-Then deal with the other stuff, like how to de-duplicate, how/where to
store, probably need threading, etc. 

I'm not great at reading javadocs. I'm following the documentation and
trying to use the examples. I have the TrapReceive working but it
doesn't decode anything. The documentation says to create a context
and then: Pdu trapPdu = context.processIncomingTrap(byte[ ] message)

I was trying to make this a part of the following else in TrapReceive: 
else 
{ 
int version = evt.getVersion(); 
String host = evt.getHostAddress(); 
System.out.println("ReceiveTrap.trapReceived():" + " received undecoded
trap v " + version + " from host " + host); 
}

Quite frankly I'm not sure how to do it. So far I've been unsuccesful
trying to use the examples and javadocs. I tried creating the context by
adding this:
      SnmpContextBasisFace context = trapPdu.getContext();

But I don't see how or where to use this one (from the documentation)
for getting the info out of the trap:
	trapPdu = context.processIncomingTrap(byte[ ] message);

I'm also having trouble with the Util class. Whenever I try to use it like:
private Util util; 
the compiler says it can't find it. I have Util.java compiled and in the 
classpath.

Any help is appreciated.  

Thanks,
James


From thp@westhawk.co.uk Fri Sep 26 14:24:22 2003
Received: from way.westhawk.co.uk (mailhost.westhawk.co.uk [192.67.4.187])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QDOMv19723
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 14:24:22 +0100 (BST)
Received: from westhawk.co.uk (atuan.westhawk.co.uk [192.67.4.34])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8QDOMR20611
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 14:24:22 +0100
Message-ID: <3F743E05.4080300@westhawk.co.uk>
Date: Fri, 26 Sep 2003 14:24:21 +0100
From: Tim Panton <thp@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] Decoding Traps Help
References: <1064579173.18190.95.camel@tweety.tnjinfl.com>
In-Reply-To: <1064579173.18190.95.camel@tweety.tnjinfl.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 26 Sep 2003 13:24:24 -0000



James Pifer wrote:

> I was hoping to get some help from the list. I'm trying to create a
> trapd service for collecting my company's traps. Most of the apps out
> there, like OpenNMS, do not support de-duplication of traps, which is
> something I definitely need. 
> 
> -So my plan was to first get something where I'm collecting the traps
> and decoding them. 
> -Once they are decoded, then I want to somehow run them against the MIBs
> to make them more readable.

I should warn you we don't really have any significant MIB support
in the stack.

> -Then deal with the other stuff, like how to de-duplicate, how/where to
> store, probably need threading, etc. 

Generally we take care of most of the threading in the stack.

> 
> I'm not great at reading javadocs. I'm following the documentation and
> trying to use the examples. I have the TrapReceive working but it
> doesn't decode anything. The documentation says to create a context
> and then: Pdu trapPdu = context.processIncomingTrap(byte[ ] message)
> 
> I was trying to make this a part of the following else in TrapReceive: 
> else 
> { 
> int version = evt.getVersion(); 
> String host = evt.getHostAddress(); 
> System.out.println("ReceiveTrap.trapReceived():" + " received undecoded
> trap v " + version + " from host " + host); 
> }

Ok, I can see that we could usefully improve this example, something 
like (untested) :
    else
     {
         int version = evt.getVersion();
         String host = evt.getHostAddress();
         System.out.println("ReceiveTrap.trapReceived():"
             + " received undecoded trap v " + version
             + " from host " + host);
       // should really do a switch on version....
         try {
           // make a context which matches the unexpected trap.
           SnmpContextBasisFace tmpcont
              = new SnmpContext(host,context.getPort(),
                                context.getTypeSocket());
           byte[] mess = evt.getMessage();
           // and get it to decode the thing.
           Pdu got = tmpcont.processIncomingTrap(mess);
           System.out.println(
             "got unexpected trap from "+host+" :"+got.toString());
           tmpcont.destroy();
         } catch (Exception x) {
            x.printStackTrace();
         }
     }


so what you need to do is :
	1) create a temp context that matches the trap you have.
	2) extract the data from the event
	3) get the context to decode it
	4) dispose of the context.

- If you know that the traps will come from a smallish set of
hosts you could improve this by using a contextpool.

> 
> Quite frankly I'm not sure how to do it. So far I've been unsuccesful
> trying to use the examples and javadocs. I tried creating the context by
> adding this:
>       SnmpContextBasisFace context = trapPdu.getContext();
> 
> But I don't see how or where to use this one (from the documentation)
> for getting the info out of the trap:
> 	trapPdu = context.processIncomingTrap(byte[ ] message);
> 
> I'm also having trouble with the Util class. Whenever I try to use it like:
> private Util util; 
> the compiler says it can't find it. I have Util.java compiled and in the 
> classpath.

Thats odd. Any other clues?

> 
> Any help is appreciated.  
> 
> Thanks,
> James
> 
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> 


From andy@riftware.com Fri Sep 26 16:12:13 2003
Received: from sn1.cwihosting.com ([66.216.127.19])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QFCCv19764
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 16:12:12 +0100 (BST)
Received: from adsl-66.218.47.238.dslextreme.com ([66.218.47.238]
	helo=andydev4) by sn1.cwihosting.com with asmtp (Exim 4.23)
	id 1A2uGQ-0007Xv-SQ
	for snmp@snmp.westhawk.co.uk; Fri, 26 Sep 2003 10:12:11 -0500
From: "Andrew Chandler" <andy@riftware.com>
To: "'List for discussion of the Westhawk SNMP stack'"
	<snmp@snmp.westhawk.co.uk>
Subject: RE: [snmp] Decoding Traps Help
Date: Fri, 26 Sep 2003 08:12:07 -0700
Message-ID: <004101c38440$8ea5cdb0$0400a8c0@andydev4>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.4510
In-Reply-To: <3F743E05.4080300@westhawk.co.uk>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
X-AntiAbuse: This header was added to track abuse,
	please include it with any abuse report
X-AntiAbuse: Primary Hostname - sn1.cwihosting.com
X-AntiAbuse: Original Domain - snmp.westhawk.co.uk
X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12]
X-AntiAbuse: Sender Address Domain - riftware.com
X-Mailman-Approved-At: Fri, 26 Sep 2003 16:30:02 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 26 Sep 2003 15:12:15 -0000


I know you said its in the class path but did you remember to import that
particular package?
> > I'm also having trouble with the Util class. Whenever I try 
> to use it 
> > like: private Util util; the compiler says it can't find it. I have 
> > Util.java compiled and in the classpath.
> 
> Thats odd. Any other clues?
> 
> > 
> > Any help is appreciated.
> > 
> > Thanks,
> > James
> > 
> > _______________________________________________
> > snmp mailing list
> > snmp@snmp.westhawk.co.uk 
> > http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> > 
> 
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk 
> http://snmp.westhawk.co.uk/mailman/listinfo/sn> mp
> 
> 


From jep@obrien-pifer.com Fri Sep 26 16:51:16 2003
Received: from sammy.tnjinfl.com (obrien-pifer.com [24.73.99.190])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QFpFv19801
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 16:51:15 +0100 (BST)
Received: from tweety.tnjinfl.com ([192.168.1.20])
	by sammy.tnjinfl.com (8.12.8/8.12.8) with ESMTP id h8QFod2o012085
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 11:50:39 -0400
Subject: RE: [snmp] Decoding Traps Help
From: James Pifer <jep@obrien-pifer.com>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
In-Reply-To: <004101c38440$8ea5cdb0$0400a8c0@andydev4>
References: <004101c38440$8ea5cdb0$0400a8c0@andydev4>
Content-Type: text/plain
Message-Id: <1064591598.18182.102.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.0 
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-9.4, required 4,
	BAYES_01, EMAIL_ATTRIBUTION, IN_REP_TO, QUOTED_EMAIL_TEXT,
	REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_XIMIAN)
X-Mailman-Approved-At: Fri, 26 Sep 2003 17:04:49 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Date: Fri, 26 Sep 2003 15:51:18 -0000
X-Original-Date: 26 Sep 2003 11:53:18 -0400
X-List-Received-Date: Fri, 26 Sep 2003 15:51:18 -0000

Exactly how would I import it? Here's the scenerio. I have the Westhawk
SNMP jars in the path. I also have TrapReceive.class and Util.class in a
directory that is in the classpath. 

Thanks,
James

On Fri, 2003-09-26 at 11:12, Andrew Chandler wrote:
> I know you said its in the class path but did you remember to import that
> particular package?
> > > I'm also having trouble with the Util class. Whenever I try 
> > to use it 
> > > like: private Util util; the compiler says it can't find it. I have 
> > > Util.java compiled and in the classpath.
> > 
> > Thats odd. Any other clues?
> > 
> > > 
> > > Any help is appreciated.
> > > 
> > > Thanks,
> > > James
> > > 
> > > _______________________________________________
> > > snmp mailing list
> > > snmp@snmp.westhawk.co.uk 
> > > http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> > > 
> > 
> > _______________________________________________
> > snmp mailing list
> > snmp@snmp.westhawk.co.uk 
> > http://snmp.westhawk.co.uk/mailman/listinfo/sn> mp
> > 
> > 
> 
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp


From jep@obrien-pifer.com Fri Sep 26 16:57:36 2003
Received: from sammy.tnjinfl.com (obrien-pifer.com [24.73.99.190])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QFvZv19839
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 16:57:36 +0100 (BST)
Received: from tweety.tnjinfl.com ([192.168.1.20])
	by sammy.tnjinfl.com (8.12.8/8.12.8) with ESMTP id h8QFvP2o012287
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 11:57:25 -0400
From: James Pifer <jep@obrien-pifer.com>
To: SNMP <snmp@snmp.westhawk.co.uk>
Content-Type: text/plain
Message-Id: <1064592004.18193.111.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.0 
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-5.3, required 4,
	BAYES_20, USER_AGENT_XIMIAN)
X-Mailman-Approved-At: Fri, 26 Sep 2003 17:04:50 +0100
Subject: [snmp] Moderator
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Date: Fri, 26 Sep 2003 15:57:38 -0000
X-Original-Date: 26 Sep 2003 12:00:04 -0400
X-List-Received-Date: Fri, 26 Sep 2003 15:57:38 -0000

Do all messages first go to the moderator or did I screw something up
when subscribing?

Thanks,
James


From jep@obrien-pifer.com Fri Sep 26 16:56:43 2003
Received: from sammy.tnjinfl.com (obrien-pifer.com [24.73.99.190])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QFugv19821
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 16:56:43 +0100 (BST)
Received: from tweety.tnjinfl.com ([192.168.1.20])
	by sammy.tnjinfl.com (8.12.8/8.12.8) with ESMTP id h8QFuR2o012250
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 11:56:27 -0400
Subject: Re: [snmp] Decoding Traps Help
From: James Pifer <jep@obrien-pifer.com>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
In-Reply-To: <3F743E05.4080300@westhawk.co.uk>
References: <1064579173.18190.95.camel@tweety.tnjinfl.com>
	<3F743E05.4080300@westhawk.co.uk>
Content-Type: text/plain
Message-Id: <1064591946.18185.109.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.0 
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-9.4, required 4,
	BAYES_01, EMAIL_ATTRIBUTION, IN_REP_TO, QUOTED_EMAIL_TEXT,
	REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_XIMIAN)
X-Mailman-Approved-At: Fri, 26 Sep 2003 17:04:49 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Date: Fri, 26 Sep 2003 15:56:45 -0000
X-Original-Date: 26 Sep 2003 11:59:06 -0400
X-List-Received-Date: Fri, 26 Sep 2003 15:56:45 -0000

On Fri, 2003-09-26 at 09:24, Tim Panton wrote:
> James Pifer wrote:
> 
> > I was hoping to get some help from the list. I'm trying to create a
> > trapd service for collecting my company's traps. Most of the apps out
> > there, like OpenNMS, do not support de-duplication of traps, which is
> > something I definitely need. 
> > 
> > -So my plan was to first get something where I'm collecting the traps
> > and decoding them. 
> > -Once they are decoded, then I want to somehow run them against the MIBs
> > to make them more readable.
> 
> I should warn you we don't really have any significant MIB support
> in the stack.

I was figuring I would have to write a seperate program to process the
MIBs using libsmi (I think). This would have to create some type of
config or rules file for each MIB. Then, when I start TrapReceiver it
would pre-process all these new rules/config files. Then I would have
some method to run the event past these rules and translate if it finds
it. I assume this will be my hardest task. Maybe a bigger bite than I
can chew. :-) I'm always open for suggestions. 

> 
> > -Then deal with the other stuff, like how to de-duplicate, how/where to
> > store, probably need threading, etc. 
> 
> Generally we take care of most of the threading in the stack.

That's good to know.

> 
> > 
> > I'm not great at reading javadocs. I'm following the documentation and
> > trying to use the examples. I have the TrapReceive working but it
> > doesn't decode anything. The documentation says to create a context
> > and then: Pdu trapPdu = context.processIncomingTrap(byte[ ] message)
> > 
> > I was trying to make this a part of the following else in TrapReceive: 
> > else 
> > { 
> > int version = evt.getVersion(); 
> > String host = evt.getHostAddress(); 
> > System.out.println("ReceiveTrap.trapReceived():" + " received undecoded
> > trap v " + version + " from host " + host); 
> > }
> 
> Ok, I can see that we could usefully improve this example, something 
> like (untested) :
>     else
>      {
>          int version = evt.getVersion();
>          String host = evt.getHostAddress();
>          System.out.println("ReceiveTrap.trapReceived():"
>              + " received undecoded trap v " + version
>              + " from host " + host);
>        // should really do a switch on version....
>          try {
>            // make a context which matches the unexpected trap.
>            SnmpContextBasisFace tmpcont
>               = new SnmpContext(host,context.getPort(),
>                                 context.getTypeSocket());
>            byte[] mess = evt.getMessage();
>            // and get it to decode the thing.
>            Pdu got = tmpcont.processIncomingTrap(mess);
>            System.out.println(
>              "got unexpected trap from "+host+" :"+got.toString());
>            tmpcont.destroy();
>          } catch (Exception x) {
>             x.printStackTrace();
>          }
>      }
> 
> 
> so what you need to do is :
> 	1) create a temp context that matches the trap you have.
> 	2) extract the data from the event
> 	3) get the context to decode it
> 	4) dispose of the context.
> 
> - If you know that the traps will come from a smallish set of
> hosts you could improve this by using a contextpool.

I will be getting traps from a ton of hosts. 

> 
> > 
> > Quite frankly I'm not sure how to do it. So far I've been unsuccesful
> > trying to use the examples and javadocs. I tried creating the context by
> > adding this:
> >       SnmpContextBasisFace context = trapPdu.getContext();
> > 
> > But I don't see how or where to use this one (from the documentation)
> > for getting the info out of the trap:
> > 	trapPdu = context.processIncomingTrap(byte[ ] message);
> > 
> > I'm also having trouble with the Util class. Whenever I try to use it like:
> > private Util util; 
> > the compiler says it can't find it. I have Util.java compiled and in the 
> > classpath.
> 
> Thats odd. Any other clues?
> 
> > 
> > Any help is appreciated.  
> > 
> > Thanks,
> > James
> > 
> > _______________________________________________
> > snmp mailing list
> > snmp@snmp.westhawk.co.uk
> > http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> > 
> 
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp

Thanks,
James


From thp@westhawk.co.uk Fri Sep 26 17:06:24 2003
Received: from way.westhawk.co.uk (mailhost.westhawk.co.uk [192.67.4.187])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QG6Ov19882
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 17:06:24 +0100 (BST)
Received: from westhawk.co.uk (atuan.westhawk.co.uk [192.67.4.34])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8QG6NR21150
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 17:06:23 +0100
Message-ID: <3F7463FF.2000305@westhawk.co.uk>
Date: Fri, 26 Sep 2003 17:06:23 +0100
From: Tim Panton <thp@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] Moderator
References: <1064592004.18193.111.camel@tweety.tnjinfl.com>
In-Reply-To: <1064592004.18193.111.camel@tweety.tnjinfl.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 26 Sep 2003 16:06:26 -0000



James Pifer wrote:

> Do all messages first go to the moderator or did I screw something up
> when subscribing?
> 

Yep, we are moderating it (for the moment, till we see how it
settles down.)

> Thanks,
> James
> 
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> 


From andy@riftware.com Fri Sep 26 18:09:58 2003
Received: from sn1.cwihosting.com ([66.216.127.19])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QH9vv19911
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 18:09:57 +0100 (BST)
Received: from 216-101-250-150.visionael.com ([216.101.250.150] helo=andydev4)
	by sn1.cwihosting.com with asmtp (Exim 4.23) id 1A2w6N-0008FR-HX
	for snmp@snmp.westhawk.co.uk; Fri, 26 Sep 2003 12:09:55 -0500
From: "Andrew Chandler" <andy@riftware.com>
To: "'List for discussion of the Westhawk SNMP stack'"
	<snmp@snmp.westhawk.co.uk>
Subject: RE: [snmp] Decoding Traps Help
Date: Fri, 26 Sep 2003 10:09:52 -0700
Message-ID: <001d01c38451$01a45470$23fc010a@andydev4>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.4510
In-Reply-To: <1064591598.18182.102.camel@tweety.tnjinfl.com>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
X-AntiAbuse: This header was added to track abuse,
	please include it with any abuse report
X-AntiAbuse: Primary Hostname - sn1.cwihosting.com
X-AntiAbuse: Original Domain - snmp.westhawk.co.uk
X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12]
X-AntiAbuse: Sender Address Domain - riftware.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by snmp.westhawk.co.uk id
	h8QH9vv19911
X-Mailman-Approved-At: Sat, 27 Sep 2003 16:30:35 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 26 Sep 2003 17:09:59 -0000

Ok, well at the top of your class you need to have an 
 import uk.co.westhawk.snmp.util.*;

You would also need to not just put the jar in the path it must be in the
CLASSPATH - usually accomplished by either placing the jar in jre/lib/ext
directory or explicitly by giving it to java and javac in the -classpath
parameter so for instance assuming I put my jars in \projects\lib I would go
:
Java -classpath \projects\lib\snmp.jar;\projects\lib\someother.jar
substitute ; with a : if in unix and change the \ to a / if in unix as well.
Similarly you need to pass the -classpath to javac to compile.   If you are
building in an IDE like netbeans you usually need to mount the jar so the
IDE knows to give it to javac when it is called.   Hope this helps.



> -----Original Message-----
> From: snmp-bounces@snmp.westhawk.co.uk 
> [mailto:snmp-bounces@snmp.westhawk.co.uk] On Behalf Of James Pifer
> Sent: Friday, September 26, 2003 8:53 AM
> To: List for discussion of the Westhawk SNMP stack
> Subject: RE: [snmp] Decoding Traps Help
> 
> 
> Exactly how would I import it? Here's the scenerio. I have 
> the Westhawk SNMP jars in the path. I also have 
> TrapReceive.class and Util.class in a directory that is in 
> the classpath. 
> 
> Thanks,
> James
> 
> On Fri, 2003-09-26 at 11:12, Andrew Chandler wrote:
> > I know you said its in the class path but did you remember 
> to import 
> > that particular package?
> > > > I'm also having trouble with the Util class. Whenever I try
> > > to use it
> > > > like: private Util util; the compiler says it can't find it. I 
> > > > have
> > > > Util.java compiled and in the classpath.
> > > 
> > > Thats odd. Any other clues?
> > > 
> > > > 
> > > > Any help is appreciated.
> > > > 
> > > > Thanks,
> > > > James
> > > > 
> > > > _______________________________________________
> > > > snmp mailing list
> > > > snmp@snmp.westhawk.co.uk
> > > > http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> > > > 
> > > 
> > > _______________________________________________
> > > snmp mailing list
> > > snmp@snmp.westhawk.co.uk
> > > http://snmp.westhawk.co.uk/mailman/listinfo/sn> mp
> > > 
> > > 
> > 
> > _______________________________________________
> > snmp mailing list
> > snmp@snmp.westhawk.co.uk 
> > http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> 
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk 
> http://snmp.westhawk.co.uk/mailman/listinfo/sn> mp
> 
> 



From jep@obrien-pifer.com Fri Sep 26 19:48:06 2003
Received: from sammy.tnjinfl.com (obrien-pifer.com [24.73.99.190])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8QIm5v19955
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 19:48:05 +0100 (BST)
Received: from tweety.tnjinfl.com ([192.168.1.20])
	by sammy.tnjinfl.com (8.12.8/8.12.8) with ESMTP id h8QIlf2o016006
	for <snmp@snmp.westhawk.co.uk>; Fri, 26 Sep 2003 14:47:42 -0400
From: James Pifer <jep@obrien-pifer.com>
To: SNMP <snmp@snmp.westhawk.co.uk>
Content-Type: text/plain
Message-Id: <1064602221.6582.17.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.0 
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-7.4, required 4,
	BAYES_10, USER_AGENT_XIMIAN)
X-Mailman-Approved-At: Sat, 27 Sep 2003 16:31:59 +0100
Subject: [snmp] Sorry, few more questions
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Date: Fri, 26 Sep 2003 18:48:08 -0000
X-Original-Date: 26 Sep 2003 14:50:21 -0400
X-List-Received-Date: Fri, 26 Sep 2003 18:48:08 -0000

Tom, 

With your code example I'm getting the data for the trap. I have a few
questions. 

Is there a suggested way to get the data out of the pdu, like the
enterprise OID? Generic Trap, Specific Trap, etc?
Or should I just convert to a string and tokenize it? 

Similarly:
How can I check the size of a varbind[]?
How can I pull out the data for each varbind so I can make a comparison?
What are timeticks?

I ran into an interesting problem. I had one trap come in and got an
context exception because public was in upper case "PUBLIC". Any way to
deal with that kind of scenerio?

Thanks,
James


From birgit@westhawk.co.uk Mon Sep 29 11:10:23 2003
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8TAANv21105
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 11:10:23 +0100 (BST)
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8TAAMR05831
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 11:10:23 +0100
Received: from incat.westhawk.co.uk (incat.westhawk.co.uk [192.67.4.53])
	by incat.westhawk.co.uk (8.12.8/8.12.8) with ESMTP id h8TAAMiq010431
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 11:10:22 +0100
Received: (from birgit@localhost)
	by incat.westhawk.co.uk (8.12.8/8.12.8/Submit) id h8TAAM7m010429
	for snmp@snmp.westhawk.co.uk; Mon, 29 Sep 2003 11:10:22 +0100
Date: Mon, 29 Sep 2003 11:10:21 +0100
From: Birgit Arkesteijn <birgit@westhawk.co.uk>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] Sorry, few more questions
Message-ID: <20030929101021.GA8908@westhawk.co.uk>
References: <1064602221.6582.17.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1064602221.6582.17.camel@tweety.tnjinfl.com>
User-Agent: Mutt/1.4.1i
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 29 Sep 2003 10:10:25 -0000

Dear James,

Oh, come on! Most of this is simple Java and SNMP stuff. Really.

On Fri, Sep 26, 2003 at 02:50:21PM -0400, James Pifer wrote:
> Tom, 
> 
> With your code example I'm getting the data for the trap. I have a few
> questions. 
> 
> Is there a suggested way to get the data out of the pdu, like the
> enterprise OID? Generic Trap, Specific Trap, etc?
> Or should I just convert to a string and tokenize it? 

Read the javadoc on TrapPduv1.

> 
> Similarly:
> How can I check the size of a varbind[]?
> How can I pull out the data for each varbind so I can make a comparison?

Read how Java deal with arrays.

> What are timeticks?

Read up on SNMP.

> I ran into an interesting problem. I had one trap come in and got an
> context exception because public was in upper case "PUBLIC". Any way to
> deal with that kind of scenario?

Yes, this is the flaw with Tim's setup.
The way the stack works is that it checks all parameters of the incoming
trap with the parameters of the Context. The default community name of
the SnmpContext is "public". When your trap comes in with a different 
community name (and "PUBLIC" is different to "public"), it cannot decode
it. The stack does not offer anything more flexible.

Strictly speaking, the community name is the only piece of security
SNMPv1 has got, albeit a very weak one. You should know what community
name to expect.

If possible, configure your managers to send traps with "public". 

Birgit

-- 
-- Birgit Arkesteijn, birgit@westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>

From jep@obrien-pifer.com Mon Sep 29 13:37:34 2003
Received: from sammy.tnjinfl.com (obrien-pifer.com [24.73.99.190])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8TCbXv21168
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 13:37:34 +0100 (BST)
Received: from tweety.tnjinfl.com ([192.168.1.20])
	by sammy.tnjinfl.com (8.12.8/8.12.8) with ESMTP id h8TCbI2o004047
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 08:37:18 -0400
Subject: RE: [snmp] Decoding Traps Help
From: James Pifer <jep@obrien-pifer.com>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
In-Reply-To: <001d01c38451$01a45470$23fc010a@andydev4>
References: <001d01c38451$01a45470$23fc010a@andydev4>
Content-Type: text/plain
Message-Id: <1064839215.28159.16.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.0 
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-9.4, required 4,
	BAYES_01, EMAIL_ATTRIBUTION, IN_REP_TO, QUOTED_EMAIL_TEXT,
	REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_XIMIAN)
X-Mailman-Approved-At: Mon, 29 Sep 2003 14:57:51 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Date: Mon, 29 Sep 2003 12:37:36 -0000
X-Original-Date: 29 Sep 2003 08:40:15 -0400
X-List-Received-Date: Mon, 29 Sep 2003 12:37:36 -0000

Andrew,

Yep, already have that: import uk.co.westhawk.snmp.util.*; The example
SendTrap.java uses Util but does not have that line. 

Yep, I already have the jars explicitly in the classpath. 

For example, the simple SendTrap.java provided in examplev1.
SendTrap.java has this at the top:

package uk.co.westhawk.examplev1;

import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.net.*;
import uk.co.westhawk.snmp.stack.*;
import uk.co.westhawk.snmp.pdu.*;


When I try to compile it using the following I get errors. 
C:\Temp\Java\trapd_service.dev>javac -classpath
$CLASSPATH;C:\Temp\Java\trapd_service.dev\snmp4_13.jar;C:\Temp\Java\trap
d_service.dev\snmpOracle4_13.jar;C:\Temp\Java\trapd_service.dev\snmp4_13
.jar;C:\Temp\Java\trapd_service.dev SendTrap.java

SendTrap.java:70: cannot resolve symbol
symbol  : class Util
location: class uk.co.westhawk.examplev1.SendTrap
    private Util util;
            ^
SendTrap.java:81: cannot resolve symbol
symbol  : class Util
location: class uk.co.westhawk.examplev1.SendTrap
    util = new Util(propertiesFilename, this.getClass().getName());
               ^
2 errors

Both jars are explicit as well as the directory trapd_service.dev, which
is where SendTrap.java is located. I also even have the Util.class
compiled from Util.java in that directory.  

Anything obvious? 

James




On Fri, 2003-09-26 at 13:09, Andrew Chandler wrote:
> Ok, well at the top of your class you need to have an 
>  import uk.co.westhawk.snmp.util.*;
> 
> You would also need to not just put the jar in the path it must be in the
> CLASSPATH - usually accomplished by either placing the jar in jre/lib/ext
> directory or explicitly by giving it to java and javac in the -classpath
> parameter so for instance assuming I put my jars in \projects\lib I would go
> :
> Java -classpath \projects\lib\snmp.jar;\projects\lib\someother.jar
> substitute ; with a : if in unix and change the \ to a / if in unix as well.
> Similarly you need to pass the -classpath to javac to compile.   If you are
> building in an IDE like netbeans you usually need to mount the jar so the
> IDE knows to give it to javac when it is called.   Hope this helps.
> 
> 
> 
> > -----Original Message-----
> > From: snmp-bounces@snmp.westhawk.co.uk 
> > [mailto:snmp-bounces@snmp.westhawk.co.uk] On Behalf Of James Pifer
> > Sent: Friday, September 26, 2003 8:53 AM
> > To: List for discussion of the Westhawk SNMP stack
> > Subject: RE: [snmp] Decoding Traps Help
> > 
> > 
> > Exactly how would I import it? Here's the scenerio. I have 
> > the Westhawk SNMP jars in the path. I also have 
> > TrapReceive.class and Util.class in a directory that is in 
> > the classpath. 
> > 
> > Thanks,
> > James
> > 
> > On Fri, 2003-09-26 at 11:12, Andrew Chandler wrote:
> > > I know you said its in the class path but did you remember 
> > to import 
> > > that particular package?
> > > > > I'm also having trouble with the Util class. Whenever I try
> > > > to use it
> > > > > like: private Util util; the compiler says it can't find it. I 
> > > > > have
> > > > > Util.java compiled and in the classpath.
> > > > 
> > > > Thats odd. Any other clues?
> > > > 
> > > > > 
> > > > > Any help is appreciated.
> > > > > 
> > > > > Thanks,
> > > > > James
> > > > > 
> > > > > _______________________________________________
> > > > > snmp mailing list
> > > > > snmp@snmp.westhawk.co.uk
> > > > > http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> > > > > 
> > > > 
> > > > _______________________________________________
> > > > snmp mailing list
> > > > snmp@snmp.westhawk.co.uk
> > > > http://snmp.westhawk.co.uk/mailman/listinfo/sn> mp
> > > > 
> > > > 
> > > 
> > > _______________________________________________
> > > snmp mailing list
> > > snmp@snmp.westhawk.co.uk 
> > > http://snmp.westhawk.co.uk/mailman/listinfo/snmp
> > 
> > _______________________________________________
> > snmp mailing list
> > snmp@snmp.westhawk.co.uk 
> > http://snmp.westhawk.co.uk/mailman/listinfo/sn> mp
> > 
> > 
> 
> 
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp


From ray@westhawk.co.uk Mon Sep 29 15:06:59 2003
Received: from way.westhawk.co.uk (mailhost.westhawk.co.uk [192.67.4.187])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8TE6wv21224
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 15:06:58 +0100 (BST)
Received: from westhawk.co.uk (ully.westhawk.co.uk [192.67.4.46])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h8TE6wR06715
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 15:06:58 +0100
Message-ID: <3F783C82.1010200@westhawk.co.uk>
Date: Mon, 29 Sep 2003 15:06:58 +0100
From: Ray Tran <ray@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en, en-us
MIME-Version: 1.0
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] Decoding Traps Help
References: <001d01c38451$01a45470$23fc010a@andydev4>
	<1064839215.28159.16.camel@tweety.tnjinfl.com>
In-Reply-To: <1064839215.28159.16.camel@tweety.tnjinfl.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 29 Sep 2003 14:07:00 -0000

James,
it isn't uk.co.westhawk.snmp.util.Util so "import uk.co.westhawk.snmp.util.*;"
won't do what you want. The Util classes are defined in the example packages
so you could import it from there.

The Util classes are in:
     * uk.co.westhawk.examplev1.Util
     * uk.co.westhawk.examplev2c.Util
     * uk.co.westhawk.examplev3.Util
     * uk.co.westhawk.test.Util
None of these are compiled by default so importing them will fail. Your best option is to
copy the code from the one that suits your needs into your own Util class in the same
package as the stuff you are writing, you can then add any utilities specific to your needs
to it.

James Pifer wrote:

> Andrew,
> 
> Yep, already have that: import uk.co.westhawk.snmp.util.*; The example
> SendTrap.java uses Util but does not have that line. 
> 
> Yep, I already have the jars explicitly in the classpath. 
> 
> For example, the simple SendTrap.java provided in examplev1.
> SendTrap.java has this at the top:
> 
> package uk.co.westhawk.examplev1;
> 
> import java.awt.*;
> import javax.swing.*;
> import java.util.*;
> import java.net.*;
> import uk.co.westhawk.snmp.stack.*;
> import uk.co.westhawk.snmp.pdu.*;
> 
> 
> When I try to compile it using the following I get errors. 
> C:\Temp\Java\trapd_service.dev>javac -classpath
> $CLASSPATH;C:\Temp\Java\trapd_service.dev\snmp4_13.jar;C:\Temp\Java\trap
> d_service.dev\snmpOracle4_13.jar;C:\Temp\Java\trapd_service.dev\snmp4_13
> .jar;C:\Temp\Java\trapd_service.dev SendTrap.java
> 
> SendTrap.java:70: cannot resolve symbol
> symbol  : class Util
> location: class uk.co.westhawk.examplev1.SendTrap
>     private Util util;
>             ^
> SendTrap.java:81: cannot resolve symbol
> symbol  : class Util
> location: class uk.co.westhawk.examplev1.SendTrap
>     util = new Util(propertiesFilename, this.getClass().getName());
>                ^
> 2 errors
> 
> Both jars are explicit as well as the directory trapd_service.dev, which
> is where SendTrap.java is located. I also even have the Util.class
> compiled from Util.java in that directory.  
> 
> Anything obvious? 
> 
> James
> 
> 
> 
> 
> On Fri, 2003-09-26 at 13:09, Andrew Chandler wrote:
> 
>>Ok, well at the top of your class you need to have an 
>> import uk.co.westhawk.snmp.util.*;
>>
>>You would also need to not just put the jar in the path it must be in the
>>CLASSPATH - usually accomplished by either placing the jar in jre/lib/ext
>>directory or explicitly by giving it to java and javac in the -classpath
>>parameter so for instance assuming I put my jars in \projects\lib I would go
>>:
>>Java -classpath \projects\lib\snmp.jar;\projects\lib\someother.jar
>>substitute ; with a : if in unix and change the \ to a / if in unix as well.
>>Similarly you need to pass the -classpath to javac to compile.   If you are
>>building in an IDE like netbeans you usually need to mount the jar so the
>>IDE knows to give it to javac when it is called.   Hope this helps.
>>
>>
>>
>>
<<<<<<cut>>>>>>>>

Hope this helps,
-- 
Ray Tran
Java Software Engineer
ray@westhawk.co.uk
www.westhawk.co.uk
+44 (0)161 237 0660


From jep@obrien-pifer.com Mon Sep 29 15:19:21 2003
Received: from sammy.tnjinfl.com (obrien-pifer.com [24.73.99.190])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h8TEJKv21239
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 15:19:20 +0100 (BST)
Received: from tweety.tnjinfl.com ([192.168.1.20])
	by sammy.tnjinfl.com (8.12.8/8.12.8) with ESMTP id h8TEJ72o006484
	for <snmp@snmp.westhawk.co.uk>; Mon, 29 Sep 2003 10:19:07 -0400
Subject: Re: [snmp] Decoding Traps Help
From: James Pifer <jep@obrien-pifer.com>
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
In-Reply-To: <3F783C82.1010200@westhawk.co.uk>
References: <001d01c38451$01a45470$23fc010a@andydev4>
	<1064839215.28159.16.camel@tweety.tnjinfl.com>
	<3F783C82.1010200@westhawk.co.uk>
Content-Type: text/plain
Message-Id: <1064845325.28173.34.camel@tweety.tnjinfl.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.0 
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-9.4, required 4,
	BAYES_01, EMAIL_ATTRIBUTION, IN_REP_TO, QUOTED_EMAIL_TEXT,
	REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_XIMIAN)
X-Mailman-Approved-At: Mon, 29 Sep 2003 15:20:25 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
Date: Mon, 29 Sep 2003 14:19:22 -0000
X-Original-Date: 29 Sep 2003 10:22:05 -0400
X-List-Received-Date: Mon, 29 Sep 2003 14:19:22 -0000

Okay, that seems to make sense. I'll try it.

Thanks,
James

On Mon, 2003-09-29 at 10:06, Ray Tran wrote:
> James,
> it isn't uk.co.westhawk.snmp.util.Util so "import uk.co.westhawk.snmp.util.*;"
> won't do what you want. The Util classes are defined in the example packages
> so you could import it from there.
> 
> The Util classes are in:
>      * uk.co.westhawk.examplev1.Util
>      * uk.co.westhawk.examplev2c.Util
>      * uk.co.westhawk.examplev3.Util
>      * uk.co.westhawk.test.Util
> None of these are compiled by default so importing them will fail. Your best option is to
> copy the code from the one that suits your needs into your own Util class in the same
> package as the stuff you are writing, you can then add any utilities specific to your needs
> to it.
> 
> James Pifer wrote:
> 
> > Andrew,
> > 
> > Yep, already have that: import uk.co.westhawk.snmp.util.*; The example
> > SendTrap.java uses Util but does not have that line. 
> > 
> > Yep, I already have the jars explicitly in the classpath. 
> > 
> > For example, the simple SendTrap.java provided in examplev1.
> > SendTrap.java has this at the top:
> > 
> > package uk.co.westhawk.examplev1;
> > 
> > import java.awt.*;
> > import javax.swing.*;
> > import java.util.*;
> > import java.net.*;
> > import uk.co.westhawk.snmp.stack.*;
> > import uk.co.westhawk.snmp.pdu.*;
> > 
> > 
> > When I try to compile it using the following I get errors. 
> > C:\Temp\Java\trapd_service.dev>javac -classpath
> > $CLASSPATH;C:\Temp\Java\trapd_service.dev\snmp4_13.jar;C:\Temp\Java\trap
> > d_service.dev\snmpOracle4_13.jar;C:\Temp\Java\trapd_service.dev\snmp4_13
> > .jar;C:\Temp\Java\trapd_service.dev SendTrap.java
> > 
> > SendTrap.java:70: cannot resolve symbol
> > symbol  : class Util
> > location: class uk.co.westhawk.examplev1.SendTrap
> >     private Util util;
> >             ^
> > SendTrap.java:81: cannot resolve symbol
> > symbol  : class Util
> > location: class uk.co.westhawk.examplev1.SendTrap
> >     util = new Util(propertiesFilename, this.getClass().getName());
> >                ^
> > 2 errors
> > 
> > Both jars are explicit as well as the directory trapd_service.dev, which
> > is where SendTrap.java is located. I also even have the Util.class
> > compiled from Util.java in that directory.  
> > 
> > Anything obvious? 
> > 
> > James
> > 
> > 
> > 
> > 
> > On Fri, 2003-09-26 at 13:09, Andrew Chandler wrote:
> > 
> >>Ok, well at the top of your class you need to have an 
> >> import uk.co.westhawk.snmp.util.*;
> >>
> >>You would also need to not just put the jar in the path it must be in the
> >>CLASSPATH - usually accomplished by either placing the jar in jre/lib/ext
> >>directory or explicitly by giving it to java and javac in the -classpath
> >>parameter so for instance assuming I put my jars in \projects\lib I would go
> >>:
> >>Java -classpath \projects\lib\snmp.jar;\projects\lib\someother.jar
> >>substitute ; with a : if in unix and change the \ to a / if in unix as well.
> >>Similarly you need to pass the -classpath to javac to compile.   If you are
> >>building in an IDE like netbeans you usually need to mount the jar so the
> >>IDE knows to give it to javac when it is called.   Hope this helps.
> >>
> >>
> >>
> >>
> <<<<<<cut>>>>>>>>
> 
> Hope this helps,


From DCoutts@voip.com.au Mon Oct  6 02:48:03 2003
Received: from mail1.voip.com.au ([202.172.159.253])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h961m0v24062
	for <snmp@snmp.westhawk.co.uk>; Mon, 6 Oct 2003 02:48:02 +0100 (BST)
Received: from voip.com.au ([10.3.1.187]) by mail1.voip.com.au with Microsoft
	SMTPSVC(5.0.2195.4905); Mon, 6 Oct 2003 11:47:57 +1000
Message-ID: <3F817385.2080701@voip.com.au>
Date: Mon, 06 Oct 2003 23:52:05 +1000
From: Damian Coutts <dcoutts@voip.com.au>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.1b) Gecko/20020721
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: snmp@snmp.westhawk.co.uk
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 06 Oct 2003 01:47:57.0751 (UTC)
	FILETIME=[DE0C1C70:01C38BAB]
X-Mailman-Approved-At: Mon, 06 Oct 2003 10:44:48 +0100
Subject: [snmp] uk.co.westhawk.snmp.stack.DecodingException: Incorrect
 packet. No of bytes received
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 06 Oct 2003 01:48:05 -0000

SNMPers

My poller is trying to fit as many OIDs into its request as it can. 
Occasionally I get the following exception.

uk.co.westhawk.snmp.stack.DecodingException: Incorrect packet. No of 
bytes received less than packet length.

I seem to only get this when I try to decode responses from some 
Baystack switches which I have sent quite a large request to.

I guess this means that the PDU appears to be truncated. I am not sure 
how to prevent this, especially as it seems to relate more to the size 
of the response than the size of  the request . (There is a analagous 
issue which I have already dealt with where the request is to big to fit 
in a packet).

Comments or suggestions anyone?

Damian Coutts


From DCoutts@voip.com.au Mon Oct  6 13:51:49 2003
Received: from mail1.voip.com.au ([202.172.159.253])
	by snmp.westhawk.co.uk (8.11.7+Sun/8.11.7) with ESMTP id h96Cplv24294
	for <snmp@snmp.westhawk.co.uk>; Mon, 6 Oct 2003 13:51:48 +0100 (BST)
Received: from voip.com.au ([10.3.1.163]) by mail1.voip.com.au with Microsoft
	SMTPSVC(5.0.2195.4905); Mon, 6 Oct 2003 22:51:42 +1000
Message-ID: <3F81655A.7050808@voip.com.au>
Date: Mon, 06 Oct 2003 22:51:38 +1000
From: Damian Coutts <dcoutts@voip.com.au>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: snmp@snmp.westhawk.co.uk
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 06 Oct 2003 12:51:42.0692 (UTC)
	FILETIME=[978FDA40:01C38C08]
X-Mailman-Approved-At: Mon, 06 Oct 2003 13:53:19 +0100
Subject: [snmp] getIfSpeed
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 06 Oct 2003 12:51:51 -0000

I can't seem to get the interface speed (eg 10/100MB for ethernet) from 
the InterfaceGetNextPdu.




From ghalevi@netvision.net.il Mon Oct  6 18:52:14 2003
Received: from mxout3.netvision.net.il (mxout3.netvision.net.il [194.90.9.24])
	by snmp.westhawk.co.uk (8.11.7p1+Sun/8.11.7) with ESMTP id
	h96HqD526760
	for <snmp@snmp.westhawk.co.uk>; Mon, 6 Oct 2003 18:52:13 +0100 (BST)
Received: from yluzhome ([217.132.0.48]) by mxout3.netvision.net.il
	(iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003))
	with ESMTPA id <0HMC001H8KAZEU@mxout3.netvision.net.il> for
	snmp@snmp.westhawk.co.uk; Mon, 06 Oct 2003 19:52:12 +0200 (IST)
Date: Mon, 06 Oct 2003 19:53:47 +0200
From: Zeev Halevi <ghalevi@netvision.net.il>
To: snmp@snmp.westhawk.co.uk
Message-id: <005e01c38c32$caf4f350$0101c80a@yluzhome>
MIME-version: 1.0
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Mailer: Microsoft Outlook Express 6.00.2800.1106
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT
X-Priority: 3
X-MSMail-priority: Normal
X-Mailman-Approved-At: Mon, 06 Oct 2003 18:53:25 +0100
Subject: [snmp] Pdu.waitForSelf()
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: Zeev Halevi <ghalevi@netvision.net.il>,
	List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Mon, 06 Oct 2003 17:52:15 -0000

Greetings,

I've been using Wsthawk SNMP stack for some time now to poll a very
complicated wireless hub and it's great.
Thanks to the Wsthawk team,

A question please:

What is the deference between using
Pdu.send();
followed by,
Pdu.waitForSelf();

and the use of BlockPdu ?

Thanks,
zeev


From thp@westhawk.co.uk Thu Oct  9 09:50:40 2003
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by snmp.westhawk.co.uk (8.11.7p1+Sun/8.11.7) with ESMTP id h998od527942
	for <snmp@snmp.westhawk.co.uk>; Thu, 9 Oct 2003 09:50:39 +0100 (BST)
Received: from westhawk.co.uk (atuan.westhawk.co.uk [192.67.4.34])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h998odR21140
	for <snmp@snmp.westhawk.co.uk>; Thu, 9 Oct 2003 09:50:39 +0100
Message-ID: <3F85215F.5060601@westhawk.co.uk>
Date: Thu, 09 Oct 2003 09:50:39 +0100
From: Tim Panton <thp@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] uk.co.westhawk.snmp.stack.DecodingException: Incorrect
	packet. No of bytes received
References: <3F817385.2080701@voip.com.au>
In-Reply-To: <3F817385.2080701@voip.com.au>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 09 Oct 2003 08:50:41 -0000



Damian Coutts wrote:
> SNMPers

Sorry it has taken so long to get back to you,
there are 2 reasons for this:
	1) We are very busy at Westhawk at the moment,
	2) There are still only a few folk on the list
(we have a round of invites to send out when things calm
down here)

> 
> My poller is trying to fit as many OIDs into its request as it can. 
> Occasionally I get the following exception.
> 
> uk.co.westhawk.snmp.stack.DecodingException: Incorrect packet. No of 
> bytes received less than packet length.

> 
> I seem to only get this when I try to decode responses from some 
> Baystack switches which I have sent quite a large request to.
> 
> I guess this means that the PDU appears to be truncated. I am not sure 
> how to prevent this, especially as it seems to relate more to the size 
> of the response than the size of  the request . (There is a analagous 
> issue which I have already dealt with where the request is to big to fit 
> in a packet).

Yep, we have set the maximum packet size  to a relatvively
conservative value (1300 bytes)

See the doc on public void setMaxRecvSize(int no) in AbstractSnmpContext
<Quote>
Although UDP datagrams can be fragmented (fragmentation is part of
the network layer (IP), not the transport layer (UDP/TCP)), some
firewalls reject incoming fragments. Therefor it is best not to 
setmaxRecvSize higher than the largest packet size you can get through
your network topology.
</Quote>

In a mixed network I'd advise you to reduce the request so that the 
reply fits, especially since the setMaxRecvSize doesn't work correctly
in ContextPools.

> 
> Comments or suggestions anyone?
> 
> Damian Coutts

Tim.


From thp@westhawk.co.uk Thu Oct  9 10:11:21 2003
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by snmp.westhawk.co.uk (8.11.7p1+Sun/8.11.7) with ESMTP id h999BL527972
	for <snmp@snmp.westhawk.co.uk>; Thu, 9 Oct 2003 10:11:21 +0100 (BST)
Received: from westhawk.co.uk (atuan.westhawk.co.uk [192.67.4.34])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h999BLR21252
	for <snmp@snmp.westhawk.co.uk>; Thu, 9 Oct 2003 10:11:21 +0100
Message-ID: <3F852638.5040308@westhawk.co.uk>
Date: Thu, 09 Oct 2003 10:11:20 +0100
From: Tim Panton <thp@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] getIfSpeed
References: <3F81655A.7050808@voip.com.au>
In-Reply-To: <3F81655A.7050808@voip.com.au>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 09 Oct 2003 09:11:23 -0000



Damian Coutts wrote:

> I can't seem to get the interface speed (eg 10/100MB for ethernet) from 
> the InterfaceGetNextPdu.

I'm guessing the problem here is that the javadoc
for getSpeed is confusing in that the value
is only valid when you have previously called
public long getSpeed(InterfaceGetNextPdu old)

The thing is that you need 2 pdu's some time apart
to calculate the speed as the MIB only gives you the
the number of bytes, so you need 2 samples some time apart.

(By the way you kindly sent us fix for this by email, but
I couldn't see any changes in the file! Could you
either tell me what you changed or diffs? )

Thanks.

Tim.



From thp@westhawk.co.uk Thu Oct  9 10:19:17 2003
Received: from way.westhawk.co.uk (way.westhawk.co.uk [192.67.4.47])
	by snmp.westhawk.co.uk (8.11.7p1+Sun/8.11.7) with ESMTP id h999JH527988
	for <snmp@snmp.westhawk.co.uk>; Thu, 9 Oct 2003 10:19:17 +0100 (BST)
Received: from westhawk.co.uk (atuan.westhawk.co.uk [192.67.4.34])
	by way.westhawk.co.uk (8.11.6/8.11.6) with ESMTP id h999JFR21291;
	Thu, 9 Oct 2003 10:19:15 +0100
Message-ID: <3F852813.8080703@westhawk.co.uk>
Date: Thu, 09 Oct 2003 10:19:15 +0100
From: Tim Panton <thp@westhawk.co.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Zeev Halevi <ghalevi@netvision.net.il>,
	List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] Pdu.waitForSelf()
References: <005e01c38c32$caf4f350$0101c80a@yluzhome>
In-Reply-To: <005e01c38c32$caf4f350$0101c80a@yluzhome>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: 
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 09 Oct 2003 09:19:19 -0000



Zeev Halevi wrote:

> Greetings,
> 
> I've been using Wsthawk SNMP stack for some time now to poll a very
> complicated wireless hub and it's great.

That's nice to hear :-)

> Thanks to the Wsthawk team,
> 
> A question please:
> 
> What is the deference between using
> Pdu.send();
> followed by,
> Pdu.waitForSelf();
> 
> and the use of BlockPdu ?

Not much real difference, except that if you code
with waitForSelf you will need to make fewer
changes when you need to move to an async style
using beans or Observers.

We generally find that in the early phase of
a project it is nice to use a blocking style,
but pretty soon you need to move to async
for speed (and modularity).

> 
> Thanks,
> zeev
Tim.



From DCoutts@voip.com.au Thu Oct  9 10:55:54 2003
Received: from mail1.voip.com.au ([202.172.159.253])
	by snmp.westhawk.co.uk (8.11.7p1+Sun/8.11.7) with ESMTP id h999tq528018
	for <snmp@snmp.westhawk.co.uk>; Thu, 9 Oct 2003 10:55:53 +0100 (BST)
Received: from voip.com.au ([10.3.1.163]) by mail1.voip.com.au with Microsoft
	SMTPSVC(5.0.2195.4905); Thu, 9 Oct 2003 19:55:50 +1000
Message-ID: <3F85309E.1070300@voip.com.au>
Date: Thu, 09 Oct 2003 19:55:42 +1000
From: Damian Coutts <dcoutts@voip.com.au>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: List for discussion of the Westhawk SNMP stack <snmp@snmp.westhawk.co.uk>
Subject: Re: [snmp] getIfSpeed
References: <3F81655A.7050808@voip.com.au> <3F852638.5040308@westhawk.co.uk>
In-Reply-To: <3F852638.5040308@westhawk.co.uk>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 09 Oct 2003 09:55:50.0370 (UTC)
	FILETIME=[85208C20:01C38E4B]
X-Mailman-Approved-At: Thu, 09 Oct 2003 11:00:06 +0100
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 09 Oct 2003 09:55:56 -0000

Sorry I must have grabbed the wrong file. Essentially I implemented 
getIfSpeed which returned the speed rather than the throughput. I have 
realised now that trying to get use InterfaceGetNextPdu was probably not 
the right approach for what I am trying to do anyway. The Javadoc is a 
little confusing.
Damian

Tim Panton wrote:

>
>
> Damian Coutts wrote:
>
>> I can't seem to get the interface speed (eg 10/100MB for ethernet) 
>> from the InterfaceGetNextPdu.
>
>
> I'm guessing the problem here is that the javadoc
> for getSpeed is confusing in that the value
> is only valid when you have previously called
> public long getSpeed(InterfaceGetNextPdu old)
>
> The thing is that you need 2 pdu's some time apart
> to calculate the speed as the MIB only gives you the
> the number of bytes, so you need 2 samples some time apart.
>
> (By the way you kindly sent us fix for this by email, but
> I couldn't see any changes in the file! Could you
> either tell me what you changed or diffs? )
>
> Thanks.
>
> Tim.
>
>
> _______________________________________________
> snmp mailing list
> snmp@snmp.westhawk.co.uk
> http://snmp.westhawk.co.uk/mailman/listinfo/snmp
>


From diego@datacom-telematica.com.br Thu Oct  9 16:10:56 2003
Received: from smtp2.terraempresas.com.br (smtp2.terraempresas.com.br
	[200.176.131.72])
	by snmp.westhawk.co.uk (8.11.7p1+Sun/8.11.7) with ESMTP id h99FAo528238
	for <snmp@snmp.westhawk.co.uk>; Thu, 9 Oct 2003 16:10:51 +0100 (BST)
Received: from diego (radio-112-2.poa.terraempresas.com.br [200.176.112.2])
	by smtp2.terraempresas.com.br (Postfix) with SMTP id AD13F347EA
	for <snmp@snmp.westhawk.co.uk>; Thu,  9 Oct 2003 11:43:50 -0300 (BRT)
Message-ID: <002301c38e73$f7e6d7f0$0400a8c0@datacom>
From: "DataCom - Diego Moreira da Rosa" <diego@datacom-telematica.com.br>
To: "e-Westhawk" <snmp@snmp.westhawk.co.uk>
Date: Thu, 9 Oct 2003 11:45:22 -0300
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Mailman-Approved-At: Thu, 09 Oct 2003 16:13:45 +0100
Subject: [snmp] Varbind returns NULL without an error
X-BeenThere: snmp@snmp.westhawk.co.uk
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: List for discussion of the Westhawk SNMP stack
	<snmp@snmp.westhawk.co.uk>
List-Id: List for discussion of the Westhawk SNMP stack
	<snmp.snmp.westhawk.co.uk>
List-Unsubscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=unsubscribe>
List-Archive: <http://snmp.westhawk.co.uk/pipermail/snmp>
List-Post: <mailto:snmp@snmp.westhawk.co.uk>
List-Help: <mailto:snmp-request@snmp.westhawk.co.uk?subject=help>
List-Subscribe: <http://snmp.westhawk.co.uk/mailman/listinfo/snmp>,
	<mailto:snmp-request@snmp.westhawk.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 09 Oct 2003 15:10:58 -0000

Hi all,

Nice talking to you. It is my first time in this list.

First, I would like to congrat all the guys from the development: the stack
is very good! Second, I would like to report the newest application using
your stack in the market: we are a brazilian telecom company and we are
starting to use your stack to develop a network management application for
managing our products.

Well the question is the following: I noticed an exception in my code where
a calling to the BlockPdu.getResponseVariableBindings() method returns a
null and does not throws anything. If I am not mistaken, the Pdu was of type
GET_NEXT. I cant see any situation in that a get response can return a null
varbind without any error. Do you know if it may happen? If yes, in what
s