2009/2/24 Alexander Bubnov <[email protected]>:
> I tried to register an instance of UNICODE string:
> static const wchar_t* nstAgentSubagentObject = L"ABC";
[snip]
> But snmpget prints strange set of characters:
[snip]
> Can you please help me to find out what is wrong?
The first thing to check is whether the problem lies with the agent,
or with snmpget? Is the wrong value being returned, or is the
value OK but it's not being displayed correctly.
Try running
snmpget -v2c -c rwpublic -Ox localhost
NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
to print the result as a series of octet values.
Does this match what you would expect
(in which case the problem is with how snmpget displays this value).
Or is the value returned wrong
(in which case the problem lies in the agent).
One other thought:
watcher_info = netsnmp_create_watcher_info(
&nstAgentSubagentObject,
wcslen(nstAgentSubagentObject), <====
ASN_OCTET_STR, watcher_flags);
I'm no expert in internationalisation, but the watcher is expecting to be
told the size of the buffer in octets. Assuming the size of a wide
character is greater than 8 bits, this code will only be watching the
first bit of the nstAgentSubagentObject buffer - not the whole thing,
and hence won't be reporting the complete value.
(Because you've only told it about 3 bytes).
> may by a special storage of UTF strings exist as for counter64?
No - UTF strings are simply a sequence of octets.
The only "string" type in SNMP is OCTET STRING.
Dave
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
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