From e779d4ff0b18aff0a441591a4cbffc09031ee5a2 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 5 Jan 2017 13:53:49 +0100 Subject: [PATCH] fixed error metaconsole connection macros (cherry picked from commit e244d766a448ff6d7792e8a26542f67b1e278f49) --- .../include/functions_reporting.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 4f048e3e8f..2e78622ead 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -135,7 +135,25 @@ function reporting_make_reporting_data($report = null, $id_report, $items_label['type'] = $content['type']; $items_label['id_agent'] = $content['id_agent']; $items_label['id_agent_module'] = $content['id_agent_module']; + $metaconsole_on = is_metaconsole(); + $server_name = $content['server_name']; + + //Metaconsole connection + if ($metaconsole_on && $server_name != '') { + $connection = metaconsole_get_connection($server_name); + if (!metaconsole_load_external_db($connection)) { + //ui_print_error_message ("Error connecting to ".$server_name); + continue; + } + } + $content['name'] = reporting_label_macro($items_label, $content['style']['name_label']); + + if ($metaconsole_on) { + //Restore db connection + metaconsole_restore_db(); + } + } switch (reporting_get_type($content)) { case 'simple_graph':