On 29 October 2012 09:34, Sverre Moe <sve...@spacetec.no> wrote:
> I have tried to manually register 3 hard coded scalars, one by one, each
> with its own handler:
    [snip]
> This works fine and snmpget returns a value. However, if I put these 3 hard
> coded scalars OID in a list, iterate over that list and register them, I get
> a duplicate error.

Hmm....  that sounds suspiciously as if the OID that's getting passed
to the registration code isn't the same OID that you're expecting..
Unfortunately, there doesn't seem to be any debug code within the
registration processing, that can be used to check this.
   (but see below)

Things that are perhaps worth trying:

* Separate out this call:
>    int returnValue = netsnmp_register_read_only_scalar(
>         netsnmp_create_handler_registration(buffy, ....));

into two separate statements:
     netsnmp_handler_registration *r =
           netsnmp_create_handler_registration(buffy, ....));
     returnValue = netsnmp_register_read_only_scalar( r );

which will at least indicate which of the two calls is failing.

* Craft a dummy version of this module that just registers
the three scalars (using the same approach), but doesn't
try to implement the actual handler.   Then try compiling this
into the main agent code, rather than as an AgentX subagent.

This will indicate whether it's an AgentX-specific problem
or more general.

* Turn on packet dumps in the AgentX subagent, to show
the exact registration requests that are being made.

This will confirm whether the OIDs being registered are
indeed what you expect.


That third is probably the easiest to start with.
If you try the second, and still get nowhere, then please
post the complete code of that dummy module, so we
can try to reproduce the problem.

Dave

------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to