diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-09-09 20:19:35 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-09-09 20:19:35 (GMT) |
commit | 8b471ee3e166b41ff609604ea332de62b867e235 (patch) | |
tree | 03c8c41d9eb465e3c40b344e477c3da765bdba40 /checks/nut | |
parent | e2b336a282671e7dd058f04a497a16a490bf0645 (diff) |
fixed nut runtime check
Diffstat (limited to 'checks/nut')
-rw-r--r-- | checks/nut | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -47,7 +47,7 @@ nut_output_default_values = (245, 250) nut_battery_default_levels = (10, 5) nut_battery_charge_default_levels = (90, 85) -nut_battery_runtime_default_levels = (1200, 900) +nut_battery_runtime_default_levels = (900, 600) nut_input_voltage_fault_default_levels = (155, 160) nut_input_default_levels = (245, 250) @@ -147,12 +147,13 @@ def check_nut_battery_runtime(item, params, info): if len(line) >= 3 and line[0] == item and line[1] == "battery.runtime:": + runtime_s = int(line[2]) runtime = float(line[2]) / 60 perfdata = [ ( "runtime", runtime, warn, crit ) ] - if runtime <= crit: + if runtime_s <= crit: return (2, "CRIT - Battery Runtime is %0.2f min" % runtime, perfdata) - elif runtime <= warn: + elif runtime_s <= warn: return (1, "WARN - Battery Runtime is %0.2f min" % runtime, perfdata) else: return (0, "OK - Battery Runtime is %0.2f min" % runtime, perfdata) |