From 4a93f6c3a6dac3398e750154d03ed68b87e4ee43 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 8 Sep 2020 11:48:27 +0200 Subject: [PATCH] Fixed metaconsole SNMP interface graphs --- pandora_console/include/functions_graph.php | 6 ++++-- .../operation/agentes/interface_traffic_graph_win.php | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index bbbeb07e80..c86e1bdc38 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1286,7 +1286,7 @@ function graphic_combined_module( if ($count_modules > 0) { foreach ($module_list as $key => $value) { - $sources[$key]['id_server'] = $value['server']; + $sources[$key]['id_server'] = (isset($value['id_server']) === true) ? $value['id_server'] : $params['id_server']; $sources[$key]['id_agent_module'] = $value['module']; $sources[$key]['weight'] = $weights[$key]; $sources[$key]['label'] = $params_combined['labels']; @@ -1339,6 +1339,7 @@ function graphic_combined_module( $modules = []; foreach ($sources as $source) { if (is_metaconsole() === true) { + metaconsole_restore_db(); $server = metaconsole_get_connection_by_id($source['id_server']); if (metaconsole_connect($server) != NOERR) { continue; @@ -1499,8 +1500,9 @@ function graphic_combined_module( } if (is_metaconsole()) { + metaconsole_restore_db(); $server = metaconsole_get_connection_by_id( - $agent_module_id['server'] + isset($agent_module_id['server']) ? $agent_module_id['server'] : $source['id_server'] ); if (metaconsole_connect($server) != NOERR) { continue; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 08070a459d..0f1675fdb0 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -154,6 +154,10 @@ if ($date > $now) { 'zoom' => $zoom, ]; + if (is_metaconsole()) { + $params['id_server'] = $server_id; + } + if ($config['type_interface_charts'] == 'line') { $stacked = CUSTOM_GRAPH_LINE; } else {