From 5df6eb8cac0d50fedcc78a7e6c0f5d25d922a1f7 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 15 Sep 2022 18:04:44 +0200 Subject: [PATCH] Fix the interpretation of inverse intervals. --- pandora_server/lib/PandoraFMS/Core.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index eda4c5a70c..1d32526aaf 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -5096,8 +5096,11 @@ sub get_module_status ($$$$) { } # (-inf, critical_min), [critical_max, +inf) else { - return 1 if ($data < $critical_min || $data >= $critical_max); - return 1 if ($data <= $critical_max && $critical_max < $critical_min); + if ($critical_max < $critical_min) { + return 1 if ($data < $critical_min); + } else { + return 1 if ($data < $critical_min || $data >= $critical_max); + } } } @@ -5110,8 +5113,11 @@ sub get_module_status ($$$$) { } # (-inf, warning_min), [warning_max, +inf) else { - return 2 if ($data < $warning_min || $data >= $warning_max); - return 2 if ($data <= $warning_max && $warning_max < $warning_min); + if ($warning_max < $warning_min) { + return 2 if ($data < $warning_min); + } else { + return 2 if ($data < $warning_min || $data >= $warning_max); + } } } }