[Nagiosplug-devel] RFC: New threshold syntax

Ton Voon ton.voon at altinity.com
Wed Mar 19 10:58:13 CET 2008

On 18 Mar 2008, at 15:01, Max wrote:

> On Tue, Mar 18, 2008 at 9:41 AM, Andreas Ericsson <ae at op5.se> wrote:
>> Sensible. With '>' in arguments every argument needs to be escaped,
>> which is just plain stupid.
> Having operators match normal math vs. learning a different syntax
> just to indicate normal operators with a trade off of having to quote
> arguments is stupid?  Interesting opinion, especially since command
> definitions are codified in configuration files that don't change
> much, in my (to you, stupid) mind making the warning and critical
> conditional syntax more readable and maintainable for more complex
> thresholds is more important than saving a plugin writer a few quote
> key strokes here and there.  We all test and test plugins from the
> command line before we codify them in command definitions, not like
> most Nagios admins are doing tons of new checks a day for
> configurations where missing a quote is a huge risk.

Decent argument.

Using "<" is more clear. Using "<=" will also sort out the inclusion/ 
exclusion issue too.

Your example uses the -w and -c flags, rather than using the metric.  
How would we say "show me time, but I don't want thresholds set  
against it"?

Maybe this in combination with the ordered command line options?

--threshold=number -w '>5' -c '>7' --threshold=cpu -c '40<=x<=60'

I can see this being much harder to parse. There's merit in this, but  
needs fleshing out.

>> just rip an SQL-parsing implementation directly, with subquery  
>> support
>> tucked right in.
> This I really like.  This would let the syntax for threshold
> specifications get as complex as needed for people who want to do
> complex thresholds, use a paradigm for syntax that is very well
> understood, while the specifications at the same time could maintain
> as well the very simple integer specifications that are documented now
> for people who don't want to go that path.

As lovely as that sounds, what would it look like in practise?


UK: +44 (0)870 787 9243
US: +1 866 879 9184
Fax: +44 (0)845 280 1725
Skype: tonvoon

More information about the Devel mailing list