In many cases thresholds for metrics mark a certain range of values where the values is considered to be good or bad if it is inside or outside. While for significant number of metrics a upper (e.g. load on unixoid systems) or lower (e.g. effective throughput, free space in memory or storage) border might suffice, for some it does not, for example a temperature value from a temperature sensor should be within certain range (let's say 10℃ and 45℃).
Regarding input parameters this might be handled with with options like --critical-upper-temperature
and --critical-lower-temperature
,
this presents a problem with the performance data, if only scalar values could be used.
To resolve this situation the Range expression format was introduced, with the following definition:
[@][start:][end]
where:
start
<=end
- If
start
== 0, then it can be omitted. - If
end
is omitted, it has the "value" of positive infinity. - Negative infinity can be specified with
~
. - If the prefix
@
is NOT given, the value exceeds the threshold if it is OUTSIDE of the range betweenstart
andend
(including the endpoints). - If the prefix
@
IS given, the value exceeds the threshold if it is INSIDE the range betweenstart
andend
(including the endpoints). - Contrary to the short definition above, an empty Range expression is not a valid one, at least either
start
orend
must be provided.
Range definition | Exceeds threshold if x... |
---|---|
10 | < 0 or > 10, (outside the range of {0 .. 10}) |
10: | < 10, (outside {10 .. ∞}) |
~:10 | > 10, (outside the range of {-∞ .. 10}) |
10:20 | < 10 or > 20, (outside the range of {10 .. 20}) |
@10:20 | ≥ 10 and ≤ 20, (inside the range of {10 .. 20}) |