Fixed graph of tactical view in metaconsole.

This commit is contained in:
Vanessa Gil 2014-09-29 11:19:51 +02:00
parent eb47ea6870
commit 9a8818b6a4
2 changed files with 10 additions and 5 deletions

View File

@ -1512,7 +1512,7 @@ function truncate_negatives(&$element) {
* @param bool return or echo flag * @param bool return or echo flag
* @param bool show_not_init flag * @param bool show_not_init flag
*/ */
function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $return = false, $show_not_init = false) { function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $return = false, $show_not_init = false, $data_agents=false) {
global $config; global $config;
@ -1531,8 +1531,13 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re
if ($show_not_init) { if ($show_not_init) {
$fields[] = 'SUM(notinit_count) "Not init"'; $fields[] = 'SUM(notinit_count) "Not init"';
} }
if ($data_agents == false) {
$data = db_get_row_filter('tagente', $filter, $fields);
} else {
$data = $data_agents;
}
$data = db_get_row_filter('tagente', $filter, $fields);
if (empty($data)) { if (empty($data)) {
$data = array(); $data = array();
} }

View File

@ -1350,7 +1350,7 @@ function reporting_get_stats_servers($tiny = true) {
return $output; return $output;
} }
function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150, $links = false) { function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150, $links = false, $data_agents=false) {
global $config; global $config;
// Link URLS // Link URLS
@ -1414,14 +1414,14 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
$tdata[2] = $tdata[3] = ''; $tdata[2] = $tdata[3] = '';
$table_mbs->rowclass[] = ''; $table_mbs->rowclass[] = '';
$table_mbs->data[] = $tdata; $table_mbs->data[] = $tdata;
if ($data["monitor_checks"] > 0) { if ($data["monitor_checks"] > 0) {
$tdata = array(); $tdata = array();
$table_mbs->colspan[count($table_mbs->data)][0] = 4; $table_mbs->colspan[count($table_mbs->data)][0] = 4;
$table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;'; $table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;';
$tdata[0] = '<div id="outter_status_pie" style="height: ' . $graph_height . 'px">' . $tdata[0] = '<div id="outter_status_pie" style="height: ' . $graph_height . 'px">' .
'<div id="status_pie" style="margin: auto; width: ' . $graph_width . 'px;">' . '<div id="status_pie" style="margin: auto; width: ' . $graph_width . 'px;">' .
graph_agent_status(false, $graph_width, $graph_height, true, true) . graph_agent_status(false, $graph_width, $graph_height, true, true, $data_agents) .
'</div></div>'; '</div></div>';
$table_mbs->rowclass[] = ''; $table_mbs->rowclass[] = '';
$table_mbs->data[] = $tdata; $table_mbs->data[] = $tdata;