From a9675820b9c93b10e7bdf9e110557bfedc30be3e Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 3 Jun 2015 16:59:26 +0200 Subject: [PATCH] =?UTF-8?q?Fixes=20for=20the=20Oracl=E2=82=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/functions_reporting.php | 8 ---- .../include/functions_reporting_html.php | 42 ++++++++++--------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 14237dea7e..57ba9c9f44 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1234,14 +1234,6 @@ function reporting_event_top_n($report, $content, $type = 'dinamic', } $avg = $avg / $i; - unset($table_summary); - - $table_summary->width = '99%'; - $table_summary->data = array (); - $table_summary->head = array (); - $table_summary->head[0] = __('Min Value'); - $table_summary->head[1] = __('Average Value'); - $table_summary->head[2] = __('Max Value'); $return['resume']['min']['value'] = $min; $return['resume']['min']['formated_value'] = format_for_graph($min, 2); diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index c3440bfbf2..ef592b26d4 100755 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -404,6 +404,7 @@ function reporting_html_top_n($table, $item) { $table->data['top_n']['cell'] = $item['failed']; } else { + $table1 = new stdClass(); $table1->width = '99%'; $table1->align = array(); @@ -440,7 +441,7 @@ function reporting_html_top_n($table, $item) { } if (!empty($item['resume'])) { - $table1 = null; + $table1 = new stdClass(); $table1->width = '99%'; $table1->align = array(); @@ -803,28 +804,30 @@ function reporting_html_agent_module($table, $item) { ""; } + + foreach ($item['data'] as $row) { $table_data .= ""; switch ($row['agent_status']) { - case 4: // Alert fired status + case AGENT_STATUS_ALERT_FIRED: $rowcolor = COL_ALERTFIRED; $textcolor = '#000'; break; - case 1: // Critical status + case AGENT_STATUS_CRITICAL: $rowcolor = COL_CRITICAL; $textcolor = '#FFF'; break; - case 2: // Warning status + case AGENT_STATUS_WARNING: $rowcolor = COL_WARNING; $textcolor = '#000'; break; - case 0: // Normal status + case AGENT_STATUS_NORMAL: $rowcolor = COL_NORMAL; $textcolor = '#FFF'; break; - case 3: - case -1: - default: // Unknown status + case AGENT_STATUS_UNKNOWN: + case AGENT_STATUS_ALL: + default: $rowcolor = COL_UNKNOWN; $textcolor = '#FFF'; break; @@ -838,50 +841,50 @@ function reporting_html_agent_module($table, $item) { html_print_image($file_name, true, array('title' => $row['agent_name'])) . ""; - foreach ($row['modules'] as $module) { + foreach ($row['modules'] as $module_name => $module) { if (is_null($module)) { $table_data .= ""; } else { $table_data .= ""; switch ($module) { - case 0: + case AGENT_STATUS_NORMAL: $table_data .= ui_print_status_image( 'module_ok.png', __("%s in %s : NORMAL", - $module['name'], + $module_name, $row['agent_name']), true, array('width' => '20px', 'height' => '20px')); break; - case 1: + case AGENT_STATUS_CRITICAL: $table_data .= ui_print_status_image( 'module_critical.png', __("%s in %s : CRITICAL", - $module['name'], + $module_name, $row['agent_name']), true, array('width' => '20px', 'height' => '20px')); break; - case 2: + case AGENT_STATUS_WARNING: $table_data .= ui_print_status_image( 'module_warning.png', __("%s in %s : WARNING", - $module['name'], + $module_name, $row['agent_name']), true, array('width' => '20px', 'height' => '20px')); break; - case 3: + case AGENT_STATUS_UNKNOWN: $table_data .= ui_print_status_image( 'module_unknown.png', __("%s in %s : UNKNOWN", - $module['name'], + $module_name, $row['agent_name']), true, array('width' => '20px', 'height' => '20px')); break; - case 4: + case AGENT_STATUS_ALERT_FIRED: $table_data .= ui_print_status_image( 'module_alertsfired.png', __("%s in %s : ALERTS FIRED", - $module['name'], + $module_name, $row['agent_name']), true, array('width' => '20px', 'height' => '20px')); break; @@ -1815,6 +1818,7 @@ function reporting_html_sql(&$table, $item) { else { $first = true; + $table2 = new stdClass(); $table2->class = 'databox'; $table2->width = '100%';