On 05/03/2008, Magnus Fromreide <[EMAIL PROTECTED]> wrote:
>  On tis, 2008-03-04 at 16:37 +0000, Dave Shield wrote:
>  > Try something like:
>  >
>  >     netsnmp_query_set_default_session(
>  >              netsnmp_iquery_user_session(secName));
>  >
>  >    netsnmp_query_get(  varlist, NULL );

> It should be noted that this only work in a compiled in or dlopened
>  module. It won't work in an AgentX or SMUX subagent where you would have
>  to actually send a request to the master agent to get hold of the value.

Good point.

In that case, you could try

     netsnmp_session *s = snmp_open( .... );
     netsnmp_query_get(  varlist,  s  );

I.e. set up a session to the master agent (just as with the client apps)
and use this for the query call (rather than relying on the default
callback session).

I've not actually tested this, but it should work OK.
Just beware of loops.   If the master agent will pass the
request on to the same subagent, then you might end
up deadlocked!

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to