PerfData¶
-
class
naghelp.
PerfData
(label, value, uom=None, warn=None, crit=None, minval=None, maxval=None)¶ PerfData class is a convenient way to build a performance data object without taking care of the syntax needed by Nagios. The PerfData object can then be added into to
PluginResponse
object, with methodPluginResponse.add_perf_data()
.Parameters: - label (str) – The metric name
- value (str) – The metric value
- uom (str) –
unit of measurement, is one of:
- no unit specified - assume a number (int or float) of things (eg, users, processes, load averages)
- s - seconds (also us, ms)
- % - percentage
- B - bytes (also KB, MB, TB)
- c - a continous counter (such as bytes transmitted on an interface)
- warn (str) – WARNING threshold
- crit (str) – CRITICAL threshold
- min (str) – Minimum value
- max (str) – Maximum value
Examples
>>> perf = PerfData('filesystem_/','55','%','95','98','0','100') >>> print perf filesystem_/=55%;95;98;0;100 >>> perf.value = 99 >>> print perf filesystem_/=99%;95;98;0;100