Sjoerd van Doorn | 1 Mar 2009 22:43
Picon
Favicon

Timeout question (Follow up)

Hello all,
 
I think I figured out what my problem is. The Network Elements I am querying (multithreaded) use an
identical (e.g. non unique) authoritiveEngineID. The internal administration of the USM stores both
UsmUserEntry and UsmTimeEntry based on the authoritiveEngineID.
I am aware that this is not according to RFC 3414, but there is nothing I can do about it.
Since the Network elements are also managed by others than me and changing the authoritiveEngineID would
require regenerating all the access information for the other users, this is not the way to go.
I'm thinking about adding the target address as extra parameter to both the user and time table in the USM to
make the SNMP4J library capable of handling non unique authoritiveEngineID's.
Please let me know if I'm the only one having problems like this or (hopefully) anyone else has encountered
the same kind of problems and has a fix for it already.
Also, if you think I'm missing anything in my analysis of the code to be modified, please let me know.
 
Thanks in advance and best regards,
 
Sjoerd

--- On Fri, 2/27/09, Sjoerd van Doorn <sjoerdvandoorn@...> wrote:

From: Sjoerd van Doorn <sjoerdvandoorn@...>
Subject: Timeout question
To: "SNMP4j" <snmp4j@...>
Date: Friday, February 27, 2009, 12:07 PM

Hello, 
 
I am using the v1.3.9c version of the library on a openSolaris platform we are setting and getting SNMP
variables on appr. 40 devices that use snmp tables for the entries. 
Every now and then, the GetNext call times out for a reason I can't seem to figure out.
(Continue reading)

ouaddari | 2 Mar 2009 13:11

JmxTestAgent request time out

Hello,

I'm trying to run the example of agent JMX de SNMP4J delivered in the 
snmp4j-agent-jmx package.  I have a request time out on GET requests.
Is there any configuration i have to do in snmpd.conf file.

Thanks for yout Help.

BR
Rajae
Sjoerd van Doorn | 3 Mar 2009 23:35
Picon
Favicon

Why is the USM a singleton ?

Hello all,
 
I'm working on an issue and I suspect the fact that the USM is a singleton, is part of the reasons I'm having problems.
Can someone explain why not have an instance of the USM for every MPv3 instance ?
 
My problem is having timeouts, usmStatsNotInTime, usmUnknownEngineId and MessageException (1404)
every now and then.
I'm in a network with 200+ elements and I already have seen that the autoritiveEngineId of the elements is
not unique, however I cannot have them changed for my purpose (I am aware that this is against RFC 3414)
The issues show when in parallel (multithreaded) querying appr. 15 devices.(I'll post a snipped at the end
of my mail.
 
I suspect the internal administration of the USM is broken due to the fact that the engineID is non-unique
and that this is causing my errors.
 
After analysing the code for a couple of days and going through the previous posts, I can see more people are
having these kind of problems, however I could not find any solution.
I'm thinking that a modification of the USM from a singleton to a instance per MPv3 could solve the problem,
but I can't realy oversee why it is designed as a singleton from the beginning. 
 
Here is my code (executed by 15 threads in parallel in synchronous mode.
 
private final Snmp4jAgent _agent;

private final String _requestType;

protected SnmpCommand(Snmp4jAgent agent, String requestType){
  _agent = agent;
_requestType = requestType;
initSecurityModels(createUSM());
(Continue reading)

Sjoerd van Doorn | 3 Mar 2009 23:39
Picon
Favicon

Resent (full code now): Why is the USM a singleton ?


--- On Tue, 3/3/09, Sjoerd van Doorn <sjoerdvandoorn@...> wrote:

From: Sjoerd van Doorn <sjoerdvandoorn@...>
Subject: Why is the USM a singleton ?
To: "SNMP4j" <snmp4j@...>
Date: Tuesday, March 3, 2009, 10:35 PM

Hello all,
 
I'm working on an issue and I suspect the fact that the USM is a singleton, is part of the reasons I'm having problems.
Can someone explain why not have an instance of the USM for every MPv3 instance ?
 
My problem is having timeouts, usmStatsNotInTime, usmUnknownEngineId and MessageException (1404)
every now and then.
I'm in a network with 200+ elements and I already have seen that the autoritiveEngineId of the elements is
not unique, however I cannot have them changed for my purpose (I am aware that this is against RFC 3414)
The issues show when in parallel (multithreaded) querying appr. 15 devices.(I'll post a snipped at the end
of my mail.
 
I suspect the internal administration of the USM is broken due to the fact that the engineID is non-unique
and that this is causing my errors.
 
After analysing the code for a couple of days and going through the previous posts, I can see more people are
having these kind of problems, however I could not find any solution.
I'm thinking that a modification of the USM from a singleton to a instance per MPv3 could solve the problem,
but I can't realy oversee why it is designed as a singleton from the beginning. 
 
Here is my code (executed by 15 threads in parallel in synchronous mode.
 
(Continue reading)

Frank Fock | 4 Mar 2009 00:07
Favicon

Re: Resent (full code now): Why is the USM a singleton ?

Hello Sjoerd,

First, for 200+ elements using a single thread with async
response processing will be sufficient. With 15 threads
each creating a Snmp instance, you waist resources and
probably run into problems with port allocation on your
system. The thread context switches are also expensive,
unless you have 16 CPUs.

The USM is NOT a singleton! The problem with your code
is, that you have 15 (or more) Snmp instances with the
same engine ID. Just create a different engine ID for
each instance.

BTW, creating a Snmp instance is expensive. I would
always share an instance if possible.

Best regards,
Frank

Sjoerd van Doorn wrote:
> 
> --- On Tue, 3/3/09, Sjoerd van Doorn <sjoerdvandoorn@...> wrote:
> 
> From: Sjoerd van Doorn <sjoerdvandoorn@...>
> Subject: Why is the USM a singleton ?
> To: "SNMP4j" <snmp4j@...>
> Date: Tuesday, March 3, 2009, 10:35 PM
> 
> 
(Continue reading)

Lambertus Setiawan Wardana | 4 Mar 2009 04:18
Picon

SNMP4J with Apache Axis2

Hello everyone,

I'm new in SNMP world, and i need some help from you guys to solve the 
problem that i have these past few days. I am doing a project about 
publishing SNMP protocol to web service by using Apache Web Axis2. The 
problem comes when i want to run it. FYI I am using Java as the 
language, Eclipse 3.3 as the IDE, Apache 5.5 as the web server and axis2 
1.4 as the web service.

This is my workaround with SNMP4J:

package nms;
import java.io.IOException;

import org.snmp4j.CommunityTarget;
import org.snmp4j.PDU;
import org.snmp4j.Snmp;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.mp.SnmpConstants;
import org.snmp4j.smi.Address;
import org.snmp4j.smi.GenericAddress;
import org.snmp4j.smi.OID;
import org.snmp4j.smi.OctetString;
import org.snmp4j.smi.VariableBinding;
import org.snmp4j.transport.DefaultUdpTransportMapping;

public class SnmpServer {

    public String getSnmp(String ip, String oid, String comm, int ver, 
long timeout)throws IOException
(Continue reading)

Poongkodi Chelliah | 4 Mar 2009 07:36
Favicon

Having problems with sending a trap

Hi,

I have been using SNMP4J for agent implementation. When I initially tried with a sample, everything worked
fine. I could send the trap and receive it on a third-party NMS manager.

But recently, I am having trouble sending the trap. The notificationOrginator.notify method does not
throw any error. But I could receive the trap neither on the manager nor on the packet captures. Could any of
you throw some light on this? I am using SNMPv2C. And I doubt if my mib definition influences such errors.
Kindly help.

Thanks,
Poongs

________________________________
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to
whom it is addressed. It may contain privileged or confidential information and should not be circulated
or used for any purpose other than for what it is intended. If you have received this message in
error,please notify the originator immediately. If you are not the intended recipient, you are notified
that you are strictly prohibited from using, copying, altering, or disclosing the contents of this
message. Aricent accepts no responsibility for loss or damage arising from the use of the information
transmitted by this email including damage from virus."
Poongkodi Chelliah | 4 Mar 2009 09:27
Favicon

RE: Having problems with sending a trap

Hi,
I have got the problem resolved. The reason was, I had set the context as "public" whereas it should be "" for SNMPv2C.

Thanks,
poongs

-----Original Message-----
From: snmp4j-bounces@...
[mailto:snmp4j-bounces@...] On Behalf Of Poongkodi Chelliah
Sent: Wednesday, March 04, 2009 12:07 PM
To: snmp4j@...
Subject: [SNMP4J] Having problems with sending a trap

Hi,

I have been using SNMP4J for agent implementation. When I initially tried with a sample, everything worked
fine. I could send the trap and receive it on a third-party NMS manager.

But recently, I am having trouble sending the trap. The notificationOrginator.notify method does not
throw any error. But I could receive the trap neither on the manager nor on the packet captures. Could any of
you throw some light on this? I am using SNMPv2C. And I doubt if my mib definition influences such errors.
Kindly help.

Thanks,
Poongs

________________________________
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to
whom it is addressed. It may contain privileged or confidential information and should not be circulated
or used for any purpose other than for what it is intended. If you have received this message in
(Continue reading)

Sjoerd van Doorn | 4 Mar 2009 12:18
Picon
Favicon

Re: Resent (full code now): Why is the USM a singleton ?

Frank,
 
Rewriting to ASYNC would mean a redesign of an implementation that has run Ok for over a year (meaning a very
big risk I would like to avoid). The only difference we have is that we switched to a new system (from dual
core Sparc to 2X4=8 core intel).
Since this new machine is installed we get the issues as described.
I am Aware the context switches are expensive, however I can live with that.
I do not understand why creating the SNMP object would be very expensive, besides the socket creation. 
I did a test with a single threaded approach and it takes about 4 seconds to complete all gets and sets on all
elements. I'm afraid this time gap will be to long when scaling up to 50 or more devices.
The enigineID that is non unique is the engineID of the network element, and I cannot control these.
 
At this moment, I am NOT looking for a performance increase, but a fix to avoid these errors that have arised
since I installed a more parallel hw system. I susspect the global table in combination of the non unique
authoritiveID to be the cause.
 
As far as I can see, there is only one USM for all SNMP objects and within this USM the user and time tables are
stored indexed on the (in my case non-unique) authoritive engine ID. Where am I missing it ?
 
Regards,
 
Sjoerd

--- On Tue, 3/3/09, Frank Fock <fock@...> wrote:

From: Frank Fock <fock@...>
Subject: Re: [SNMP4J] Resent (full code now): Why is the USM a singleton ?
To: sjoerdvandoorn@...
Cc: "SNMP4j" <snmp4j@...>
Date: Tuesday, March 3, 2009, 11:07 PM
(Continue reading)

bang bang | 4 Mar 2009 18:19
Picon

Help needed for SNMP over TCP

I am trying to send out the SNMP V2c trap using SNMP4J. The code which is
trying to do the same is given below. The same code is working fine for UDP
but returns null response for TCP. Can someone please help me to find the
missing point here?

Thanks in advance.
CB

package com.test;
import java.net.InetAddress;
import java.util.ArrayList;
import org.snmp4j.CommunityTarget;
import org.snmp4j.PDU;
import org.snmp4j.PDUv1;
import org.snmp4j.Snmp;
import org.snmp4j.Target;
import org.snmp4j.TransportMapping;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.mp.SnmpConstants;
import org.snmp4j.smi.Address;
import org.snmp4j.smi.Integer32;
import org.snmp4j.smi.OID;
import org.snmp4j.smi.OctetString;
import org.snmp4j.smi.TcpAddress;
import org.snmp4j.smi.TimeTicks;
import org.snmp4j.smi.TransportIpAddress;
import org.snmp4j.smi.UdpAddress;
import org.snmp4j.smi.VariableBinding;
import org.snmp4j.transport.DefaultTcpTransportMapping;
import org.snmp4j.transport.DefaultUdpTransportMapping;
(Continue reading)


Gmane