|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.jnrpe.utils.thresholds.LegacyThreshold
public class LegacyThreshold
This class represent a parser/evaluator for the old threshold syntax.
Constructor Summary | |
---|---|
LegacyThreshold(String metric,
LegacyRange ok,
LegacyRange warn,
LegacyRange crit)
Builds and initializes the threshold object. |
Method Summary | |
---|---|
Status |
evaluate(BigDecimal value)
Evaluates the value agains the specified ranges. |
String |
getMetric()
The metric referred by this threshold. |
String |
getRangesAsString(Status status)
With the new threshold format, inside one threshold you can specify ranges for OK, WARNING and CRITICAL status. |
String |
getUnitString()
Returns the unit of measure as a string. |
boolean |
isAboutMetric(String metric)
Returns true if this threshold references the passed in
metric. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LegacyThreshold(String metric, LegacyRange ok, LegacyRange warn, LegacyRange crit)
metric
- The metric associated with this threshold.ok
- The ok range.warn
- The warning range.crit
- The critical range.Method Detail |
---|
public final Status evaluate(BigDecimal value)
Status.CRITICAL
is returned.
Status.WARNING
is returned.
Status.OK
is returned.
Status.CRITICAL
is
returned
Status.OK
is returned
value
- The value to be evaluated.
public final boolean isAboutMetric(String metric)
true
if this threshold references the passed in
metric.
metric
- The metric we want to evaluate.
public final String getMetric()
public final String getRangesAsString(Status status)
status
- the range we are interested in.
public final String getUnitString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |