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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |