Use simpler health calculation

This commit is contained in:
Joshua Boniface 2023-12-07 11:17:31 -05:00
parent a13273335d
commit 60dac143f2
1 changed files with 3 additions and 8 deletions

View File

@ -683,14 +683,9 @@ class MonitoringInstance(object):
# Map our check results to fault results # Map our check results to fault results
# These are not 1-to-1, as faults are cluster-wide. # These are not 1-to-1, as faults are cluster-wide.
# So a single node even with a severe fault is not alone enough to make the # We divide the delta by two since 2 nodes with the same problem
# whole cluster report a serious fault. But 2 is, so 25 is chosen here. # should equal what the result says.
if result.health_delta < 10: fault_delta = int(result.health_delta / 2)
fault_delta = 0
elif result.health_delta < 50:
fault_delta = 10
else:
fault_delta = 25
fault_message = ( fault_message = (
f"{self.this_node.name} {result.plugin_name}: {result.message}" f"{self.this_node.name} {result.plugin_name}: {result.message}"