On Wed, 2006-01-11 at 13:01 +0200, Makavy, Erez (Erez) wrote:
>  1) When you stated "Sending traps is either done as part of processing
> SNMP requests",
>   do you mean processing an agentX Notification PDU from a sub-agent?

That's one example, certainly.

>   1a) is there any other SNMP request processing which will invoke the
> master agent trap sending?

A SET request could potentially trigger a trap - either directly
(see agent/mibgroup/examples/notification.c) or implicitly (e.g
setting ifAdminStatus to down)


A GET* request could involve the re-loading of cached data, which
might trigger a trap (e.g. if this revealed that ifOperStatus
had switched to down)

That's just off the top of my head - I'm sure there are
other possible scenarios.



> 2) By mentioning the "Event Loop", do you refer to a loop on the
> agent_check_and_process() function [in snmp_agent.c] ?

No - because agent_check_and_process() doesn't involve a loop.
I mean the 'while (netsnmp_running)' loop in snmpd.c:receive().



>       2a) How does an alarm interupt this loop? (i see in
> agent_check_and_process(), you call run_alarms() synchroniously)

I'm not sure of the exact mechanism (and don't have time to check)
but I believe it involves signals, and catching SIGALRM.
Check the code.


>       2b) Alarm mechanism is seperate for Master agent and for each
> sub-agent, right?

Yes.  They're separate processes, so alarms, etc are handling
independently.

>       2c) each agent has it's own request processing loop?

Yes.


    
> 3) A burst of traps can be generated by a sub-agent  (without using the
> alarm mechanism).
>    This will cause the socket that the master is listening on, to always
> full.
>    (assuming assumption in quesiton 2 is right)
>    I see also that _sess_read() is called for which socket which is
> ready.
>    It looks like _sess_read(), processes all packets before returning.
>     3a) Is this true?


I believe so, yes.
Don't take that as gospel, though - it's a while since I looked at this
code in detail.  It would not surprise me if a subagent could flood the
master agent with traps.   Separating out trap processing and request
processing is probably the obvious first candidate for making the agent
multi-threaded.

But don't hold your breath!

Dave


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to