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 tis, 2008-03-04 at 16:37 +0000, Dave Shield wrote: > On 04/03/2008, Aaron Young <...


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
Magnus Fromreide
 
Posts: n/a
Default Re: Accessing data in the agent from a subagent


On tis, 2008-03-04 at 16:37 +0000, Dave Shield wrote:
> On 04/03/2008, Aaron Young <Aaron.Young@mpathix.com> wrote:
> > I'm fairly new to net-snmp and am currently working on a subagent
> > serving our own mib. It would be nice to be able to perform GET
> > requests on data served by the main agent (i.e. mib-2 data) from within
> > my agent code. Is there a clean way to do this, or would this involve
> > adding client code to the agent?

>
> Try something like:
>
> netsnmp_query_set_default_session(
> netsnmp_iquery_user_session(secName));
>
> where secName is an SNMPv3 user with read-access to the
> information you want to query
>
> Then use
>
> netsnmp_query_get( varlist, NULL );
>
> where varlist is a netsnmp_variable_list structure
> (or list of structures) containing the OIDs that you
> are interested in.
> This call will fill in the corresponding values.


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.

/MF


-------------------------------------------------------------------------
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 07:28 PM.


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