@cryptotaxi247 / netdata-1 / commits / 4574e92f7

megacli: battery parse fix

lgz committed Jul 6, 2018 at 19:06 UTC 4574e92f7ee635b36402185c1afab3b2a2e99af4
1 file changed +2 -2
python.d/megacli.chart.py
+2 -2
@@ -91,7 +91,7 @@ RE_VD = re.compile(
91 )
92
93 RE_BATTERY = re.compile(
94 - r'BBU Capacity Info for Adapter: ([0-9]+) Relative State of Charge: ([0-9]+) % Cycle Count: ([0-5]+)'
94 + r'BBU Capacity Info for Adapter: ([0-9]+) Relative State of Charge: ([0-9]+) % Cycle Count: ([0-9]+)'
95 )
96
97
@@ -109,7 +109,7 @@ def find_pds(d):
109
110 def find_batteries(d):
111 keys = ('BBU Capacity Info for Adapter', 'Relative State of Charge', 'Cycle Count')
112 - d = ' '.join(v.strip() for v in d if v.startswith(keys))
112 + d = ' '.join(v.strip() for v in d if v.strip().startswith(keys))
113 return [Battery(*v) for v in RE_BATTERY.findall(d)]
114
115