Creating new plugin -- questions...

Andreas Ericsson ae at op5.se
Thu Mar 10 21:43:26 CET 2005


Braun Brelin wrote:
> I'm reading up on passive checks now.  Thanks for the info. 
> As regards the sleep() on the daemon, the other problem here is that the
> log file basically writes the following stuff...
> 
> <date/time> <request for a lock:>  <requester id:>  <current locker id>
> .
> .
> .
> 
> 
> If the current locker has held the lock for more than approx 30 seconds,
> then it's an alert condition.  basically, i've opened up the log file
> within the daemon using a '|/usr/bin/tail -1f <filename>' argument to
> open.  
> 
> If I put in a sleep() don't I take the risk of potentially missing an
> alert? 
> 

tail sleep()'s in blocking IO requests. Without any sleep() at all the 
process would eat all available CPU, since the default of any process is 
to keep cycling instructions as long as it has any. As for the risk of 
missing an alert, I was thinking along the lines of a one second sleep() 
inside a loop, not an 8 hour full nights rest.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click




More information about the Developers mailing list