Merge branch '1659-Informe-de-eventos-de-módulos-en-plantillas-de-informes-de-la-metaconsola--Carrefour]-dev' into 'develop'
Fixed reporting_event_report_module in metaconsole See merge request artica/pandorafms!1128
This commit is contained in:
commit
60486c8a1e
|
@ -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);
|
||||
|
|
|
@ -1572,14 +1572,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');
|
||||
|
@ -6809,7 +6813,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;
|
||||
|
||||
|
@ -6832,8 +6836,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']);
|
||||
|
|
Loading…
Reference in New Issue