[Nagiosplug-devel] RFC: New threshold syntax
Andreas Ericsson
ae at op5.se
Fri Mar 21 17:40:54 CET 2008
Max wrote:
> 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
>
For negative infinity, this would be "warn--inf:300KB" which looks
kinda ugly and is hard to debug.
I'd go with equal-sign and recommend disjointed parameter/argument
in all docs, like this
--freespace warn=inf:300KB,critical=inf:100KB
(yes, I detest underscores in argument names, primarily because many
keyboard setups requires the user to press shift to get an underscore)
And let "warn", "critical" and "ok" be specified by their shortest
non-ambiguous string, for brevity, so that really long command-lines
can be shortened to
--freespace w=inf:2GB,c=inf:200MB
uom must be specifiable along with the numerical option, otherwise
the above thresholds would feel unnatural to specify. Note that
0.2GiB != 200MiB, while 0.2GB == 200MB. Since we're talking disks
here, both KiB and KB are valid and both kinds are used.
--
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