A range is defined as a start and end point (inclusive) on a numeric scale (possibly negative or positive infinity).
A threshold is a range with an alert level (either warning or critical). Use the set_thresholds(thresholds *, char *, char *) function to set the thresholds.
The theory is that the plugin will do some sort of check which returns back a numerical value, or metric, which is then compared to the warning and critical thresholds. Use the get_status(double, thresholds *) function to compare the value against the thresholds.
This is the generalised format for ranges:
[@]start:end
Notes:
start ≤ end
start and “:” is not required if start=0
if range is of format “start:” and end is not specified, assume end is infinity
to specify negative infinity, use “~”
alert is raised if metric is outside start and end range (inclusive of endpoints)
if range starts with “@”, then alert if inside this range (inclusive of endpoints)
Note: Not all plugins are coded to expect ranges in this format yet. There will be some work in providing multiple metrics.
Table 3. Example ranges
Range definition
Generate an alert 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})
Table 4. Command line examples
Command line
Meaning
check_stuff -w10 -c20
Critical if “stuff” is over 20, else warn if over 10 (will be critical if “stuff” is less than 0)
check_stuff -w~:10 -c~:20
Same as above. Negative “stuff” is OK
check_stuff -w10: -c20
Critical if “stuff” is over 20, else warn if “stuff” is below 10 (will be critical if “stuff” is less than 0)
check_stuff -c1:
Critical if “stuff” is less than 1
check_stuff -w~:0 -c10
Critical if “stuff” is above 10; Warn if “stuff” is above zero (will be critical if “stuff” is less than 0)
check_stuff -c5:6
Critical if “stuff” is less than 5 or more than 6
check_stuff -c@10:20
OK if stuff is less than 10 or higher than 20, otherwise critical
@AnasSplit if you like have a look one of the checks from the Exchange. The first one is basicaly a WATO rule set for check_snmp and the second one add’s a metric (perffdata) to the check.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.