[Nagiosplug-devel] RFC: New threshold syntax

Andreas Ericsson ae at op5.se
Thu Mar 20 14:14:59 CET 2008


Max wrote:
> On Wed, Mar 19, 2008 at 9:21 AM, Andreas Ericsson <ae at op5.se> wrote:
>>  So what do we do with users running Nagios on AIX? Tell them to go
>>  screw themselves, because "oh look, we've thought up this wonderful
>>  new way of specifying critical and warning ranges at the same time"?
> 
> Ok, of course not, thanks for sharing, would be nice to drop the
> constant sarcasm, it gets in the way of your points.
> 
> So we can't use these characters then either:
> ^ - old shells use this as pipe
> ~ - some shells use this for regexp matching

True.

> = - forget to quote and doh, we are setting shell variables now

Only if it appears immediately after the first shell-word with no
whitespace in between. Iow, it would be stupid to name a plugin
check=foo, but it's quite alright to let it take = as an argument.

> ;
> |
> &
> 

True.

> So are we left with an RPN style notation to ensure that this works
> across all OSes .. like RRD, with multiple warn and critical switches
> accepted to help with readability, maybe?
> 
> --warning 15min,15.00,gt --warning 1min,5.00,gte --critical
> 15min,30,gt,10min,5,gt
> 

Something like that, yes, although I could imagine it being something
like

check_proc --cpu w=60%,c=80%

for the non-ranged case. Note that --disk w=20%,c=10% will probably want
its arguments to mean the exact inverse (ie, alert when below), so the
API needs to be flexible enough to let it specify a preference, or possibly
figure it out on its own (if C < W, low values are bad).

> 
> That would at least be something many users (no Andreas, not all, not
> beginners either) have used and something that is well documented.
> 
>>  For the future; it's a good idea to see what other semi-similar programs
>>  are doing. For the record, I can't think of a single cli program that
>>  requires shell characters in its command line.
> 
> sed
> awk
> 

sed and awk are script languages. Not Turing-complete, but still languages.
Perl uses pretty much every shell-character in the world too (come to think
of it, it probably imports shell-chars from the entire galaxy), but neither
you nor me mentioned that. Besides that, neither sed nor awk *requires*
shell characters in its command line.


> Yes, not for options, but they often are pipelined and have syntax
> that requires quotes.
> 

Pipelines are set up by the shell, so this argument just proves my point.
Thanks.

-- 
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