[SNMP4J] About SNMP4J

Mauricio Reyes maure5 at hotmail.com
Tue Mar 8 02:25:23 CET 2005


Hello,

I can't seem to find the problem. I tried your solution but I got another 
error (like the one above), so I thought that maybe I was doing something 
wrong. So I decided to try another approach. I'm not configuring any 
engineID (on SNMP4J or net-snmp), so that it is discovered.

I have this new settings in snmptrapd.conf file:
engineID TESTED
createUser nbatest MD5 nbaprueba DES nbaprueba

Within net-snmp it works fine I can send v3 traps from snmpd demon and they 
are received as expected. But when I run SNMP4J with this options in the 
snmptrapd demon:
snmptrapd -f -Le -d -m ALL -Dusm

I get this:
usmUser: created a new user nbatest at 80 00 1F 88 04 54 45 53 54 45 44

2005-03-07 20:19:23 NET-SNMP version 5.2.1 Started.

Received 61 bytes from UDP: [127.0.0.1]:1978
0000: 30 3B 02 01  03 30 11 02  04 0E 81 6B  78 02 03 00    0;...0.....kx...
0016: FF FF 04 01  04 02 01 03  04 10 30 0E  04 00 02 01      ........0.....
0032: 00 02 01 00  04 00 04 00  04 00 30 11  04 00 04 00    ..........0.....
0048: A0 0B 02 01  00 02 01 00  02 01 00 30  00             á..........0.

usm: USM processing begun...
usm: Unknown Engine ID.
usm: USM processing has begun (offset 47)
usm: getting user
usm: USM processing completed.

Sending 100 bytes to UDP: [127.0.0.1]:1978
0000: 30 62 02 01  03 30 11 02  04 0E 81 6B  78 02 03 00    0b...0.....kx...
0016: FF E3 04 01  00 02 01 03  04 1B 30 19  04 0B 80 00    
 π........0.....
0032: 1F 88 04 54  45 53 54 45  44 02 01 01  02 01 03 04    ...TESTED.......
0048: 00 04 00 04  00 30 2D 04  0B 80 00 1F  88 04 54 45    .....0-.......TE
0064: 53 54 45 44  04 00 A8 1C  02 01 00 02  01 00 02 01    STED..¿.........
0080: 00 30 11 30  0F 06 0A 2B  06 01 06 03  0F 01 01 04    .0.0...+........
0096: 00 41 01 01                                           .A..


Received 309 bytes from UDP: [127.0.0.1]:1978
0000: 30 82 01 31  02 01 03 30  11 02 04 0E  81 6B 79 02    0é.1...0.....ky.
0016: 03 00 FF FF  04 01 07 02  01 03 04 36  30 34 04 0B    ..  .......604..
0032: 80 00 1F 88  04 54 45 53  54 45 44 02  01 00 02 01    .....TESTED.....
0048: 01 04 07 6E  62 61 74 65  73 74 04 0C  B8 83 F4 92    
...nbatest..╕â⌠Æ
0064: 9B 2B DE 84  FC F0 8E 7B  04 08 00 00  00 00 BB 0B    
¢+▐äⁿ≡Ä{......╗.
0080: 7D 48 04 81  E0 B9 0B 7D  FD D0 73 A3  BE C7 71 36    
}H..α╣.}²╨sú╛╟q6
0096: 17 80 97 B2  AA AF 64 DC  7A 6B CE 1A  7B 22 6E B5    
..ù▓¬»d▄zk╬.{"n╡
0112: 8B C1 0E 17  D2 71 58 AB  32 79 BA 8B  54 FB 72 A4    
ï┴..╥qX½2y║ïT√rñ
0128: 69 B7 83 EE  1C 25 4A 5A  11 98 A1 22  11 0F 07 18    
i╖âε.%JZ..í"....
0144: EB 6B B8 7C  49 C7 F5 AF  32 FF E6 29  0C 59 D7 4A    
δk╕|I╟⌡»2 µ).Y╫J
0160: FE 45 63 AA  DA A8 0B 01  2A 58 A8 92  7D 29 00 C8    
■Ec¬┌¿..*X¿Æ}).╚
0176: 2B E4 A6 F5  64 FE 59 22  28 52 3C E4  FB 6A 5A AB    
+Σª⌡d■Y"(R<Σ√jZ½
0192: 5D 8D 50 9F  43 96 F1 DE  E8 93 F0 C0  E4 54 46 60    
].PƒCû±▐Φô≡└ΣTF`
0208: 07 71 74 05  8E DD 8A C8  41 21 61 25  3C 00 11 19    
.qt.Ä▌è╚A!a%<...
0224: 67 88 1F B9  1F 18 B5 04  A8 E1 EE 03  66 7A BC 44    
g..╣..╡.¿ßε.fz╝D
0240: 62 92 C7 29  12 36 93 64  7B 59 F3 76  6D AD 10 A6    
bÆ╟).6ôd{Y≤vm¡.ª
0256: DB F8 64 FE  D9 FC DA CD  20 D9 7A 73  41 3D AA 59    
█°d■┘ⁿ┌═ ┘zsA=¬Y
0272: A6 F8 D3 16  A2 A5 A6 83  33 81 31 2B  92 7C 70 AD    
ª°╙.óѪâ3.1+Æ|p¡
0288: 69 71 A6 EC  EC 83 81 60  4F AD 07 2C  9C BF D1 E8    
iqª∞∞â.`O¡.,£┐╤Φ
0304: 41 AF 38 AB  F1                                       A»8½±

usm: USM processing begun...
usm: Verification succeeded.
usm: boot_uint 0 myBoots 1 time_diff 3 => not in time window
usm: USM processing has begun (offset 47)
usm: getting user nbatest
usm: USM processing completed.

Sending 119 bytes to UDP: [127.0.0.1]:1978
0000: 30 75 02 01  03 30 11 02  04 0E 81 6B  79 02 03 00    0u...0.....ky...
0016: FF E3 04 01  01 02 01 03  04 2E 30 2C  04 0B 80 00    
 π........0,....
0032: 1F 88 04 54  45 53 54 45  44 02 01 01  02 01 04 04    ...TESTED.......
0048: 07 6E 62 61  74 65 73 74  04 0C 27 64  73 5B 18 47    .nbatest..'ds[.G
0064: 34 4A 99 9C  F0 09 04 00  30 2D 04 0B  80 00 1F 88    4J.£≡      
  ..0-....
..
0080: 04 54 45 53  54 45 44 04  00 A8 1C 02  01 00 02 01    .TESTED..¿......
0096: 00 02 01 00  30 11 30 0F  06 0A 2B 06  01 06 03 0F    ....0.0...+.....
0112: 01 01 02 00  41 01 01                                 ....A..


Received 309 bytes from UDP: [127.0.0.1]:1978
0000: 30 82 01 31  02 01 03 30  11 02 04 0E  81 6B 7A 02    0é.1...0.....kz.
0016: 03 00 FF FF  04 01 07 02  01 03 04 36  30 34 04 0B    ..  .......604..
0032: 80 00 1F 88  04 54 45 53  54 45 44 02  01 01 02 01    .....TESTED.....
0048: 04 04 07 6E  62 61 74 65  73 74 04 0C  2B 56 1B DC    
...nbatest..+V.▄
0064: 13 49 09 03  42 0D B9 9E  04 08 00 00  00 01 BB 0B    .I  
.B.╣₧......╗.
0080: 7D 49 04 81  E0 FF 10 1B  1C 49 AF 66  95 B2 45 EB    
}I..α ...I»fò▓Eδ
0096: 4F F0 D8 D7  F0 A8 AC 25  D1 6A F1 5B  93 B1 D9 53    
O≡╪╫≡¿¼%╤j±[ô▒┘S
0112: A8 C5 C7 88  19 A5 7F 9D  D4 7C 70 9D  6D 03 6C 1E    
¿┼╟..Ñ..╘|p.m.l.
0128: 5D F1 EB 73  DA EC 9F E8  72 24 BD EC  53 23 C7 C1    
]±δs┌∞ƒΦr$╜∞S#╟┴
0144: A5 D4 87 2A  53 F3 59 77  D8 B0 F7 1D  F2 C3 A1 0B    
Ñ╘ç*S≤Yw╪░≈.≥├í.
0160: 2A E7 57 F0  FE E0 99 46  E4 B1 23 17  8D 38 4C B2    
*τW≡■α.FΣ▒#..8L▓
0176: DF 97 0D 2F  75 74 E0 57  68 0D 41 A9  A4 08 7F EE    
▀ù./utαWh.A⌐ñ..ε
0192: E6 AB 6B DB  C1 F7 61 D1  0E 7B 56 C1  73 BE 9B 3E    
µ½k█┴≈a╤.{V┴s╛¢>
0208: E7 6B 4C 00  62 61 0E F7  0C 8B 27 7B  ED AB D2 84    
τkL.ba.≈.ï'{φ½╥ä
0224: EF 05 D7 1A  44 81 54 11  85 79 74 B0  E4 57 DB 6B    
∩.╫.D.T.àyt░ΣW█k
0240: 35 E3 1F 07  00 83 40 EA  0D 5C 38 99  EB A3 F5 EE    
5π...â@Ω.\8.δú⌡ε
0256: 43 D1 F0 74  56 F3 15 A0  06 A8 AC CF  43 51 A8 C9    
C╤≡tV≤.á.¿¼╧CQ¿╔
0272: 47 6B 09 73  2A AA FA C5  A9 C4 6F C8  31 23 F0 A1    Gk  
s*¬·┼⌐─o╚1#≡í
0288: 2C 5F 36 3F  5E 54 CF 4C  F0 66 34 78  38 17 D9 0F    
,_6?^T╧L≡f4x8.┘.
0304: 46 99 C0 B5  2B                                       
F.└╡+

usm: USM processing begun...
usm: Verification succeeded.
usm: USM processing completed.

Received 309 bytes from UDP: [127.0.0.1]:1978
0000: 30 82 01 31  02 01 03 30  11 02 04 0E  81 6B 7B 02    0é.1...0.....k{.
0016: 03 00 FF FF  04 01 07 02  01 03 04 36  30 34 04 0B    ..  .......604..
0032: 80 00 1F 88  04 54 45 53  54 45 44 02  01 01 02 01    .....TESTED.....
0048: 07 04 07 6E  62 61 74 65  73 74 04 0C  A9 94 C5 F7    
...nbatest..⌐ö┼≈
0064: C8 A8 A2 3A  C8 D5 CA EC  04 08 00 00  00 01 BB 0B    
╚¿ó:╚╒╩∞......╗.
0080: 7D 4A 04 81  E0 9C F9 5D  72 B2 F6 4B  91 05 07 8A    
}J..α£∙]r▓÷Kæ..è
0096: C9 CB C4 FB  4F 3D 60 08  B7 7A 24 B0  3E E0 CB BD    
╔╦─√O=`.╖z$░>α╦╜
0112: 87 D3 F8 FB  0A 47 91 CF  4D 13 89 B3  8F 6E CB 7C    
ç╙°√.Gæ╧M.ë│.n╦|
0128: 96 0B B4 C1  63 17 3E 59  B7 CF 43 B6  A4 9F B9 56    
û.┤┴c.>Y╖╧C╢ñƒ╣V
0144: 3C 6A 76 2A  25 71 E0 00  C6 80 81 B4  DA 4B 08 F1    
<jv*%qα.╞..┤┌K.±
0160: DE F1 41 39  D7 58 4B 28  03 04 A0 9C  C2 D9 25 CB    
▐±A9╫XK(..á£┬┘%╦
0176: 1E 0C FC CA  8C B8 5C D8  57 DB E8 DC  1F 1C 36 24    
..ⁿ╩î╕\╪W█Φ▄..6$
0192: 60 0D 30 A0  D6 85 6B ED  CA BC 7E FD  D2 10 7C ED    
`.0á╓àkφ╩╝~²╥.|φ
0208: 73 BB 17 A3  34 D8 E3 69  5A A1 F4 57  9E B8 89 54    
s╗.ú4╪πiZí⌠W₧╕ëT
0224: 8D 52 4C 26  32 56 1D AE  16 53 78 4B  FB B4 3E 7A    
.RL&2V.«.SxK√┤>z
0240: 91 5E 56 30  80 4F 1D D6  B4 A5 9A 8C  EB BC 13 4D    
æ^V0.O.╓┤ÑÜîδ╝.M
0256: 92 35 79 58  45 B8 E6 E3  ED 99 B4 2C  00 51 27 36    
Æ5yXE╕µπφ.┤,.Q'6
0272: AC CD CE 76  55 34 04 B0  14 17 52 58  8D CB 13 EB    
¼═╬vU4.░..RX.╦.δ
0288: 66 00 E8 97  D3 4C 16 73  F3 8B CD E7  C5 8B 4A 63    
f.Φù╙L.s≤ï═τ┼ïJc
0304: 20 62 86 39  74                                        bå9t

usm: USM processing begun...
usm: Verification succeeded.
usm: USM processing completed.

But the trap is not printed to screen. I guess it arrives but something 
happens. I'm getting confused. I'd appreciate very much your help.

Thanks a lot for your collaboration.

Mauricio.

>From: Jochen Katz <katz at agentpp.com>
>To: snmp4j at agentpp.org
>Subject: Re: [SNMP4J] About SNMP4J
>Date: Mon, 07 Mar 2005 23:46:45 +0100
>
>Hello,
>
>>I modifyed the code to this:
>>if (version == SnmpConstants.version3)
> > [...]
>
>ok, now I got the error.... It is not sufficient to give the engineId to 
>the USM, it must be set on the MPv3 object, too:
>
>It will work, if you change the createSnmpSession function to:
>
>if (version == SnmpConstants.version3) {
>   byte[] tt = {01,02,03,04,05,06};
>   MPv3 mpv3 =
>       (MPv3)snmp.getMessageProcessingModel(MessageProcessingModel.MPv3);
>   mpv3.setLocalEngineID(tt);
>
>   USM usm = new USM(SecurityProtocols.getInstance(),
>                     new OctetString(mpv3.getLocalEngineID()), 0);
>   SecurityModels.getInstance().addSecurityModel(usm);
>   addUsmUser(snmp);
>}
>
>Command line:
>./SNMP4J-linux -d DEBUG -p TRAP -v 3 -u DES -a MD5 -A 12345678 -x DES 
>-X12345678 127.0.0.1/162 "1.3.6.1.2.1.1.3.0={t}0"
>
>trapd.conf:
>engineID TESTED
>createUser -e 010203040506 DES MD5 12345678 DES 12345678
>
>Command line snmptrapd:
>snmptrapd -d -f -n -C -c ./trapd.conf -Le -Dusm
>
>Regards,
>   Jochen
>_______________________________________________
>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/




More information about the SNMP4J mailing list