Re: Communication between Master-agent and Sub-agent

This is a discussion on Re: Communication between Master-agent and Sub-agent within the SNMP Coders forums, part of the Networking and Network Related category; On 29/05/07, Shivani Garg <shivanigarg02@gmail.com> wrote: > a) Say I am writing a MIB ....


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-06-2007
Dave Shield
 
Posts: n/a
Default Re: Communication between Master-agent and Sub-agent

On 29/05/07, Shivani Garg <shivanigarg02@gmail.com> wrote:
> a) Say I am writing a MIB .my for an object by the name of myObject. I
> believe a var_myObject() function will be created by mib2c.


Either var_myObject() (if using the old v4 UCD module API), or
myObject_handler() (if using the newer v5 API). The precise details
are somewhat different, but the basic idea is much the same.


> I wanted to know
> how this function is called by the master agent when it receives a snmpget
> for an OID corresponding to myObject.


The agent keeps a registry of all the OIDs that various MIB modules have
told it about. When a request comes in, the main agent framework uses
this registry to decide which module to pass the request on to.
For a GET (or SET) request, there will only be one module that's relevant.
For a GETNEXT request, the agent will work through the registry, calling
each module in turn until it gets a value it can use.

> What is the flow of communication
> between master-agent and sub-agent in this respect.


The above description holds true for both master/subagent communication,
and for MIB modules implemented within the master agent itself.
The only difference for a master/subagent version is that this involves an
AgentX GET (or GETNEXT) request, followed by a RESPONSE message.
(Rather than a simple internal function call).

Things are a bit more complex for SET processing, but don't worry about
that just yet.


> b) Also, agent_check_and_process() will listen for events on internal FDs
> from master-agent (for both GET and SET). Can we send traps also these FDs
> or is there any way to register our own external FDs through
> agent_check_and_process()?? If yes, then how are these handled by netSNMP.


The external FD mechanism is not limited to the standard SNMP GET/SET/etc
model. You'd supply a routine to be called whenever there's something waiting
to be read from that FD. The agent isn't bothered what this data is, or what
it means - that's all left to your code.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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 10:51 PM.


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