The following classes allow to handle intermediate data that are used during the plugin's execution in a structured way. Most of them are used by the nagiosplugin
library itself to create objects which are passed into code written by plugin authors. Other classes (like ~nagiosplugin.metric.Metric
) are used by plugin authors to generate intermediate data during acquisition
or evaluation
steps.
Note
All classes that plugin authors typically need are imported directly into the nagiosplugin
name space. For example, use :
import nagiosplugin
# ...
result = nagiosplugin.Result(nagiosplugin.Ok)
to get a ~nagiosplugin.result.Result
instance.
nagiosplugin.metric
Metric
__new__
__str__
nagiosplugin.state
ServiceState
__str__
__int__
Note
ServiceState
is not imported into the nagiosplugin
top-level name space since there is usually no need to access it directly.
nagiosplugin.state.worst
The state subclasses are singletons. Plugin authors should use the class name (without parentheses) to access the instance. For example:
state = nagiosplugin.Critical
nagiosplugin.state.Ok
nagiosplugin.state.Warn
nagiosplugin.state.Critical
nagiosplugin.state.Unknown
nagiosplugin.performance
Performance
__new__
__str__
nagiosplugin.range
Range
__new__
__str__
__repr__
nagiosplugin.result
Result
__new__
__str__
ScalarResult
Results
__iter__
__len__
__getitem__
__contains__