[Nagiosplug-devel] check_load arg parsing bugfix and cleanup

sean finney seanius at seanius.net
Sun May 29 15:01:24 CEST 2005


hi andreas,

On Sat, May 28, 2005 at 03:52:22AM +0200, Andreas Ericsson wrote:
> It's at http://oss.op5.se/nagios/runcmd.tar.gz. It's basically a 
> revamped spopen() with an output-buf-to-stringarray parsing-routine 
> attached. I've made sure that used values aren't wasted so the 
> complexity of parsing multi-line output is no O(n) instead of O(n+m) 
> like it was before. It makes for quite a save on multiple serial executions.

i've taken a look over this, and have a couple questions/comments, which
i'll share for the benefit of those who probably aren't going to read
through it otherwise:

first off, i notice some pretty major interface changes to spopen.
instead of dealing with FILE pointers we're now dealing with int fd's
(or piped pairs, actually).  secondly, these are now passed as additional
params to the function, instead of existing as global variables.

this would mean going through all the nagios plugins code and making
some fairly heavy modifications.  however, i see this being a generally
beneficial thing in the long run--mainly because of code reduction
but also because it's generally more friendly towards multithreaded
environments (not that i think any plugins will be multithreaded, but
certainly a good thing if this were eventually headed for nagios core).

about the runcmd functions:  any reason not to have "output" be a struct
that contains datastructures for both stdout and stderr, and only pass
one argument to the functions?


	sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20050529/ac044307/attachment.sig>


More information about the Devel mailing list