On Tue, Aug 27, 2019 at 2:12 PM Krishna Chaitanya <chaitanya.m...@gmail.com> wrote: > > On Mon, Aug 26, 2019 at 9:22 PM Bill Fenner <fen...@gmail.com> wrote: > > > > On Tue, Aug 20, 2019 at 8:45 AM Krishna Chaitanya > > <chaitanya.m...@gmail.com> wrote: > >> > >> Hi, > >> > >> When using MAC Address as an index ( I am using MacAddress type from > >> SNMPv2-TC.) the output is incorrect because the length of the string > >> is prefixed as mac address is defined as OCTET STR there is an extra > >> byte and the last byte of mac address is interpreted as next OID. > >> > >> snmpwalk: > >> HistValue."wlp8s0f0".'....B.'.hist_2.2.19 > >> snmpwalk -OX > >> HistValue["wlp8s0f0"][STRING: 06:00:90:e6:42:99][hist_2][2].19 > >> > >> In the above examples last but one OID 2 is hist_2. Is there a way to > >> disable prefixing of length? > > > > > > The prefixing of length is done by the agent. Are you asking about a MIB > > module that you implemented? Try changing your object definition from > > ASN_OCTET_STR to ASN_PRIV_IMPLIED_OCTET_STR. > Yes, I am using my own MIB and changing to ASN_PRIV_IMPLIED_OCTET_STR > in the subagent worked. > Thanks, Bill.
After this change, I was getting a lot of duplicate data exists errors, upon further debugging found a similar issue which is quite old https://www.mail-archive.com/net-snmp-coders@lists.sourceforge.net/msg06286.html. In the current code even though there is support to handle IMPLIED strings, but subsequent indexes are not processed. See snippet below: out of 4 indexes only 2 are processed (the indexes after ASN_PRIV_IMPLIED_OCTET_STR failed to parse. Any ideas? histStatsData: Request Mode is: 160 name: wlp8s0f0 col: 3 histStatsData: Add row duplicate table data attempted to be entered. row exists helper:table:req: Got GETNEXT (161) mode request for handler table: base oid:SNMPv2-SMI::mib-2.43932.2.2 helper:table:col: have at least a column (3) helper:table: have 17 bytes of index helper:table: looking for 4 indexes parse_oid_indexes: Parsed str(4): wlp8s0f0 helper:table: got 1 (incomplete=0) parse_oid_indexes: Parsed str(196): helper:table: got 1 (incomplete=0) helper:table: oid indexes not complete: SNMPv2-SMI::mib-2.43932.2.2.1.3.8.119.108.112.56.115.48.102.48.0.128.225.66.153.1.2.15 helper:table:results: found 2 indexes helper:table:results: column: 3, indexes: 2 index: type=4(04), value=STRING: "wlp8s0f0" index: type=196(c4), value=Variable has bad type BTW, somehow the response from Neils is missed but found it in the archive. https://www.mail-archive.com/net-snmp-coders@lists.sourceforge.net/msg21705.html MacAddress TC from SNMPv2-TC is a fixed size string, so, the length should not be prefixed. _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders