[Nagiosplug-devel] RFC: New threshold syntax
Max
perldork at webwizarddesign.com
Fri Mar 21 13:05:30 CET 2008
On Thu, Mar 20, 2008 at 5:07 PM, Ton Voon <ton.voon at altinity.com> wrote:
>
> On 20 Mar 2008, at 19:39, Vonnahme, Nathan wrote:
>
> > 1. we start by defining "normal" (OK), and assume everything
> > else is CRITICAL
>
> I'm still digesting what you've written, but I just had to say:
> brilliant.
>
> Defining OK ranges is going to be the biggest thing to aid
> comprehension
I agree with the usefulness of this and readability of this, very nice.
I am not sold on the value of having ranges have to state negative or
positive infinity explicitly. I think that should be optional but not
required. I understand from an implementation standpoint that having
it manditory makes parsing arguments easier, though only slightly.
>From a readability standpoint, I think fewer people are used to seeing
infinity explicitly stated and represented as a token than they are
having it be assumed by an expression.
I do really like the readability of warn(), ok(), critical() and I
like having UOM as a suffix; I would not see any developer or plugin
writer, regardless of skill, getting confused about whether he or she
has to put a UOM on infinity :).
I would also make ok() optional as there are plenty of use cases for
plugins where just defining exceptions and having what is normal
implied by the exceptions is more intuitive.
Your suggestion does use characters that would be interpreted by the
shell if not quoted. How about using '-' instead and using UOM
suffixes?
--result_size=ok-300:500b,warn-:300,critical-500:
--free_space=warn-inf:300KB,critical-inf:100KB
Using suffixes to identify UOM and - instead of ()
Would avoid the extra parentheses and eliminate that potential problem
and is still very readable in my opinion. Suffixes would be optional,
but if someone wants to use them I think it is perfectly reasonable to
have the user then understand the difference between bits and bytes,
KB vs kb, MB vs Mb when dealing with orders of magnitude.
--free_space=ok:300-500b,warn:-300b,critical:500b+
this is another alternate punctuation still that could be used that
still keeps to your idea ... - for less than, + for greater than, num
- num for range, and use : as the state:spec separator. That to me is
more readable than the '-' version I just suggested as an alternative
and still avoids using the shell sub-shell parens. People are very
used to seeing label ':' value.
- Max
More information about the Devel
mailing list