Merge branch 'ent-5181-Pete-SQL-y-mal-funcionamineto-de-Auto-combined-graph' into 'develop'

Ent 5181 pete sql y mal funcionamineto de auto combined graph

See merge request artica/pandorafms!3000
This commit is contained in:
Daniel Rodriguez 2020-01-08 14:46:29 +01:00
commit 1f15fd5dae
2 changed files with 36 additions and 12 deletions

View File

@ -1446,9 +1446,20 @@ function graphic_combined_module(
$data_module_graph['agent_name'] = modules_get_agentmodule_agent_name(
$agent_module_id
);
if (is_metaconsole()) {
$data_module_graph['agent_alias'] = db_get_value(
'alias',
'tagente',
'id_agente',
(int) $module_data['id_agente']
);
} else {
$data_module_graph['agent_alias'] = modules_get_agentmodule_agent_alias(
$agent_module_id
);
}
$data_module_graph['agent_id'] = $module_data['id_agente'];
$data_module_graph['module_name'] = $module_data['nombre'];
$data_module_graph['id_module_type'] = $module_data['id_tipo_modulo'];

View File

@ -325,6 +325,17 @@ function reporting_make_reporting_data(
$content['id_agent']
);
// This is for metaconsole. It is an array with modules and server (id node).
if (is_array($content['id_agent_module'])) {
$modules_server_array = $content['id_agent_module'];
$modules_array = [];
foreach ($modules_server_array as $value) {
$modules_array[] = $value['module'];
}
$content['id_agent_module'] = $modules_array;
}
$modules = agents_get_modules(
$agent_value,
[
@ -7599,6 +7610,7 @@ function reporting_custom_graph(
$content['name'] = __('Simple graph');
}
if ($type_report != 'automatic_graph') {
$module_source = db_get_all_rows_sql(
'SELECT id_agent_module
FROM tgraph_source
@ -7611,6 +7623,7 @@ function reporting_custom_graph(
$modules[$key] = $value['id_agent_module'];
}
}
}
$agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent);