Skip to content

Commit 2d5c196

Browse files
authored
fix(fixing_sensor): Fix for badly behaving super-micro sensor #271
Precommit-Verified: a3bc138f5493dbb0bd4e76ec78f24b7019e999c367eb7874a1a56ec62bc8bc31 Co-authored-by: @Z903
1 parent c777973 commit 2d5c196

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vmware_exporter/vmware_exporter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,10 @@ def _vmware_get_hosts(self, host_metrics):
16951695
sensors = [s for s in sensors if ':' in s]
16961696

16971697
for s in sensors:
1698-
sensor = dict(item.split("=") for item in s.split(":")[1:])
1698+
sensor = dict(item.split("=") for item in re.split(r':(?=\w+=)', s)[1:])
1699+
1700+
if not all(key in sensor for key in ['sensorStatus', 'name', 'type', 'unit', 'value']):
1701+
continue
16991702

17001703
sensor_status = {
17011704
'red': 0,

0 commit comments

Comments
 (0)