2011-08-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_graph.php, operation/agentes/stat_win.php: fixeds to show always units, and now show only avg by default, and now run the showing baseline again. Fixes: #3390113 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4745 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
95fb9a34c9
commit
75a01d0d15
|
@ -1,3 +1,11 @@
|
||||||
|
2011-08-16 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_graph.php, operation/agentes/stat_win.php: fixeds to
|
||||||
|
show always units, and now show only avg by default, and now run the
|
||||||
|
showing baseline again.
|
||||||
|
|
||||||
|
Fixes: #3390113
|
||||||
|
|
||||||
2011-08-16 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
2011-08-16 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
* pandoradb.oracle.sql
|
* pandoradb.oracle.sql
|
||||||
|
|
|
@ -34,6 +34,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
|
|
||||||
|
enterprise_include_once("include/functions_reporting.php");
|
||||||
|
|
||||||
// Set variables
|
// Set variables
|
||||||
if ($date == 0) $date = get_system_time();
|
if ($date == 0) $date = get_system_time();
|
||||||
$datelimit = $date - $period;
|
$datelimit = $date - $period;
|
||||||
|
@ -122,19 +124,24 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
||||||
if ($data[0]['utimestamp'] == $datelimit) {
|
if ($data[0]['utimestamp'] == $datelimit) {
|
||||||
$previous_data = $data[0]['datos'];
|
$previous_data = $data[0]['datos'];
|
||||||
$j++;
|
$j++;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$previous_data = 0;
|
$previous_data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get baseline data
|
// Get baseline data
|
||||||
$baseline_data = array ();
|
if ($baseline) {
|
||||||
if ($baseline == 1) {
|
$baseline_data = array ();
|
||||||
$baseline_data = enterprise_hook ('reporting_enterprise_get_baseline', array ($agent_module_id, $period, $width, $height , $title, $unit_name, $date));
|
if ($baseline == 1) {
|
||||||
if ($baseline_data === ENTERPRISE_NOT_HOOK) {
|
$baseline_data = enterprise_hook ('reporting_enterprise_get_baseline', array ($agent_module_id, $period, $width, $height , $title, $unit_name, $date));
|
||||||
$baseline_data = array ();
|
if ($baseline_data === ENTERPRISE_NOT_HOOK) {
|
||||||
|
$baseline_data = array ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$units = modules_get_unit($agent_module_id);
|
||||||
|
|
||||||
// Calculate chart data
|
// Calculate chart data
|
||||||
for ($i = 0; $i < $resolution; $i++) {
|
for ($i = 0; $i < $resolution; $i++) {
|
||||||
$timestamp = $datelimit + ($interval * $i);
|
$timestamp = $datelimit + ($interval * $i);
|
||||||
|
@ -210,20 +217,37 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
$chart[$timestamp]['sum'] = $total;
|
if ($avg_only) {
|
||||||
$chart[$timestamp]['min'] = $interval_min;
|
$chart[$timestamp]['sum'] = $total;
|
||||||
$chart[$timestamp]['max'] = $interval_max;
|
}
|
||||||
|
else {
|
||||||
|
$chart[$timestamp]['sum'] = $total;
|
||||||
|
$chart[$timestamp]['min'] = $interval_min;
|
||||||
|
$chart[$timestamp]['max'] = $interval_max;
|
||||||
|
}
|
||||||
$previous_data = $total;
|
$previous_data = $total;
|
||||||
// Compressed data
|
// Compressed data
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if ($uncompressed_module || ($timestamp > time ())) {
|
if ($uncompressed_module || ($timestamp > time ())) {
|
||||||
$chart[$timestamp]['sum'] = 0;
|
if ($avg_only) {
|
||||||
$chart[$timestamp]['min'] = 0;
|
$chart[$timestamp]['sum'] = 0;
|
||||||
$chart[$timestamp]['max'] = 0;
|
}
|
||||||
} else {
|
else {
|
||||||
$chart[$timestamp]['sum'] = $previous_data;
|
$chart[$timestamp]['sum'] = 0;
|
||||||
$chart[$timestamp]['min'] = $previous_data;
|
$chart[$timestamp]['min'] = 0;
|
||||||
$chart[$timestamp]['max'] = $previous_data;
|
$chart[$timestamp]['max'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($avg_only) {
|
||||||
|
$chart[$timestamp]['sum'] = $previous_data;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$chart[$timestamp]['sum'] = $previous_data;
|
||||||
|
$chart[$timestamp]['min'] = $previous_data;
|
||||||
|
$chart[$timestamp]['max'] = $previous_data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,12 +262,16 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
||||||
if($show_alerts) {
|
if($show_alerts) {
|
||||||
$chart[$timestamp]['alert'] = $alert_value;
|
$chart[$timestamp]['alert'] = $alert_value;
|
||||||
}
|
}
|
||||||
$chart[$timestamp]['baseline'] = array_shift ($baseline_data);
|
if ($baseline) {
|
||||||
if ($chart[$timestamp]['baseline'] == NULL) {
|
$chart[$timestamp]['baseline'] = array_shift ($baseline_data);
|
||||||
$chart[$timestamp]['baseline'] = 0;
|
if ($chart[$timestamp]['baseline'] == NULL) {
|
||||||
}
|
$chart[$timestamp]['baseline'] = 0;
|
||||||
$units = modules_get_unit($agent_module_id);
|
}
|
||||||
$chart[$timestamp]['unit'] = 0;
|
}
|
||||||
|
|
||||||
|
if (!empty($units)) {
|
||||||
|
$chart[$timestamp]['unit'] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return chart data and don't draw
|
// Return chart data and don't draw
|
||||||
|
|
|
@ -96,6 +96,15 @@ function getTermEle(ele) {
|
||||||
}
|
}
|
||||||
return ele;
|
return ele;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show_others() {
|
||||||
|
if (!$("#checkbox-avg_only").attr('checked')) {
|
||||||
|
$("#hidden-show_other").val(1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#hidden-show_other").val(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -111,7 +120,11 @@ if (!isset($_GET["period"]) OR (!isset($_GET["id"]))) {
|
||||||
|
|
||||||
$period = get_parameter ( "period", 3600);
|
$period = get_parameter ( "period", 3600);
|
||||||
$draw_alerts = get_parameter("draw_alerts", 0);
|
$draw_alerts = get_parameter("draw_alerts", 0);
|
||||||
$avg_only = get_parameter ("avg_only", 0);
|
$avg_only = get_parameter ("avg_only", 1);
|
||||||
|
$show_other = (bool)get_parameter('show_other', false);
|
||||||
|
if ($show_other) {
|
||||||
|
$avg_only = 0;
|
||||||
|
}
|
||||||
$period = get_parameter ("period", 86400);
|
$period = get_parameter ("period", 86400);
|
||||||
$id = get_parameter ("id", 0);
|
$id = get_parameter ("id", 0);
|
||||||
$width = get_parameter ("width", 555);
|
$width = get_parameter ("width", 555);
|
||||||
|
@ -186,7 +199,8 @@ html_print_input_text ("refresh", $refresh, '', 5);
|
||||||
|
|
||||||
echo ' '.__('Avg. Only');
|
echo ' '.__('Avg. Only');
|
||||||
|
|
||||||
html_print_checkbox ("avg_only", 1, (bool) $avg_only);
|
html_print_checkbox ("avg_only", 1, (bool) $avg_only, false, false, 'show_others()');
|
||||||
|
html_print_input_hidden('show_other', 0);
|
||||||
|
|
||||||
echo '<tr><td>'.__('Begin date').'</td><td>';
|
echo '<tr><td>'.__('Begin date').'</td><td>';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue