Merge branch 'ent-3392-7367-estado-de-elemento-incorrecto-en-consola-visual' into 'develop'

Fixed agent status in visual map

See merge request artica/pandorafms!2148

Former-commit-id: d2dd7165a3dac9228948b8a1b8878b9fb3e2b491
This commit is contained in:
Daniel Rodriguez 2019-02-11 14:49:59 +01:00
commit e51864ac6f
1 changed files with 19 additions and 22 deletions

View File

@ -3897,25 +3897,22 @@ function visual_map_get_user_layouts(
return $retval; return $retval;
} }
function visual_map_translate_agent_status ($agent_status) {
function visual_map_translate_agent_status($agent_status)
{
switch ($agent_status) { switch ($agent_status) {
case AGENT_STATUS_NORMAL: case AGENT_STATUS_NORMAL:
case AGENT_MODULE_STATUS_NORMAL_ALERT:
default: default:
return VISUAL_MAP_STATUS_NORMAL; return VISUAL_MAP_STATUS_NORMAL;
case AGENT_STATUS_CRITICAL: case AGENT_STATUS_CRITICAL:
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
return VISUAL_MAP_STATUS_CRITICAL_BAD; return VISUAL_MAP_STATUS_CRITICAL_BAD;
case AGENT_STATUS_WARNING: case AGENT_STATUS_WARNING:
case AGENT_MODULE_STATUS_WARNING_ALERT:
return VISUAL_MAP_STATUS_WARNING; return VISUAL_MAP_STATUS_WARNING;
case AGENT_STATUS_NOT_INIT: case AGENT_STATUS_NOT_INIT:
case AGENT_STATUS_UNKNOWN: case AGENT_STATUS_UNKNOWN:
case -1: case -1:
return VISUAL_MAP_STATUS_UNKNOWN; return VISUAL_MAP_STATUS_UNKNOWN;
case AGENT_STATUS_ALERT_FIRED: case AGENT_STATUS_ALERT_FIRED:
return VISUAL_MAP_STATUS_CRITICAL_ALERT; return VISUAL_MAP_STATUS_CRITICAL_ALERT;
} }