it.jnrpe.utils
Class ThresholdUtil
java.lang.Object
it.jnrpe.utils.ThresholdUtil
public class ThresholdUtil
- extends Object
Utility class for evaluating threshold
This class conforms to the nagios plugin guidelines
(http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT).
The generalised range format is: [@]start:end
Values are interpreted this way:
- 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)
start and ":" is not required if start=0.
- Author:
- Massimiliano Ziccardi
|
Method Summary |
static boolean |
isValueInRange(String sRange,
BigDecimal value)
Returns true if the value dalue falls into the range sRange |
static boolean |
isValueInRange(String sRange,
int iValue)
Returns true if the value iValue falls into the range sRange |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThresholdUtil
public ThresholdUtil()
isValueInRange
public static boolean isValueInRange(String sRange,
int iValue)
- Returns
true if the value iValue falls into the range sRange
- Parameters:
sRange - The rangeiValue - The value
- Returns:
isValueInRange
public static boolean isValueInRange(String sRange,
BigDecimal value)
- Returns
true if the value dalue falls into the range sRange
- Parameters:
sRange - The rangevalue - The value
- Returns:
Copyright © 2012. All Rights Reserved.