From a3e47fb977c9b6065bc2555655b9ecf13a0bbdc5 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Tue, 28 Nov 2017 15:56:46 +0100 Subject: [PATCH] Fixed reporting_event_report_module in metaconsole --- pandora_console/include/functions_events.php | 8 ++++++-- pandora_console/include/functions_reporting.php | 14 +++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 763f246bdf..1a6181110f 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1261,7 +1261,7 @@ function events_get_group_events_steps ($begin, &$result, $id_group, $period, $d function events_get_agent ($id_agent, $period, $date = 0, $history = false, $show_summary_group = false, $filter_event_severity = false, $filter_event_type = false, $filter_event_status = false, $filter_event_filter_search=false, - $id_group = false, $events_group = false, $id_agent_module = false, $events_module = false) { + $id_group = false, $events_group = false, $id_agent_module = false, $events_module = false, $id_server = false) { global $config; if (!is_numeric ($date)) { @@ -1364,7 +1364,11 @@ function events_get_agent ($id_agent, $period, $date = 0, $sql_where .= sprintf(' AND id_agente = %d AND utimestamp > %d AND utimestamp <= %d ', $id_agent, $datelimit, $date); } - + + if(is_metaconsole() && $id_server){ + $sql_where.= " AND server_id = ".$id_server; + } + if($show_summary_group){ return events_get_events_grouped($sql_where, 0, 1000, is_metaconsole(), false, false, $history); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 26ea84367a..70eb9f0c92 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1559,14 +1559,18 @@ function reporting_event_report_module($report, $content, $event_graph_by_user_validator = $event_filter['event_graph_by_user_validator']; $event_graph_by_criticity = $event_filter['event_graph_by_criticity']; $event_graph_validated_vs_unvalidated = $event_filter['event_graph_validated_vs_unvalidated']; - + + $id_server = false; + if(is_metaconsole()){ + $id_server = metaconsole_get_id_server($content["server_name"]); + } //data events $data = reporting_get_module_detailed_event ( $content['id_agent_module'], $content['period'], $report["datetime"], $show_summary_group, $filter_event_severity, $filter_event_type, $filter_event_status, $filter_event_filter_search, $force_width_chart, $event_graph_by_user_validator, $event_graph_by_criticity, - $event_graph_validated_vs_unvalidated, $ttl); + $event_graph_validated_vs_unvalidated, $ttl, $id_server); if (empty($data)) { $return['failed'] = __('No events'); @@ -6793,7 +6797,7 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0, $filter_event_type = false, $filter_event_status = false, $filter_event_filter_search = false, $force_width_chart = false, $event_graph_by_user_validator = false, $event_graph_by_criticity = false, - $event_graph_validated_vs_unvalidated = false, $ttl = 1) { + $event_graph_validated_vs_unvalidated = false, $ttl = 1, $id_server = false) { global $config; @@ -6816,8 +6820,8 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0, $event['data'] = events_get_agent (false, (int) $period, (int) $date, $history, $show_summary_group, $filter_event_severity, $filter_event_type, $filter_event_status, $filter_event_filter_search, - false, false, $id_module, true); - + false, false, $id_module, true , $id_server); + //total_events if(isset($event['data'])){ $event['total_events'] = count($event['data']);