[SNMP4J] Problem with hexadecimal results.

PHIL BERGSTRESSER phil.bergstresser at adtran.com
Thu Mar 24 00:51:03 CET 2005


Alfredo,

It's just a matter of interpretation. The textual convention for the sysDescr type is DisplayString from RFC2579. The definition there refers to RFC854 but simply said, your program is probably expecting printable characters in the returned varbinds, and they may not be. Some interpreters show the data in hex if they find ANY not printable characters in the object value, else may show it in ASCII. But the data on the wire is always hexadecimal (or binary to be accurate) and subject to interpretation. You have a null terminated string in the first example which is c programming convention, not SNMP. That 0x00 could turn off ASCII interpretation. The second example has 0x0d 0x0a (CR-LF) which MIGHT be considered not printable. 

In any case, you have to decide if the value suits your method of display if you are expecting ASCII printable characters only. The debug prints you see are just trying to make it clear for you to know what you got if there are hidden bytes that might not show up. 

More of the reality of network management complexity that shows again that SNMP is not so SIMPLE in practice.

HTH

Phil
Phil Bergstresser
Design Engineer
SNMP Network Management
ADTRAN, Inc.

 -----Original Message-----
From: 	snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org]  On Behalf Of Alfredo Rico
Sent:	Wednesday, March 23, 2005 5:14 PM
To:	SNMP4J at agentpp.org
Subject:	[SNMP4J] Problem with hexadecimal results.

Hello to everybody, grettings.

I have the following problem.  I am using snmp4j fot
send a GET pdu requesting for sysDescr object and
ifDescr column to some manageable devices. Some
devices respond with hexadecimal values and others not
( well, I mean snmp4j don't make this translation). 

Some device response sysDescr value with: 
sysDescr =
4d:53:20:54:43:50:20:4c:6f:6f:70:62:61:63:6b:20:69:
6e:74:65:72:66:61:63:65:00 
(MS TCP Loopback interface in ascii)

sysDescr =
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:43:32:39:30:30:58:4c:20:53:6f:66:74:77:61:72:65:20:28:43:32:39:30:30:58:4c:2d:43:33:48:32:53:2d:4d:29:2c:20:56:65:72:73:69:6f:6e:20:31:32:2e:30:28:35:29:58:55:2c: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:43:6f:70:79:72:69:67:68:74:20:28:63:29:20:31:39:38:36:2d:32:30:30:30: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:30:33:2d:41:70:72:2d:30:30:20:31:36:3a:33:37:20:62:79:20:73:77:61:74:69
in ascii:
Cisco Internetwork Operating System Software 
IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version
12.0(5)XU, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Mon 03-Apr-00 16:37 by swati

ifDescr =
4d:53:20:54:43:50:20:4c:6f:6f:70:62:61:63:6b:20:69:6e:74:65:72:66:61:63:65:00

in ascii:
MS TCP Loopback interface

I want to know how I could determine if the response
will coming in hexadecimal format in order to use some
translate mechanism to ascii.

Before kand thank you very much by your help.

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com
_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list