====== Syntax ====== Hier werden Beispiele für verschiedene Plugin-Syntax dargestellt. ===== Threshold - Range ===== Quelle: [[http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT|http://nagiosplug.sourceforge.net/]] 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}) | | 10 | < 0 or > 10, (outside the range of {0 .. 10}) |