| Newsgroups |
gmane.network.net-snmp.user |
| Message-ID |
<[email protected]> |
----- Original Message -----
From: Dave Shield <[email protected]>
To: [email protected]
Subject: Re: about the hex-string
Date: 08-05-27 17:38:25
2008/5/27 <[email protected]>:
> Good all.
>
> I am a new expolder in net-snmp;
>
> I wirte a test mib and registered in the net-snmp lib,but where i run
> snmpwalk command,there are some problem:
>
> #snmpwalk -v 2c -c public localhost 1.3.6.1.4.1
[snip]
> In the handle functions they are ASN_OCTET_STR type.
>An "Octet String" is simply a string of octets.
>These could be printable characters, or binary data.
>The same ASN.1 type is used for both.
>The MIB file would normally include a DISPLAY HINT,
>to indicate how this value should be printed.
>In the absence of such a hint, the Net-SNMP library attempts
>to guess whether this is a printable string, or a binary value,
>based on the value returned.
> Please tell me how could the happen ?
>Looking at the value returned:
> iso.3.6.1.4.1.55555.1.1.1.10.1.2.1 = Hex-STRING: 4E 55 4C 4C 00 00 00 00 00
> 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>This contains four printable characters ("NULL"),
>followed by a large number of 0-valued octets, which
>are not printable. So the library has decided that this
>is a binary string value, and displayed it as such.
>It looks as if the code implementing this particular
>object has returned the full buffer holding the value,
>rather than just the printable value itself.
>I.e.
> snmp_set_var_typed_value(
> request->requestvb, ASN_OCTET_STR,
> myRow->myColumn, sizeof(myRow->myColumn));
>instead of
> snmp_set_var_typed_value(
> request->requestvb, ASN_OCTET_STR,
> myRow->myColumn, strlen(myRow->myColumn));
>If you use strlen, things should be OK.
>Dave
Yes ,thank you very much.There only a small problem on chinese.
When i use comand snmpwalk,there were often appear the informations:
iso.3.6.1.4.1.55555.1.1.7.1.0 = No more variables left in this MIB View (It is past the end of the MIB tree)
If i want not display this informations,what i should do.
Thanks!
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
-------------------------------------------------------------------
谷歌金山词霸 网民必备的免费翻译软件 下载( http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2008/mail_zhuiyu_20080526.html )
-------------------------------------------------------------------
震撼2008发誓找到爱情 上世纪佳缘免费注册(http://www.jiayuan.com/st/?id=3456&url=http://www.jiayuan.com/register/new_step_1.php)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users