[Nagiosplug-devel] check_load arg parsing bugfix and cleanup

Andreas Ericsson ae at op5.se
Fri Jun 3 08:18:30 CEST 2005


sean finney wrote:
> hey,
> 
> On Mon, May 30, 2005 at 04:22:30PM +0200, Andreas Ericsson wrote:
> 
>>Also for async safety reasons, but the plugins should only call
>>exit_code = np_runcmd(command, &chld_out, &chld_err, flags);
>>and never worry about anything else (the flags parameter is a new 
>>addition which makes it possible for plugins decide if they want the 
>>output->line array populated or not).
> 
> 
> cool.  i see that as being a generally helpful parameter.
> 
> 
>>The output structure is fairly general and can be used for other things 
>>as well (getting data from a network socket, reading files, etc. etc.)
> 
> 
> something that would be nice to see would be to have this extended to
> manage not just output, but also input.  specifically, what comes to
> mind are the various check_tcp derived plugins where there's a specific
> order of send-recieve operations.  or perhaps there's a need for a
> different datastructure to handle this?
> 

As typedefs are "free" wrt binary footprint, I'd say a structure of its 
own would be in place here. Something along the lines of;

struct layer6_protocol {
   char *service_name;
   char *eol;
   unsigned short port;
   int protocol;
   struct net_event **event;
}

where event is a NULL-terminated list of a struct such as shown below.

struct net_event {
   size_t flags;
   size_t len;
   char *data;
}

> anyway, i'm going to hold off on the applying runcmd patches for the
> time being, as i won't have time to majorly audit this for the next
> 3 weeks or so.  i'm definitely planning on re-visiting this then, if
> someone else hasn't already picked up the ball on this by then.
> 
> 
> 	sean

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




More information about the Devel mailing list