Skip to content

Commit

Permalink
Check fan speed before check fan status (sonic-net#6586)
Browse files Browse the repository at this point in the history
**- Why I did it**
In thermalctd, when speed of fan exceeds threshold, the fan status will be saved as "bad". So in system health, it is better to check fan speed before fan status. In this case, if fan speed exceeds threshold, we get more detailed information.

**- How I did it**
Move fan speed check logic before fan status check

**- How to verify it**
Manual test
  • Loading branch information
Junchao-Mellanox authored and deran1980 committed Feb 4, 2021
1 parent 15fc9ee commit ac8b17e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/system-health/health_checker/hardware_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ def _check_fan_status(self, config):
self.set_object_not_ok('Fan', name, '{} is missing'.format(name))
continue

status = data_dict.get('status', 'false')
if status.lower() != 'true':
self.set_object_not_ok('Fan', name, '{} is broken'.format(name))
continue

if not self._ignore_check(config.ignore_devices, 'fan', name, 'speed'):
speed = data_dict.get('speed', None)
speed_target = data_dict.get('speed_target', None)
Expand Down Expand Up @@ -130,6 +125,11 @@ def _check_fan_status(self, config):
speed_tolerance))
continue

status = data_dict.get('status', 'false')
if status.lower() != 'true':
self.set_object_not_ok('Fan', name, '{} is broken'.format(name))
continue

self.set_object_ok('Fan', name)

def _check_psu_status(self, config):
Expand Down

0 comments on commit ac8b17e

Please sign in to comment.