From fa8329ac3d7991b8349b8b91ed8be1256fdba7f3 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 16 Sep 2023 22:58:49 -0400 Subject: [PATCH] Explicitly round load avg in load plugin --- node-daemon/plugins/load | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node-daemon/plugins/load b/node-daemon/plugins/load index 5806a627..c9fba488 100644 --- a/node-daemon/plugins/load +++ b/node-daemon/plugins/load @@ -72,13 +72,13 @@ class MonitoringPluginScript(MonitoringPlugin): from psutil import cpu_count # Get the current 1-minute system load average - load_average = getloadavg()[0] + load_average = float(round(getloadavg()[0], 2)) # Get the number of CPU cores - cpu_cores = cpu_count() + cpu_cores = float(cpu_count()) # Check that the load average is greater or equal to the cpu count - if load_average > float(cpu_cores): + if load_average > cpu_cores: # Set the health delta to 10 (subtract 10 from the total of 100) health_delta = 50 # Craft a message that can be used by the clients