diff options
author | Clara K <clara@cynthialabs.net> | 2023-12-01 22:38:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-01 21:38:36 +0000 |
commit | 750bf639985bd60e2eb6990529f9d6e71eb513d6 (patch) | |
tree | 41e1b35e4049111a69c2511f72c2c01c0dd0dd1c /collectors | |
parent | 706f150a8b330145b993a3e979f3370bfa607d2b (diff) |
include more cases for megacli degraded state (#16522)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/python.d.plugin/megacli/megacli.chart.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/collectors/python.d.plugin/megacli/megacli.chart.py b/collectors/python.d.plugin/megacli/megacli.chart.py index ef35ff63f4..8222092a80 100644 --- a/collectors/python.d.plugin/megacli/megacli.chart.py +++ b/collectors/python.d.plugin/megacli/megacli.chart.py @@ -91,7 +91,7 @@ def battery_charts(bats): RE_ADAPTER = re.compile( - r'Adapter #([0-9]+) State(?:\s+)?: ([a-zA-Z]+)' + r'Adapter #([0-9]+) State(?:\s+)?: ([a-zA-Z ]+)' ) RE_VD = re.compile( @@ -124,14 +124,14 @@ def find_batteries(d): class Adapter: def __init__(self, n, state): self.id = n - self.state = int(state == 'Degraded') + # TODO: Rewrite all of this + self.state = int(state in ("Partially Degraded", "Degraded", "Failed")) def data(self): return { 'adapter_{0}_degraded'.format(self.id): self.state, } - class PD: def __init__(self, n, media_err, predict_fail): self.id = n |