Repost: [SNMP4J] Problem receiving traps

Mauricio Reyes maure5 at hotmail.com
Mon Apr 18 19:00:43 CEST 2005


Hello Noel,

I have enabled logging and I'm getting this  when the thread stops 
processing traps. Traps are reeceived, but there seems to be a problem with 
messeges being received in the time window. I don't know what could the 
diference be between using the tool as provided when downloaded or with what 
I'm tyingo to do. Why is the message not being in the time window? Could it 
be that it takes time to process, and if so, how can I solve it?

I also tryied the latest version with the thread only receiving 4 traps.

This is what I get:

202125 [Thread-12] DEBUG org.snmp4j.transport.DefaultUdpTransportMapping  - 
Rece
ived message from /127.0.0.1/1600 with length 200: 
30:81:c5:02:01:03:30:0f:02:02
:58:32:02:03:00:ff:e3:04:01:03:02:01:03:04:35:30:33:04:09:80:00:13:70:01:c0:a8:7
7:fa:02:01:00:02:02:00:b4:04:07:6e:62:61:74:65:73:74:04:0c:d8:c2:bc:69:d8:0c:15:
54:4e:fa:0d:91:04:08:00:00:00:01:50:10:4a:47:04:78:98:6b:1a:b9:25:75:23:0d:24:1c
:8d:c2:da:fd:69:f0:f0:b1:04:db:65:30:41:2a:6a:81:c3:ec:e5:57:a5:4b:5b:00:12:5a:5
d:c6:fe:02:f7:a5:99:33:aa:f7:f9:84:8d:dd:9a:fd:d7:ab:6b:ba:5e:81:ad:42:55:b0:9a:
bb:90:07:cf:0a:4f:ca:a2:07:74:30:6a:fe:4d:ca:d2:73:a3:20:ab:7d:cd:dd:bd:26:c7:72
:96:a7:f5:4e:43:cf:ab:75:3e:b8:fd:46:6b:54:20:8d:0c:e1:12:07:73:f1:d9:85:fa:f6:9
a:3d:f5:e8
202125 [DispatcherPool.0] DEBUG org.snmp4j.mp.MPv3  - SNMPv3 header decoded: 
msg
Id=22578, msgMaxSize=65507, msgFlags=03, secModel=3
202125 [DispatcherPool.0] DEBUG org.snmp4j.security.USM  - 
getUser(engineID=80:0
0:13:70:01:c0:a8:77:fa, securityName=nbatest)
202203 [DispatcherPool.0] DEBUG org.snmp4j.security.AuthGeneric  - MD5First 
dige
st: c5:d2:61:a8:c4:5a:9b:af:d8:ff:6a:9b:30:42:55:66
202203 [DispatcherPool.0] DEBUG org.snmp4j.security.AuthGeneric  - 
MD5localized
key: b9:e3:23:7e:1b:23:31:b1:69:f4:8b:c0:48:23:91:91
202281 [DispatcherPool.0] DEBUG org.snmp4j.security.AuthGeneric  - MD5First 
dige
st: c5:d2:61:a8:c4:5a:9b:af:d8:ff:6a:9b:30:42:55:66
202281 [DispatcherPool.0] DEBUG org.snmp4j.security.AuthGeneric  - 
MD5localized
key: b9:e3:23:7e:1b:23:31:b1:69:f4:8b:c0:48:23:91:91
202281 [DispatcherPool.0] DEBUG org.snmp4j.security.UsmUserTable  - Adding 
user
nbatest = 
UsmUser[secName=nbatest,authProtocol=1.3.6.1.6.3.10.1.1.2,authPassphra
se=null,privProtocol=1.3.6.1.6.3.10.1.2.2,privPassphrase=null]
202281 [DispatcherPool.0] DEBUG org.snmp4j.security.UsmTimeTable  - 
CheckTime: r
eceived message outside time window (authorative)
202281 [DispatcherPool.0] DEBUG org.snmp4j.security.USM  - RFC3414 º3.2.7.a 
Not
in time window
202281 [DispatcherPool.0] WARN org.snmp4j.MessageDispatcherImpl  - 
1.3.6.1.6.3.1
5.1.1.2.0 = 1

>From: Noel Grandin <noel at peralex.com>
>To: Mauricio Reyes <maure5 at hotmail.com>
>CC: snmp4j at agentpp.org
>Subject: Re: Repost: [SNMP4J] Problem receiving traps
>Date: Mon, 18 Apr 2005 08:51:42 +0200
>
>
>Your code looks fine, the only thing I can suggest now is too enable the 
>SNMP logging and see if it complains about anything.
>
>import org.apache.log4j.Level;
>import org.apache.log4j.Logger;
>import org.snmp4j.log.Log4jLogFactory;
>import org.snmp4j.log.LogFactory;
>
>...
>
>// SNMP logging
>LogFactory.setLogFactory(new Log4jLogFactory());
>Logger.getRootLogger().setLevel(Level.DEBUG);
>
>
>Mauricio Reyes wrote:
>>
>>Hello Noel,
>>
>>I have tested the SNMP4J tool without any modification, configured to 
>>listen to traps from the snmpd demon, printed to the console. And it works 
>>fine. The traps are received as expected. But in my application it stops 
>>receiving. Basically I build a class that launches two threads one to send 
>>and another to listen form traps. What the class does is do some 
>>calculations and draw some information in a JFrame. I don't know if this 
>>is why it stops working. The run method in the thread is like this:
>>
>>public void run()
>>  {
>>    try
>>    {
>>        if (operation == LISTEN)
>>        {
>>          listen();
>>        }
>>    }
>>    catch (IOException ex)
>>    {
>>        System.err.println("Error escuchando solicitud Traps: " + 
>>ex.getMessage());
>>        ex.printStackTrace();
>>    }
>>  }
>>
>>I just call the listen method as in the SnmpRequest file. Would all the 
>>code help?
>>
>>I haven't been able to trace the error. What could change from using this 
>>in a thread and using it as in SnmpRequest?
>>
>>Thanks.
>>Mauricio
>>
>>>From: Noel Grandin <noel at peralex.com>
>>>To: Mauricio Reyes <maure5 at hotmail.com>
>>>CC: snmp4j at agentpp.org
>>>Subject: Re: Repost: [SNMP4J] Problem receiving traps
>>>Date: Fri, 15 Apr 2005 07:58:34 +0200
>>>
>>>
>>>Try running ethereal and capturing packets to trace the activity.
>>>
>>>Mauricio Reyes wrote:
>>>
>>>>
>>>>Hello,
>>>>
>>>>I don't think the thread dies. Because when I shut down the snmpd demon 
>>>>and bring it up again I start to receive traps again. It seems to 
>>>>receive only 4 traps and then stops receiving.
>>>>
>>>>I have no idea what's happening.
>>>>
>>>>>From: Noel Grandin <noel at peralex.com>
>>>>>To: Mauricio Reyes <maure5 at hotmail.com>
>>>>>CC: snmp4j at agentpp.org
>>>>>Subject: Re: Repost: [SNMP4J] Problem receiving traps
>>>>>Date: Thu, 14 Apr 2005 08:18:24 +0200
>>>>>
>>>>>Maybe the thread died?
>>>>>
>>>>>If you are running an older JDK you may not see the stack trace if 
>>>>>something goes wrong.
>>>>>In newer JDKs you can install an "uncaught exception handler" on a 
>>>>>Thread.
>>>>>
>>>>>Mauricio Reyes wrote:
>>>>>
>>>>>>
>>>>>>Hello,
>>>>>>
>>>>>>The problem keeps on going. Can anyone help me?
>>>>>>
>>>>>>Thanks a lot.
>>>>>>
>>>>>>>From: "Mauricio Reyes" <maure5 at hotmail.com>
>>>>>>>To: snmp4j at agentpp.org
>>>>>>>Subject: [SNMP4J] Problem receiving traps
>>>>>>>Date: Sun, 10 Apr 2005 22:04:55 +0000
>>>>>>>
>>>>>>>
>>>>>>>Hello,
>>>>>>>
>>>>>>>I've been having some trouble receiving traps from net-snmp. The 
>>>>>>>sitiuation is like this: the snmpd demon registers an alarm to send a 
>>>>>>>trap every 60 seconds, and it works fine (snmptrapd receives the 
>>>>>>>traps every minute). The thing is that SNMP4J recieves two traps and 
>>>>>>>then it seems to stop receiveing traps. I don't know why this 
>>>>>>>happens. I'm running a thread that is in charge of receiving the 
>>>>>>>traps.
>>>>>>>
>>>>>>>Thanks a lot for your collaboration.
>>>>>>>
>>>>>>>Mauricio.
>>>>>>>
>>>>>>>_________________________________________________________________
>>>>>>>Express yourself instantly with MSN Messenger! Download today it's 
>>>>>>>FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>>>>>>>
>>>>>>>_______________________________________________
>>>>>>>SNMP4J mailing list
>>>>>>>SNMP4J at agentpp.org
>>>>>>>http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>_________________________________________________________________
>>>>>>Express yourself instantly with MSN Messenger! Download today it's 
>>>>>>FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>>>>>>
>>>>>>_______________________________________________
>>>>>>SNMP4J mailing list
>>>>>>SNMP4J at agentpp.org
>>>>>>http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>>>>
>>>>>
>>>>>
>>>>>NOTICE: Please note that this email, and the contents thereof, are 
>>>>>subject to the standard Peralex email disclaimer, which may be found 
>>>>>at: http://www.peralex.com/disclaimer.html
>>>>>
>>>>>If you cannot access the disclaimer through the URL attached and you 
>>>>>wish to receive a copy thereof please send an email to 
>>>>>email at peralex.com
>>>>
>>>>
>>>>
>>>>_________________________________________________________________
>>>>Don't just search. Find. Check out the new MSN Search! 
>>>>http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>>>>
>>>>
>>>
>>>
>>>NOTICE: Please note that this email, and the contents thereof, are 
>>>subject to the standard Peralex email disclaimer, which may be found at: 
>>>http://www.peralex.com/disclaimer.html
>>>
>>>If you cannot access the disclaimer through the URL attached and you wish 
>>>to receive a copy thereof please send an email to email at peralex.com
>>
>>
>>_________________________________________________________________
>>Express yourself instantly with MSN Messenger! Download today it's FREE! 
>>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>>
>>
>
>
>NOTICE: Please note that this email, and the contents thereof, are subject 
>to the standard Peralex email disclaimer, which may be found at: 
>http://www.peralex.com/disclaimer.html
>
>If you cannot access the disclaimer through the URL attached and you wish 
>to receive a copy thereof please send an email to email at peralex.com

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the SNMP4J mailing list