[Nagiosplug-devel] RFC: Nagios 3 and Embedded Perl Plugins

Andreas Ericsson ae at op5.se
Thu Jan 4 17:08:53 CET 2007

Florian Gleixner wrote:
> Andreas Ericsson wrote:
>> That doesn't leave room for passing the environment though, which will 
>> break a very valuable feature in Nagios atm. Btw, popen.[hc] have been 
>> replaced by runcmd.[hc]. How old a version are you running?
> 1.4.5 has some spopen calls in check_fping.c check_hpjd.c check_load.c
> check_ping.c check_procs.c check_snmp.c check_swap.c and check_users.c.

Ah, righto. I don't use the official version myself and I've hacked 
those instances away in our version.

>>> Ideally a dynamically loaded plugin, that does not call external
>>> programs but has the code of for example "ping" complied in, does not
>>> create a single process.
>> This is a Bad Idea beacuse the core program can't block on read()'s, 
>> which means all plugins that work over the network will have their 
>> timing values skewed unless you run each check in a separate thread or 
>> fork() a new nagios daemon for each check to run dynamically, in which 
>> case you've already lost 90% of the gain and ended up with a wicked 
>> burden of maintainability. That's without considering the initial cost 
>> (in developer time) to rewrite all plugins to never use signals[1] (or 
>> alarm(3)), which will be huge.
> True. But i think a threaded approach could give a huge performance
> boost. Aren't alarms mostly used to timeout a external call?

Yes and no. They're also used to timeout socket reads and whatnot. This 
isn't a *big* problem, because it's easy to make the plugins read (even 
from external applications) in non-blocking mode and poll() the 
descriptors for input.

> But true: it would cost very much initially to rewrite that all. I think
> nobody wants to do that without a need.

Yes. It all piles up rather quickly. To be honest, I like the fact that 
plugins are external programs. Mainly because it allows fast and 
free-style development in any language the system you're on can run, but 
also because it allows drop-in replacement of plugins without having to 
restart Nagios.

Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

More information about the Devel mailing list