Skip to content

Commit

Permalink
fix(fixing_sensor): Fix for badly behaving super-micro sensor #271
Browse files Browse the repository at this point in the history
Precommit-Verified: a3bc138f5493dbb0bd4e76ec78f24b7019e999c367eb7874a1a56ec62bc8bc31

Co-authored-by: @Z903
  • Loading branch information
pryorda authored Jun 10, 2021
1 parent c777973 commit 2d5c196
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vmware_exporter/vmware_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,10 @@ def _vmware_get_hosts(self, host_metrics):
sensors = [s for s in sensors if ':' in s]

for s in sensors:
sensor = dict(item.split("=") for item in s.split(":")[1:])
sensor = dict(item.split("=") for item in re.split(r':(?=\w+=)', s)[1:])

if not all(key in sensor for key in ['sensorStatus', 'name', 'type', 'unit', 'value']):
continue

sensor_status = {
'red': 0,
Expand Down

0 comments on commit 2d5c196

Please sign in to comment.