On 2017-06-06, ikuzar RABE <ikuzar9...@gmail.com> wrote:
> --===============7306090861208874791==
> Content-Type: multipart/alternative; boundary="001a113528fc58c560055145f67f"
>
> --001a113528fc58c560055145f67f
> Content-Type: text/plain; charset="UTF-8"
>
> Hi all,
>
> I work on Linux Debian 8.7 with net-snmp 5.7.2
>
> I 'd like to know how to disable OID translation when receiving response
> after a snmp_sess_async_send() call.
>
> I send:
> char * oid_str = ".1.3.6.1.4.1.9.9.166.1.15.1.1.27.34";
> snmp_parse_oid(oid_str, oid, &oid_len);
> snmp_add_null_var(pdu, oid, oid_len);
> snmp_sess_async_send(...)
>
> and I get:
> CISCO-SMI::ciscoMgmt.166.1.15.1.1.27.34.65536 = Counter64: 0
>
> But how to do to get:
> 1.3.6.1.4.1.9.9.166.1.15.1.1.27.34.65536 = Counter64: 0

You can do this with netsnmp_ds_set_int e.g.

      netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
                         NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
                         NETSNMP_OID_OUTPUT_NUMERIC);

If you have some things in your code wanting numeric values, and some
wanting names, note that this setting is a library-wide global.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to