From 4d7341917c46a16917fe747663ebf280da1a350f Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 25 May 2020 13:10:46 +0200 Subject: [PATCH] Added cases when critical, warning or normal alert has been fired --- pandora_console/include/functions_api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 76e10533aa..6ee93eb409 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -2048,31 +2048,31 @@ function api_get_all_agents($thrash1, $thrash2, $other, $returnType) // Filter by status switch ($other['data'][2]) { case 'warning': - if ($status == 2) { + if ($status == AGENT_MODULE_STATUS_WARNING || $status == AGENT_MODULE_STATUS_WARNING_ALERT) { $result_agents[] = $agent; } break; case 'critical': - if ($status == 1) { + if ($status == AGENT_MODULE_STATUS_CRITICAL_BAD || $status == AGENT_MODULE_STATUS_CRITICAL_ALERT) { $result_agents[] = $agent; } break; case 'unknown': - if ($status == 3) { + if ($status == AGENT_MODULE_STATUS_UNKNOWN) { $result_agents[] = $agent; } break; case 'normal': - if ($status == 0) { + if ($status == AGENT_MODULE_STATUS_NORMAL || $status == AGENT_MODULE_STATUS_NORMAL_ALERT) { $result_agents[] = $agent; } break; case 'alert_fired': - if ($status == 4) { + if ($status == AGENT_STATUS_ALERT_FIRED) { $result_agents[] = $agent; } break;