Jacques-Olivier Goussard | 3 Nov 2008 14:28
Picon

TestAgent: Unknown security name

Hi
I'm new to SNMP & SNMP4J and I'm trying to connect using SNMP3 to the
TestAgent (I'd like to experiment with contexts, so V3 is my target).
I'm using AuthPriv with the settings configured for MD5DES user, and I get
I get 'Unknown security name' when trying to connect. Looking at snm4j debug
logs,
I found
DEBUG - RFC3414 ยง3.2.4 Unknown security name: 4d:44:35:44:45:53
( 4d:44:35:44:45:53 is the ascii-hex for MD5DES)
I didn't touch the code of TestAgent (except for bumping the logging level
and modifying
the engine ID using the commented out code).
My client is the WinAgent-MIBBrowser from Tandem system.
I tried with ireasoning mibbrowser too and got the same result.
Any ideas ?
Thanks
         /jog
John Marks | 3 Nov 2008 22:14

Localized users and keys

snmp.discoverAuthoritativeEngineID() returns null every time I call it. I
have no idea why. First it threw an exception with a -1402 error code. I got
around that by making sure there was a dummy v3 security model in the
SecurityModels singleton. According to the doc, snmp4j is supposed to do the
discovery automatically, but that just doesn't seem to be happening.

I'm also wondering if there's bug here that prevents snmp4j from recovering
after an attempt to establish a v4 session fails because of a bad password.
John Marks | 4 Nov 2008 19:39

Localized users and keys

I finally figured out what I was missing. I needed to create new Smp and USM
instances, add the USM to SecurityModels, and then Snmp.listen() before
calling Snmp.discoverAuthoritativeEngineID().
dp dp | 4 Nov 2008 20:30
Favicon

Snmp similar Engine ID issue

I have a scenario where I need to communicate with 3 switches simultaneously using Snmp. the engine id on two
of the switches is the same.
As mentioned in the javadocs of Snmp class in Snmp4j java docs, all the steps have been followed. Everything
works properly too and I am able to communcate with each switch opening sessions to them simultaneously
and fetching data. I have three Snmp objects at the same time.

Now the problem arises when I reboot only one of the switches(a switch that shares the Snmp Engine ID with
another one). At this point of time, I always get a timeout error a Warn message on
DefaultUDPTransportMapping class. When I change the engine id's of each of the switches to unique
values, everything works fine all over again -> no matter which switch I reboot and this is exactly what I
want. But the only hitch is that I need the Snmp Engine ID for two switches to be the same.

My question is -> Does Snmp4j maintain any mapping between the Snmp Engine IDs? I see there are three engine
ids mentioned in the USM classes localEngineID, authorizationEngineID and just an engineID. Of what
significance are these? I read in one of the forum answers that one has to specify unique engine ids to avoid
the timeout window issue. If this was the case, how come the similar engine id's fetched data from all 3
switches for the first time? (I see the problem only after I reboot a single switch). So is it to do with a
reboot count and SnmpEngine ID combination.

I will be debugging the Snmp4j classes, in the meantime any pointers as to why this might have happened or any
inputs on which classes I should be mainly looking at will help. Please also let me know how Snmp4j uses the
Engine reboots and Engine IDs internally in brief for a better understanding. Will I be able to fetch data
from different switch where some share the same engine id, even though this is against what is being
mentioned by v3, yet will Snmp4J APIs support such a requirement? If so, where am I going wrong?

Thanks,
DP

--

-- 
_______________________________________________
(Continue reading)

dp dp | 5 Nov 2008 07:44
Favicon

Multiple Switch Issue


In continuation to my previous mail, I had a look at the USMTimeEntry and USMTimeTable classes and noticed
that the SnmpEngineID is used as the key for the hashtable. So if this is the case, then when I have three
unique engine id's I will have three entries in the table and there is no conflict. But when I have two unique
engine ids but 3 agents, then the table maintains two entries for the three agents and this is a possibility
of conflict. So if there was a conflict here, then my first question is that how did I get the right data the
first time?

My next question is that in the checkTime method, I notice these lines

if ((entry.getEngineBoots() < time.getEngineBoots()) || ((entry.getEngineBoots() ==
time.getEngineBoots()) &&
           (time.getTimeDiff() + now >  entry.getLatestReceivedTime() + 150)) ||     (time.getEngineBoots() ==
2147483647)) {
           return SnmpConstants.SNMPv3_USM_NOT_IN_TIME_WINDOW;
      }

What is time.getTimeDiff? entry.getLastReceivedTime? I assume that time refers to the existing value in
the hashtable and entry is a new entry that we are checking time for.

If I need to support similar SnmpEngine IDs, is manipulating the USMTimeTable to include the IPAddress
along with SnmpEngineID as unique key, a good idea? Or if I get this error is resetting the time a good idea?
This might not be good as per v3 specification though.

Please let me know your inputs on how I could support similar Snmp EngineIDs on multiple switches and me
having a simultaneous session to all of them -> so that the USMTimeTable would store each of this entry in
the hashtable? Any inputs would be very helpful for me.

Thanks in advance.

(Continue reading)

null null | 7 Nov 2008 20:09
Picon

problem receiving traps

Hi to all,

I have two small applications:

1) Sender: Application that sends traps continuously using a for loop.
2) Receiver: Application that receives the traps.

The Sender sends 1000 traps, but the Receiver is only receiving about 100
traps.

Am I doing something wrong?
(I'm in windows XP, if that's relevant)

Any help would be very welcomed.

Below is the code for both of the classes  (don't worry, the code is small):

/* *************************************************************************
*/
public class Sender {

    public static void main(String[] args) throws IOException {

        String receiverIPAddress = "10.52.8.223";
        String receiverPort = "162";
        String community = "symmpublic";
        String payload = "hello I'm the payload to send in each trap";

        AbstractTransportMapping transportMapping =
            new DefaultUdpTransportMapping();
(Continue reading)

John Marks | 7 Nov 2008 20:40

Has anyone seen a -1404 error during TreeUtils.getSubtree()?

This error indicates a PDU with the same transaction ID was received more
than once.
Anthony Alessi | 7 Nov 2008 22:40
Favicon

snmp()

Hello all,

            I am new to SNMP4J programming. I am trying to initialize Snmp
with the basic constructor. I can get it to work if I use the constructor
and specify the Transport Mapping. Searching though the Mailing List Archive
I came across a message from Frank:

Hi Afnan,

When using the Snmp() constructor you need to manually add the
MessageProcessingModels (MPV1,MPV2c, or MPv3) and
SecurityModels (USM) you want to use.

The current JavaDoc is wrong and will be fixed for the next release.

Best regards,
Frank

My Problem is that I can't see how to accomplish this in the JavaDocs.
Please help. I have included the relevant parts of my code below.

                        Address targetAddress = GenericAddress.parse("udp:"
+ addr + "/161");

                        TransportMapping transport = new
DefaultUdpTransportMapping();                     

                        snmp = new Snmp();                //This works when:
snmp = new Snmp(transport)         

(Continue reading)

vijay kumar katta | 8 Nov 2008 13:23
Picon

how to get started with snmp4j

hai
      i  simply downloaded snmp4j sources and library  and kept that folder
in my desk top!!
my problem is how to get started.
my intention for using Snmp is for develop a application to find band with
of the particular machine in the network and how much using!! like that..
iam using net beans IDE .
i confusing how to start coding or getting started.
                 ---> any jar file required to start application
                ----> how to start the coding
iam waiting for your reply
--

-- 
Thanks & Regards
vijay katta
+91-9346462165
Frank Fock | 9 Nov 2008 18:56
Favicon

Re: snmp()

Hello Anthony,

Like the JavaDoc for Snmp explains it:
If using the default constructor you need
to add a MessageDispatcher and the security
models yourself.

Best regards,
Frank

Anthony Alessi wrote:
> Hello all,
> 
>             I am new to SNMP4J programming. I am trying to initialize Snmp
> with the basic constructor. I can get it to work if I use the constructor
> and specify the Transport Mapping. Searching though the Mailing List Archive
> I came across a message from Frank:
> 
> Hi Afnan,
>  
> When using the Snmp() constructor you need to manually add the
> MessageProcessingModels (MPV1,MPV2c, or MPv3) and
> SecurityModels (USM) you want to use.
>  
> The current JavaDoc is wrong and will be fixed for the next release.
>  
> Best regards,
> Frank
>  
> 
(Continue reading)


Gmane