diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-01-08 22:50:33 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-01-08 22:50:33 (GMT) |
commit | cea604847e7dd62b390fb5c24da78becb1c82de7 (patch) | |
tree | ec66068be09014cf5234b648381350d01ae3d541 | |
parent | 8b471ee3e166b41ff609604ea332de62b867e235 (diff) |
nut plugin now also detects RB -> replace battery
-rw-r--r-- | checks/nut | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -262,14 +262,19 @@ def check_nut_status(item, params, info): if len(line) < 3 or line[0] != item: continue - value = line[2] + values = line[2:] if line[1] == 'ups.status:': - if value == 'OL': + if values[0] == 'OL': + if len(values) > 1: + if values[1] == 'RB': + return (1, "WARN - UPS Status is Onlince / Replace Battery (OL RB)") + return (1, "WARN - UPS Status has unknown extra fields: %s" % (", ".join(values[1:]))) return (0, "OK - UPS Status is Online (OL)") - elif value == 'OB': + elif values[0] == 'OB': return (1, "WARN - UPS Status is On Battery (OB)") - elif value == 'LB': + elif values[0] == 'LB': return (2, "CRIT - UPS Status is Low Battery (LB)") + return (3, "UNKNOWN - UPS Status cannot be determined for %s" % item) |