Added cases when critical, warning or normal alert has been fired

This commit is contained in:
alejandro-campos 2020-05-25 13:10:46 +02:00
parent b595548eee
commit 4d7341917c
1 changed files with 5 additions and 5 deletions

View File

@ -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;