Added label in automatic graph

This commit is contained in:
Daniel Maya 2017-08-03 12:41:47 +02:00 committed by daniel
parent 860a81aee8
commit 43285a9192
1 changed files with 23 additions and 18 deletions

View File

@ -5789,17 +5789,10 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
require_once ($config["homedir"] . '/include/functions_graph.php');
if ($type_report == 'automatic_graph') {
// Do none
}
else {
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
@ -5853,6 +5846,22 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
'id_agent_module'=>$graph_item['id_agent_module']);
}
if($type_report == 'automatic_graph'){
$label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if (!empty($label)) {
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
$label = reporting_label_macro($content, $label);
if ($config['metaconsole']) {
metaconsole_restore_db();
}
}
}
$labels[$graph_item['id_agent_module']] = $label;
}
}
@ -5909,15 +5918,11 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
break;
}
if ($type_report == 'automatic_graph') {
// Do none
}
else {
if ($config['metaconsole']) {
metaconsole_restore_db();
}
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
metaconsole_restore_db();
}
return reporting_check_structure_content($return);
}