Repost: [SNMP4J] Problem receiving traps

Mauricio Reyes maure5 at hotmail.com
Mon Apr 18 21:17:13 CEST 2005


Hello Frank,

I have tryied without launching another thread, but I get the same result. I 
only receive 4 traps, and then it stops processing them. They are received 
but, after seeing the log trace, traps are received but in a diferent time 
window. I also tryied the newest version, but I get the same bahaviour. This 
is what is logged (refer to my last post for more information):

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

Thanks a lot for your attention.

>From: Frank Fock <fock at agentpp.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 20:10:15 +0200
>
>Hi Mauricio,
>
>Please find my comments inline:
>
>Mauricio Reyes wrote:
>
>>
>>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
>
>Why are your running a thread for receiving messages? The transport
>mapping already runs such a thread, there is no need to start an extra one.
>
>>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();
>>    }
>>  }
>>
>So, the thread dies right after it started the transport mapping's listen 
>thread.
>Since the latter one is a daemon, it stops when your thread above stops.
>
>>I just call the listen method as in the SnmpRequest file. Would all the 
>>code help?
>>
>No. See above. What you did different is to run the extra thread.
>
>>I haven't been able to trace the error. What could change from using this 
>>in a thread and using it as in SnmpRequest?
>>
>See above.
>
>Best regards,
>Frank
>
>

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/




More information about the SNMP4J mailing list