[SNMP4J] Error ASN.1 parse error: Wrong ASN.1 type. Not a string: 56 at position 3/ASN.1 parse error: Data length > 4 bytes are not supported!

Frank Fock fock at agentpp.com
Fri Mar 25 08:32:29 CET 2011


Hi,
You are trying to send a SNMPv1 PDU with V3 which is not allowed by the standard. SNMP4J tool should print an error message however. This will be fixed in the next release.
Best regards
Frank



Am 25.03.2011 um 07:51 schrieb "Sa, Rajashekhar (EXT-Other - IN/Bangalore)" <rajashekhar.sa.ext at nsn.com>:

> Hi,
> 
> 
> 
> Getting below exception when I try to send the trap using snmp4j tool
> 
> 
> 
> 1. SNMP4J.exe -p TRAP -v 3 -u test -a MD5 -A snmpbc1234 -x DES -P
> snmpbc1234 -l 0x80:22:06:0F:01:B4:90:03:2C 10.142.210.160/1612
> 1.3.6.1.2.1.1.3.0={t}1 1.3.6.1.6.3.1.1.4.1.0={o}1.3.6.1.2.1.34.4.0.1
> 1.3.6.1.2.1.34.4.1.6.2.1.12.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.13.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.14.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.15.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.16.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.17.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.18.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.19.'iStr'.'iStr'={i}4321
> 1.3.6.1.2.1.34.4.1.6.2.1.10.'iStr'.'iStr'={i}4321
> 
> 
> 
> 
> 
> WARN  - MPv3                           - ASN.1 parse error: Wrong ASN.1
> type. Not a string: 56 at position 3
> 
> java.io.IOException: Wrong ASN.1 type. Not a string: 56 at position 3
> 
>        at org.snmp4j.asn1.BER.decodeString(BER.java:705)
> 
>        at org.snmp4j.smi.OctetString.decodeBER(OctetString.java:151)
> 
>        at org.snmp4j.ScopedPDU.decodeBER(ScopedPDU.java:143)
> 
>        at org.snmp4j.mp.MPv3.prepareDataElements(MPv3.java:1092)
> 
>        at
> com.nsn.obs.mw.medfra.SNMPMsgDispatcherImpl.dispatchMessage(SNMPMsgDispa
> tcherImpl.java:59)
> 
>        at
> org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.ja
> va:347)
> 
>        at
> org.snmp4j.util.MultiThreadedMessageDispatcher$MessageTask.run(MultiThre
> adedMessageDispatcher.java:209)
> 
>        at
> org.snmp4j.util.ThreadPool$TaskManager.run(ThreadPool.java:239)
> 
> WARN  - SNMPMsgDispatcherImpl          - noError
> 
> 
> 
> 
> 
> 2. SNMP4J.exe -p TRAP -v 3 -u test -a MD5 -A snmpbc1234 -x DES -P
> snmpbc1234 -l 0x80:20:06:0F:01:B4:90:02:F0 10.142.210.160/1612
> 1.3.6.1.2.1.1.3.0={t}1
> 1.3.6.1.6.3.1.1.4.1.0={o}1.3.6.1.2.1.10.94.3.1.24.1.0.3
> 1.3.6.1.2.1.10.94.3.1.18.1.8.1234={i}4321
> 
> 
> 
> WARN  - MPv3                           - ASN.1 parse error: Data length
>> 4 bytes are not supported!
> 
> java.io.IOException: Data length > 4 bytes are not supported!
> 
>        at org.snmp4j.asn1.BER.decodeLength(BER.java:529)
> 
>        at org.snmp4j.asn1.BER.decodeHeader(BER.java:584)
> 
>        at org.snmp4j.asn1.BER.decodeHeader(BER.java:609)
> 
>        at org.snmp4j.ScopedPDU.decodeBER(ScopedPDU.java:141)
> 
>        at org.snmp4j.mp.MPv3.prepareDataElements(MPv3.java:1092)
> 
>        at
> com.nsn.obs.mw.medfra.SNMPMsgDispatcherImpl.dispatchMessage(SNMPMsgDispa
> tcherImpl.java:59)
> 
>        at
> org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.ja
> va:347)
> 
>        at
> org.snmp4j.util.MultiThreadedMessageDispatcher$MessageTask.run(MultiThre
> adedMessageDispatcher.java:209)
> 
>        at
> org.snmp4j.util.ThreadPool$TaskManager.run(ThreadPool.java:239)
> 
> WARN  - SNMPMsgDispatcherImpl          - noError
> 
> 
> 
> 
> 
> 
> 
> Regards,
> 
> Rajashekhar
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list