Dave Shield ha scritto:
> On 07/12/2007, Giuseppe Modugno <[EMAIL PROTECTED]> wrote:
>> What is the use of a watcher variable?
> 
> The idea of the watcher helper is as follows:
>     Some MIB objects may need quite complex processing to retrieve
> the current value or (particularly) to respond to the assignment of a
> new value.   But other MIB objects may simply be monitoring (or
> updating) some value that is already implemented in your application
> as a distinct data variable.
>    In this situation, all that the agent needs to do is "watch" this
> variable, and report (or update) the current value whenever it receives
> a request for that particular OID.
> 
>   That's the purpose of the watcher helper.   You provide it with the
> location of the variable that holds this value, and the OID associated
> with this MIB object.   And the helper does the rest.

Thanks Dave, your explanation is very clear, but I can't find a real situation 
where a "watcher" helper could help.


>   As a fer-instance:
> 
> Suppose you're monitoring a web server, and want to know how many
> connections are being actively processed at any one time.  One approach
> would be to retrieve the current status of each webserver process or
> thread, and count up the number that are currently active.   That involves
> a reasonable amount of processing, so you would need to code a MIB
> handler to do this.
> 
>   But it's quite possible that the main web server process already holds
> this information (so that it knows whether to find an idle server process,
> start up another child, or hold the HTTP request in a queue).   So if there
> is a variable within the web server that holds this values, and you point
> the watcher helper at this variable (specifying the appropriate OID) - then
> that automatically implements the required behaviour.   No special code
> is needed.

I think that the web server is a different process than the SNMP (module or 
main) agent, so the variable can't be accessed directly from within the agent.
Most probably this variable must be retrieved from the web server process by an 
API call or something similar.

It's difficult to have a situation where the OID variable is really the 
variable 
of the agent process... isn't it?

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to