On Tue, Nov 2, 2021 at 8:17 AM Nishant Nayan <nayan.nishant2...@gmail.com>
wrote:

> Hi,
>     Is there a way to track all function calls along with this
> "-Ddumpv,dumph"?
> I would like to track function calls made by 'snmpd' when I run snmpget to
> query OIDs from other snmp abled device.
>

You could try -DALL.  That doesn't quite track all function calls, but at
least it tracks all places where there is any debugging specified.

  Bill


> On Mon, 6 Sept 2021 at 19:26, Bill Fenner <fen...@gmail.com> wrote:
>
>> On Sun, Sep 5, 2021 at 9:59 AM Nishant Nayan <nayan.nishant2...@gmail.com>
>> wrote:
>>
>>> My aim is to know how various parameters like errorstat and errindex
>>> etc. are set from response.
>>>
>>> For an example command :
>>> snmpget -v1 -c cmty_remotehost1 localhost SNMPv2-MIB::sysName.1
>>> SNMPv2-MIB::sysDescr.0 SNMPv2-MIB::sysObjectID.0
>>>
>>> SNMPv2-MIB::sysName.1 being an incorrect oid
>>>
>>
>> I like to add "-Ddumpv,dumph" to get details of the messages that are
>> being send and received.  Try running your get with that debugging to see
>> if the output helps you understand where each field comes from.  (You can
>> change it to just "-Ddump" to also get a hex dump, which you may be able to
>> compare with the data field you see in your debugger).
>>
>> Each field in the packet is encoded using ASN.1, which is more or less a
>> type/length/value encoding, but is fairly complex.  If you're trying to
>> create your own packets, please see if it's feasible to use an existing
>> ASN.1 encoder, because there have historically been many bugs in ASN.1
>> parsing and encoding so it's best to use a well-tested implementation.
>>
>> Also, if you want to know what the SNMP protocol is doing, as opposed to
>> what the helpful snmpget command is doing, you should add "-Cf" to the
>> snmpget command line - when snmpget gets an error like this, it'll strip
>> out the bad object and try again so that it gets the data that may exist,
>> but that is not how SNMP works per se - that is how snmpget works.
>>
>>   Bill
>>
>>
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to