From 60dac143f21f7840d0140464520ff300a41f8760 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 7 Dec 2023 11:17:31 -0500 Subject: [PATCH] Use simpler health calculation --- .../pvchealthd/objects/MonitoringInstance.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/health-daemon/pvchealthd/objects/MonitoringInstance.py b/health-daemon/pvchealthd/objects/MonitoringInstance.py index f84c3d4c..61d99479 100644 --- a/health-daemon/pvchealthd/objects/MonitoringInstance.py +++ b/health-daemon/pvchealthd/objects/MonitoringInstance.py @@ -683,14 +683,9 @@ class MonitoringInstance(object): # Map our check results to fault results # 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 - # whole cluster report a serious fault. But 2 is, so 25 is chosen here. - if result.health_delta < 10: - fault_delta = 0 - elif result.health_delta < 50: - fault_delta = 10 - else: - fault_delta = 25 + # We divide the delta by two since 2 nodes with the same problem + # should equal what the result says. + fault_delta = int(result.health_delta / 2) fault_message = ( f"{self.this_node.name} {result.plugin_name}: {result.message}"