summaryrefslogtreecommitdiff
path: root/checks
diff options
context:
space:
mode:
Diffstat (limited to 'checks')
-rw-r--r--checks/nut13
1 files changed, 9 insertions, 4 deletions
diff --git a/checks/nut b/checks/nut
index f5ec1cc..df6c156 100644
--- a/checks/nut
+++ b/checks/nut
@@ -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)