I have tried to seperate the registration call into two separate statements, 
same result. None of these are actually failing. When I call 
netsnmp_register_scalar(handler), it returns -1 which is 
MIB_DUPLICATE_REGISTRATION. 


How do I " Turn on packet dumps in the AgentX subagent" ? 




/Sverre 

----- Original Message -----

Fra: "Dave Shield" <d.t.shi...@liverpool.ac.uk> 
Til: "Sverre Moe" <sve...@spacetec.no> 
Kopi: "net-snmp-users" <net-snmp-users@lists.sourceforge.net> 
Sendt: 29. oktober 2012 11:01:33 
Emne: Re: Debugging SNMP 

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 



CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be 
proprietary, confidential or subject to export regulations, and is only meant 
for the intended recipient(s). Any disclosure, copying, distribution or use is 
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in 
error, please delete it immediately from your system and notify the sender 
properly.
------------------------------------------------------------------------------
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