From 5258d69e7e6cfe949ed8fbc27649ea51b47bb7e2 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 18 Jul 2018 17:44:18 +0200 Subject: [PATCH] fixed bug in meta alert view: agent names not showing in table --- pandora_console/include/functions_ui.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 633f007784..0e334cb35c 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -823,10 +823,26 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f else return array ("", "", "", "", "", "", ""); } - - // Get agent id - $id_agent = modules_get_agentmodule_agent ($alert['id_agent_module']); - $agente = db_get_row ('tagente', 'id_agente', $id_agent); + + + if (defined('METACONSOLE')) { + + $server = db_get_row ('tmetaconsole_setup', 'id', $alert['server_data']['id']); + + if (metaconsole_connect($server) == NOERR) { + + // Get agent data from node + $agente = db_get_row ('tagente', 'id_agente', $alert['id_agent']); + + metaconsole_restore_db (); + } + + } else { + // Get agent id + $id_agent = modules_get_agentmodule_agent ($alert['id_agent_module']); + $agente = db_get_row ('tagente', 'id_agente', $id_agent); + } + $template = alerts_get_alert_template ($alert['id_alert_template']); $description = io_safe_output($template['name']);