From 72ee6158fa1cf4edfb67e6dcdb3bf1f2b2618540 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 16 Jun 2015 14:42:17 +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 --- .../reporting_builder.item_editor.php | 23 ++++++++++-- .../include/functions_reporting.php | 36 +++++++++++++++++-- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 5477e52edf..b9f39acfcc 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -462,7 +462,21 @@ switch ($action) { $description = $item['description']; $period = $item['period']; $exception_condition = $item['exception_condition']; - $exception_condition_value = $item['exception_condition_value']; + + switch ($config['dbtype']) { + case "mysql": + case "postgresql": + $exception_condition_value = + $item['exception_condition_value']; + break; + case "oracle": + $exception_condition_value = + oracle_format_float_to_php( + $item['exception_condition_value']); + break; + } + + $show_resume = $item['show_resume']; $show_graph = $item['show_graph']; $order_uptodown = $item['order_uptodown']; @@ -1076,7 +1090,12 @@ else - + + + diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 5b6f504026..2e87621775 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2392,6 +2392,8 @@ function reporting_group_configuration($report, $content) { $group_name = groups_get_name($content['id_group'], true); + + $return['title'] = $content['name']; $return['subtitle'] = $group_name; $return["description"] = $content["description"]; @@ -2411,22 +2413,41 @@ function reporting_group_configuration($report, $content) { } } else { - $sql = "SELECT * FROM tagente WHERE id_grupo=" . $content['id_group']; + $sql = " + SELECT * + FROM tagente + WHERE id_grupo=" . $content['id_group']; } + + $agents_list = db_get_all_rows_sql($sql); if ($agents_list === false) $agents_list = array(); + + $return['data'] = array(); foreach ($agents_list as $agent) { $content_agent = $content; $content_agent['id_agent'] = $agent['id_agente']; - $agent_report = reporting_agent_configuration($report, $content_agent); + + // Restore the connection to metaconsole + // because into the function reporting_agent_configuration + // connect to metaconsole. + + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + $agent_report = reporting_agent_configuration( + $report, $content_agent); + $return['data'][] = $agent_report['data']; } + + if ($config['metaconsole']) { metaconsole_restore_db(); } @@ -2600,11 +2621,14 @@ function reporting_alert_report_group($report, $content) { array('id' => $alert['id_alert_template'])); + $actions = db_get_all_rows_sql('SELECT name FROM talert_actions WHERE id IN (SELECT id_alert_action FROM talert_template_module_actions - WHERE id_alert_template_module = ' . $alert['id_alert_template'] . ');'); + WHERE id_alert_template_module = ' . $alert['id_alert_template'] . ')'); + + if (!empty($actions)) { $row = db_get_row_sql('SELECT id_alert_action @@ -2630,6 +2654,8 @@ function reporting_alert_report_group($report, $content) { } } + + $data_row['action'] = array(); foreach ($actions as $action) { $data_row['action'][] = $action['name']; @@ -3320,6 +3346,8 @@ function reporting_agent_configuration($report, $content) { $return["description"] = $content["description"]; $return["date"] = reporting_get_date_text($report, $content); + + if ($config['metaconsole']) { $id_meta = metaconsole_get_id_server($content["server_name"]); @@ -3349,6 +3377,8 @@ function reporting_agent_configuration($report, $content) { $modules = agents_get_modules ($content['id_agent']); + + $agent_configuration['modules'] = array(); //Agent's modules if (!empty($modules)) {