[Nagiosplug-devel] devolper guidelines

Ton Voon ton.voon at altinity.com
Mon May 15 06:33:38 CEST 2006


On 14 May 2006, at 14:39, Christoph Maser wrote:
>
> Hi,
>
> there is a point in the developer-guidelines wich i think is a bit  
> problematic.
>
> It says:
>   "The -? option, or any other unparsable set of options, should  
> print out a short usage
> statement. Character width should be 80 and less and no more that  
> 23 lines should be
> printed (it should display cleanly on a dumb terminal in a server  
> room)."
>
> The problem i see with this is that if you missconfigure the plugin  
> inside nagios you
> might get something like non-ok exitcode with no ouput at all (lead  
> to the famous "No
> output returned from plugin". Since the output can be multiline and  
> the 1st line can be empty.
>
> An example where this happens is check_nrp called with wrong flags.  
> It reutrns a decent
> error-message on STDERR but usage with an empty 1st line on STDOUT.  
> I've seen this leading
> to long sessions of debugging.
>
> I would propose to rephrase that part to sth like the following:
>
>  "The -? option should print out a short usage statement on STDOUT.  
> Character width should
> be 80 and less and no more that 23 lines should be printed (it  
> should display cleanly on a
> dumb terminal in a server room).
>  Any unparsable or unusable set of options should return exitcode 3  
> (unknown) and _one
> line_ on STDOUT indicating the plugin was called with and  
> unparsable or unusable set of
> options, and the usage statement on STDERR."

I think it is fair that this is open to review again.

Better error messages that get propagated back to Nagios is a good  
aim. Your suggestion makes sense as a -? (intentional) is quite  
different from an unintentional bad option. My only change would be  
that the 1st line on STDOUT be a "bad option specified" message, with  
the rest of STDOUT being the (optional) usage statement. I don't see  
a need to separate STDOUT and STDERR output.

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon






More information about the Devel mailing list