diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 726078ab0d..4e7652fc6b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2011-05-30 Javier Lanz + * include/functions_reporting.php: Edited "render_report_html" function + to work with metaconsole printing metaconsole elements + * include/javascript/pandora.js: Modified autocomplete javascript to use + with metaconsole + * include/ajax/reporting.ajax.php: Edited to work with metaconsole + * include/ajax/agent.php: Edited autocomplete to work with metaconsole + * operation/agentes/ver_agente.php: Modified to get the agent's modules + using metacofacensole + * godmode/reporting/reporting_builder.list_items.php: Edited to display + agents & modules in metaconsole. Edited top filters to work with + metaconsole + * godmode/reporting/reporting_builder.php: Added getting parameter + server_name & fixed deleting items + * godmode/reporting/reporting_builder.item_editor.php: Edited to send + the host when metaconsole is active + 2011-05-30 Juan Manuel Ramon * install.php: Fixed typo mistake in this file. diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 60a787e1e5..25598abff7 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -28,6 +28,7 @@ $show_graph_options[1] = __('Table & Graph'); $show_graph_options[2] = __('Only graph'); enterprise_include('/godmode/reporting/reporting_builder.item_editor.php'); +enterprise_include_once ('include/functions_metaconsole.php'); require_once ($config['homedir'].'/include/functions_agents.php'); switch ($action) { @@ -67,15 +68,24 @@ switch ($action) { $show_in_two_columns = 0; $show_in_landscape = 0; $modulegroup = 0; + $server_name = ''; break; default: $actionParameter = 'update'; $item = db_get_row_filter('treport_content', array('id_rc' => $idItem)); + $server_name = $item ['server_name']; + // Metaconsole db connection + if (($config ['metaconsole'] == 1) && ($server_name != '')) { + $connection = metaconsole_get_connection($server_name); + if (!metaconsole_load_external_db($connection)) { + ui_print_error_message ("Error connecting to ".$server_name); + } + } + $style = json_decode(io_safe_output($item['style']), true); $show_in_two_columns = $style['show_in_two_columns']; $show_in_landscape = $style['show_in_landscape']; - $type = $item['type']; switch ($type) { case 'avg_value': @@ -357,6 +367,7 @@ html_print_input_hidden('id_item', $idItem); html_print_input_text_extended ('agent', agents_get_name ($idAgent), 'text-agent', '', 30, 100, false, '', array('style' => 'background: url(images/lightning.png) no-repeat right;')) . ' ' . __("Type at least two characters to search") . ''; + html_print_input_hidden ('server_name', $server_name); ?> @@ -516,8 +527,13 @@ ui_require_javascript_file('pandora'); if ($enterpriseEnable) { reporting_enterprise_text_box(); } +//Restore db connection +if ($config ['metaconsole'] == 1) { + metaconsole_restore_db(); +} function print_SLA_list($width, $action, $idItem = null) { + global $config; ?> @@ -548,6 +564,14 @@ function print_SLA_list($width, $action, $idItem = null) { $itemsSLA = array(); } foreach ($itemsSLA as $item) { + $server_name = $item ['server_name']; + // Metaconsole db connection + if (($config ['metaconsole'] == 1) && ($server_name != '')) { + $connection = metaconsole_get_connection($server_name); + if (!metaconsole_load_external_db($connection)) { + ui_print_error_message ("Error connecting to ".$server_name); + } + } $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); $nameAgent = agents_get_name ($idAgent); $nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); @@ -562,6 +586,10 @@ function print_SLA_list($width, $action, $idItem = null) { ' . html_print_image("images/cross.png", true) . ''; + if ($config ['metaconsole'] == 1) { + //Restore db connection + metaconsole_restore_db(); + } } echo ''; ?> @@ -579,6 +607,7 @@ function print_SLA_list($width, $action, $idItem = null) { @@ -599,6 +628,7 @@ function print_SLA_list($width, $action, $idItem = null) { } function print_General_list($width, $action, $idItem = null) { + global $config; ?>
+  Type at least two characters to search
@@ -626,6 +656,14 @@ function print_General_list($width, $action, $idItem = null) { $itemsGeneral = array(); } foreach ($itemsGeneral as $item) { + $server_name = $item ['server_name']; + // Metaconsole db connection + if (($config ['metaconsole'] == 1) && ($server_name != '')) { + $connection = metaconsole_get_connection($server_name); + if (!metaconsole_load_external_db($connection)) { + ui_print_error_message ("Error connecting to ".$server_name); + } + } $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); $nameAgent = agents_get_name ($idAgent); $nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); @@ -637,6 +675,10 @@ function print_General_list($width, $action, $idItem = null) { ' . html_print_image("images/cross.png", true) . ''; + if ($config ['metaconsole'] == 1) { + //Restore db connection + metaconsole_restore_db(); + } } echo ''; ?> @@ -651,6 +693,7 @@ function print_General_list($width, $action, $idItem = null) { @@ -670,9 +713,9 @@ function print_General_list($width, $action, $idItem = null) { ?>
+  Type at least two characters to search