Re: Problem with hexvalue
- From: dperkins@xxxxxxxxxxxx
- Date: Thu, 7 Sep 2006 19:11:41 +0000
HI,
SNMP has a few base types. A base type is used in defining a
textual convention (TC). "MacAddress" is a TC using base data
type "OCTET STRING". Thus, when you get a value of an
object whose SYNTAX clause specifies "MacAddress", the
SNMP message will contain the value encoded as an
OCTET STRING. Your example below shows this.
If you want to do message decodes without the use
of MIB modules, then you will not be able to create
a "displayable version of a value" in many cases.
This is pretty basic SNMP.
PS. Please note that email address "snmpinfo@xxxxxxxxx"
is not email from domain "snmpinfo.com".
On Thu, 7 Sep 2006 snmpinfo@xxxxxxxxx wrote:
Hi,
I am developing an application which will receive the snmp packets and
decode the varbind value. My application is just decode the snmp packet
and show the varbind datatype and result. And my application doesn't
have the mib file.
For example if the incomming packet contains the varbind whose datatype
is macaddress this is encoded in 6 bytes. The tag value is 04 so I am
trying to decode the each octets and print the corresponding decimal
values.
say var bind is 04 06 30 56 57 45 ef 78 then my application print the
corresponding values of 30 , 56,57 values and not as 30 56 57 45 ef 78.
How to handle this case.
Please help out to resolve the same.
Thanks
Ravi.
cc_charles@xxxxxxxxx wrote:
The problem sounds like the manager doesn't understand the value type.
The manager uses the MIB to determine how to format return values. The
manager doesn't know that the return value is a display string (or
other type of value), therefore the manager is formatting the return
value as a hex string.
Try defining the value as a "DisplayString" (or some other type) in the
manager side MIB, and recompile the modified MIB into the management
program. Avoid using the OCTETSTRING type for MIB objects unless you
want back a string of hex values.
This should work.
snmpinfo@xxxxxxxxx wrote:
Hi ,
I have encoded the hexvalue as OCTETSTRING and while retrieving the
value in the agent side I face that the values are junk.
Is there any BER rules . If so, please let me know the same.
Thanks in Advance.
Regards,
/david t. perkins
.
- References:
- Re: Problem with hexvalue
- From: snmpinfo
- Re: Problem with hexvalue
- Prev by Date: Re: Problem with hexvalue
- Next by Date: Re: Open-Source Alert Notification?
- Previous by thread: Re: Problem with hexvalue
- Index(es):
Relevant Pages
|