[SNMP4J] Variable Binding maximum size (255 bytes)

Frank Fock fock at agentpp.com
Sun Apr 16 23:46:58 CEST 2006


Hi Rey,

It's the agent that has to limit the string returned for
sysDescr.0 to 255 bytes, because the DisplayString
textual convention is specified that way. There
absolutely nothing you can do to change this (at least
on the manager side).

The string is dumped in hex-format, because it
contains non-printable characters. To obtain
a String instance (using the default character set) from
it use:

String s = new String(octetString.getValue);

Best regards,
Frank

PIPPO IMPELLIZZERI wrote:
> ---------- Forwarded message ----------
> From: PIPPO IMPELLIZZERI <cazzalora at gmail.com>
> Date: Apr 12, 2006 2:36 PM
> Subject: Re: [SNMP4J] Variable Binding maximum size (255 bytes)
> To: Frank Fock <fock at agentpp.com>
>
>  hi Frank, thaks for the quick reply.
>
> this is the code that I used (more or less):
> ------------------------------------------------------------------------------------
> deviceInfoVB = new VariableBinding ( 1,3,6,1,2,1,1,1 );
> pdu.add(deviceInfoVB);
> pdu.setType(PDU.GETNEXT);
> response = snmp.send(pdu, comtarget);
> PDU responsePDU = response.getResponse();
> ------------------------------------------------------------------------------------
> and this is the answer from the router (i don't know why the method
> .toString of the VariableBinding show hexadecimal data instead of normal
> text):
>
> Response PDU is: requestID=428758844, errorStatus=Success(0),
>  errorIndex=0, VBS[1.3.6.1.2.1.1.1.0 =
> 43:69:73:63:6f:20:49:6e:74:65:72:6e:65:74:77:6f:72:6b:20:4f:70:65:72:61:74:69:6e:67:20:53:
> 79:73:74:65:6d:20:53:6f:66:74:77:61:72:65:20:0d:0a:49:4f:53:20:28:74:6d:29:20:34:35:30:30:
>
> 20:53:6f:66:74:77:61:72:65:20:28:43:34:35:30:30:2d:4a:53:35:36:49:2d:4d:29:2c:20:56:65:72:
> 73:69:6f:6e:20:31:31:2e:33:28:31:31:62:29:54:32:2c:20:20:52:45:4c:45:41:53:45:20:53:4f:46:
> 54:57:41:52:45:20:28:66:63:31:29:0d:0a:54:41:43:20:53:75:70:70:6f:72:74:3a:20:68:74:74:70:
>
> 3a:2f:2f:77:77:77:2e:63:69:73:63:6f:2e:63:6f:6d:2f:74:61:63:0d:0a:43:6f:70:79:72:69:67:68:
> 74:20:28:63:29:20:31:39:38:36:2d:32:30:30:32:20:62:79:20:63:69:73:63:6f:20:53:79:73:74:65:
> 6d:73:2c:20:49:6e:63:2e:0d:0a:43:6f:6d:70:69:6c:65:64:20:4d:6f:6e:20:31:31:2d:46:65:62:2d:
>
> 30:32:20:32:33:3a:31:35:20:62:79:20:63:63:61
>
> from 43:69:73: ... to  .... 63:63:61 are exactly 255 bytes
>
> the hexadecimal data means:
>
> "Cisco Internetwork Operating System Software
> IOS (tm) 4500 Software (C4500-JS56I-M), Version 11.3(11b)T2,  RELEASE
> SOFTWARE (fc1)
> TAC Support: http://www.cisco.com/tac
> Copyright (c) 1986-2002 by cisco Systems, Inc.
> Compiled Mon 11-Feb-02 23:15 by cca" [broken]
>
> I was also wondering if is there a easy way to "convert" this
> hexadecimal data into a String.
>
>
> thanks
> Rey
>
>
>
>
> On 4/12/06, Frank Fock <fock at agentpp.com> wrote:
>   
>> Hi,
>>
>> SNMP4J can process PDU up to 64KB by default. Can you post
>> the "broken" information you get?
>>
>> Best regards,
>> Frank
>>
>> PIPPO IMPELLIZZERI wrote:
>>     
>>>  I was tryng to query a CISCO device to retrieve the IOS version using
>>> snmp4j with the
>>>  follow VariableBinding  { 1,3,6,1,2,1,1,1}
>>>
>>>
>>>  iso (1) . org (3) . dod (6) . internet (1) . mgmt (2)
>>>    |
>>>     - -- mib-2 (1)
>>>       |
>>>        - -- system (1)
>>>       |      |
>>>       |      | --   sysDescr (1) object Details
>>> <http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=sysDescr
>>>
>>>
>>>  Everything works good, but the response PDU that I receive with a lot
>>>       
>> of
>>     
>>> information is "broken".
>>>  I guess that there is a maximum size for the VariableBinding  inside
>>>       
>> the
>>     
>>> PDU of 255 bytes.
>>>  Is there a way to obtain a PDU response big enough to hold all the
>>> information sendend from the router ?
>>>
>>>
>>>  thanks,
>>>  Rey
>>> _______________________________________________
>>> SNMP4J mailing list
>>> SNMP4J at agentpp.org
>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>       
>> --
>> AGENT++
>> http://www.agentpp.com
>> http://www.mibexplorer.com
>> http://www.mibdesigner.com
>>
>>
>>     
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>   





More information about the SNMP4J mailing list