Fixed bug in auto combined graph

This commit is contained in:
Tatiana Llorente 2020-01-08 11:37:44 +01:00
parent 64e63dad63
commit 2c019f04ee
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( $data_module_graph['agent_name'] = modules_get_agentmodule_agent_name(
$agent_module_id $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( $data_module_graph['agent_alias'] = modules_get_agentmodule_agent_alias(
$agent_module_id $agent_module_id
); );
}
$data_module_graph['agent_id'] = $module_data['id_agente']; $data_module_graph['agent_id'] = $module_data['id_agente'];
$data_module_graph['module_name'] = $module_data['nombre']; $data_module_graph['module_name'] = $module_data['nombre'];
$data_module_graph['id_module_type'] = $module_data['id_tipo_modulo']; $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'] $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( $modules = agents_get_modules(
$agent_value, $agent_value,
[ [
@ -7599,6 +7610,7 @@ function reporting_custom_graph(
$content['name'] = __('Simple graph'); $content['name'] = __('Simple graph');
} }
if ($type_report != 'automatic_graph') {
$module_source = db_get_all_rows_sql( $module_source = db_get_all_rows_sql(
'SELECT id_agent_module 'SELECT id_agent_module
FROM tgraph_source FROM tgraph_source
@ -7611,6 +7623,7 @@ function reporting_custom_graph(
$modules[$key] = $value['id_agent_module']; $modules[$key] = $value['id_agent_module'];
} }
} }
}
$agent_description = agents_get_description($id_agent); $agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent); $agent_group = agents_get_agent_group($id_agent);