2013-05-03 Junichi Satoh <junichi@rworks.jp>

* include/functions_graph.php: Fixed warnings



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8095 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2013-05-03 08:19:07 +00:00
parent 21d1e9eef8
commit 160b857672
2 changed files with 40 additions and 26 deletions

View File

@ -1,3 +1,7 @@
2013-05-03 Junichi Satoh <junichi@rworks.jp>
* include/functions_graph.php: Fixed warnings.
2013-05-01 Miguel de Dios <miguel.dedios@artica.es> 2013-05-01 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/agent_manager.php: improved the source code style. * godmode/agentes/agent_manager.php: improved the source code style.

View File

@ -2615,6 +2615,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
$event_value = 0; $event_value = 0;
$alert_value = 0; $alert_value = 0;
$unknown_value = 0; $unknown_value = 0;
$is_unknown = false;
$event_ids = array(); $event_ids = array();
$alert_ids = array(); $alert_ids = array();
@ -2856,6 +2857,12 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
global $long_index; global $long_index;
global $series_type; global $series_type;
global $chart_extra_data; global $chart_extra_data;
if (empty($unit_name)) {
$unit = modules_get_unit($agent_module_id);
}
else
$unit = $unit_name;
$series_suffix_str = ''; $series_suffix_str = '';
if ($compare !== false) { if ($compare !== false) {
@ -3415,6 +3422,7 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
} }
$legend = array(); $legend = array();
$cont = 0;
for ($i = 0; $i < $interval; $i++) { for ($i = 0; $i < $interval; $i++) {
$bottom = $datelimit + ($periodtime * $i); $bottom = $datelimit + ($periodtime * $i);
if (! $graphic_type) { if (! $graphic_type) {
@ -3432,33 +3440,35 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
'utimestamp > '.$bottom, 'utimestamp > '.$bottom,
'utimestamp < '.$top), 'utimestamp < '.$top),
'event_type, utimestamp'); 'event_type, utimestamp');
$status = 'normal'; if (!empty($events)) {
foreach($events as $event) { $status = 'normal';
if (empty($event['utimestamp'])) { foreach($events as $event) {
continue; if (empty($event['utimestamp'])) {
} continue;
}
switch($event['event_type']) { switch($event['event_type']) {
case 'going_down_normal': case 'going_down_normal':
case 'going_up_normal': case 'going_up_normal':
// The default status is normal. Do nothing // The default status is normal. Do nothing
break; break;
case 'going_unknown': case 'going_unknown':
if($status == 'normal') { if($status == 'normal') {
$status = 'unknown'; $status = 'unknown';
} }
break; break;
case 'going_up_warning': case 'going_up_warning':
case 'going_down_warning': case 'going_down_warning':
if($status == 'normal' || $status == 'unknown') { if($status == 'normal' || $status == 'unknown') {
$status = 'warning'; $status = 'warning';
} }
break; break;
case 'going_up_critical': case 'going_up_critical':
case 'going_down_critical': case 'going_down_critical':
$status = 'critical'; $status = 'critical';
break; break;
}
} }
} }