Re: Accessing data in the agent from a subagent

This is a discussion on Re: Accessing data in the agent from a subagent within the SNMP Coders forums, part of the Networking and Network Related category; On 05/03/2008, Magnus Fromreide <magfr@lysator.liu.se> wrote: > On tis, 2008-03-04 at ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-05-2008
Dave Shield
 
Posts: n/a
Default Re: Accessing data in the agent from a subagent

On 05/03/2008, Magnus Fromreide <magfr@lysator.liu.se> 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
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:54 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0