diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d54d9bc3da..880c799ae1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,41 @@ +2012-10-29 Ramon Novoa + + * include/functions_reporting.php, + include/javascript/pandora_modules.js, + include/functions_network_components.php, + include/functions_api.php, + include/functions_netflow.php, + pandoradb.sql, + pandoradb.postgreSQL.sql, + pandoradb.oracle.sql, + extensions/resource_registration.php, + extensions/plugin_registration.php, + operation/menu.php, + extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql, + godmode/agentes/agent_template.php, + godmode/agentes/module_manager_editor_common.php, + godmode/agentes/configurar_agente.php, + godmode/agentes/module_manager_editor.php, + godmode/servers/plugin.php, + godmode/menu.php, + godmode/modules/manage_network_components_form.php, + godmode/modules/manage_network_templates.php, + godmode/modules/manage_network_components_form_wmi.php, + godmode/modules/manage_network_components.php, + godmode/reporting/reporting_builder.php, + godmode/reporting/reporting_builder.item_editor.php: Added support for + custom timeout and retries to remote modules. + + * operation/netflow/nf_reporting.php, + operation/netflow/nf_view.php, + godmode/netflow/nf_report_item.php, + godmode/netflow/nf_report.php, + godmode/netflow/nf_report_form.php, + godmode/netflow/nf.php: Deleted from repository. Netflow reports are + now integrated into custom reports. + 2012-10-29 Sergio Martin * pandoradb_data.sql diff --git a/pandora_console/extensions/plugin_registration.php b/pandora_console/extensions/plugin_registration.php index 21c0624d64..e951b0febe 100644 --- a/pandora_console/extensions/plugin_registration.php +++ b/pandora_console/extensions/plugin_registration.php @@ -140,6 +140,7 @@ function pluginreg_extension_main () { 'name' => io_safe_input ($ini_array["plugin_definition"]["name"]), 'description' => io_safe_input ($ini_array["plugin_definition"]["description"]), 'max_timeout' => $ini_array["plugin_definition"]["timeout"], + 'max_retries' => $ini_array["plugin_definition"]["retries"], 'execute' => io_safe_input ($exec_path), 'parameters' => io_safe_input ($ini_array["plugin_definition"]["execution_postcommand"]), 'macros' => $macros, diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php index 4ddf71f68e..f99dfb484c 100644 --- a/pandora_console/extensions/resource_registration.php +++ b/pandora_console/extensions/resource_registration.php @@ -605,6 +605,7 @@ function process_upload_xml_component($xml) { $plugin_password = io_safe_input((string)$componentElement->plugin_password); $plugin_parameters = io_safe_input((string)$componentElement->plugin_parameters); $max_timeout = (int)$componentElement->max_timeout; + $max_retries = (int)$componentElement->max_retries; $historical_data = (int)$componentElement->historical_data; $min_war = (float)$componentElement->min_war; $max_war = (float)$componentElement->max_war; @@ -676,6 +677,7 @@ function process_upload_xml_component($xml) { 'plugin_pass' => $plugin_password, 'plugin_parameter' => $plugin_parameters, 'max_timeout' => $max_timeout, + 'max_retries' => $max_retries, 'history_data' => $historical_data, 'min_warning' => $min_war, 'max_warning' => $max_war, @@ -711,6 +713,7 @@ function process_upload_xml_component($xml) { 'plugin_pass' => $plugin_password, 'plugin_parameter' => $plugin_parameters, 'max_timeout' => $max_timeout, + 'max_retries' => $max_retries, 'history_data' => $historical_data, 'min_warning' => $min_war, 'max_warning' => $max_war, @@ -748,6 +751,7 @@ function process_upload_xml_component($xml) { 'plugin_pass' => $wmi_password, //work around 'plugin_parameter' => $plugin_parameters, 'max_timeout' => $max_timeout, + 'max_retries' => $max_retries, 'history_data' => $historical_data, 'min_warning' => $min_war, 'max_warning' => $max_war, diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql index 072675e2d8..22ede5ce65 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql @@ -156,6 +156,7 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `unknown_instructions` TEXT NOT NULL DEF ALTER TABLE `tagente_modulo` ADD COLUMN `critical_inverse` tinyint(1) unsigned default '0'; ALTER TABLE `tagente_modulo` ADD COLUMN `warning_inverse` tinyint(1) unsigned default '0'; ALTER TABLE `tagente_modulo` ADD COLUMN `cron_interval` varchar(100) default ''; +ALTER TABLE `tagente_modulo` ADD COLUMN `max_retries` int(4) UNSIGNED NOT NULL default 0; ------------------------------------------------------------------------ -- Table `tnetwork_component` @@ -170,6 +171,7 @@ ALTER TABLE `tnetwork_component` ADD COLUMN `warning_instructions` TEXT NOT NULL ALTER TABLE `tnetwork_component` ADD COLUMN `unknown_instructions` TEXT NOT NULL default ''; ALTER TABLE `tnetwork_component` ADD COLUMN `critical_inverse` tinyint(1) unsigned default '0'; ALTER TABLE `tnetwork_component` ADD COLUMN `warning_inverse` tinyint(1) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `max_retries` int(4) UNSIGNED NOT NULL default 0; ------------------------------------------------------------------------ -- Table `tgraph_source` Alter table to allow negative values in weight @@ -291,6 +293,7 @@ CREATE TABLE IF NOT EXISTS `tpassword_history` ( ------------------------------------------------------------------------ ALTER TABLE tplugin ADD `macros` text; ALTER TABLE tplugin ADD `parameters` text; +ALTER TABLE tplugin ADD `max_retries` int(4) UNSIGNED NOT NULL default 0; ------------------------------------------------------------------------ -- Table `trecon_script` diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql index 980f273b7a..ee6a8fcb92 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql @@ -303,12 +303,14 @@ ALTER TABLE tagente_modulo ADD CONSTRAINT t_agente_modulo_wizard_level_cons CHEC ALTER TABLE tagente_modulo ADD (macros CLOB default ''); ALTER TABLE tagente_modulo ADD (quiet NUMBER(5, 0) default 0 NOT NULL); ALTER TABLE tagente_modulo ADD (cron_interval VARCHAR2(100) DEFAULT ''); +ALTER TABLE tagente_modulo ADD (max_retries NUMBER(10, 0) default 0); -- ----------------------------------------------------- -- Table tplugin -- ----------------------------------------------------- ALTER TABLE tplugin ADD (macros CLOB default ''); ALTER TABLE tplugin ADD (parameters CLOB default ''); +ALTER TABLE tplugin ADD (max_retries NUMBER(10, 0) default 0); -- ----------------------------------------------------- -- Table trecon_task @@ -338,6 +340,7 @@ ALTER TABLE tnetwork_component ADD (warning_instructions VARCHAR2(255) default ' ALTER TABLE tnetwork_component ADD (unknown_instructions VARCHAR2(255) default ''); ALTER TABLE tnetwork_component ADD (critical_inverse NUMBER(1, 0) default 0 NOT NULL); ALTER TABLE tnetwork_component ADD (warning_inverse NUMBER(1, 0) default 0 NOT NULL); +ALTER TABLE tnetwork_component ADD (max_retries NUMBER(10, 0) default 0); evento ------------------------------------------------------------------------ diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql index 570d194a02..78a3c06f11 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql @@ -178,6 +178,7 @@ ALTER TABLE "tagente_modulo" ADD COLUMN "unknown_instructions" text default ''; ALTER TABLE "tagente_modulo" ADD COLUMN "critical_inverse" SMALLINT NOT NULL default 0; ALTER TABLE "tagente_modulo" ADD COLUMN "warning_inverse" SMALLINT NOT NULL default 0; ALTER TABLE "tagente_modulo" ADD COLUMN "cron_interval" varchar(100) default ''; +ALTER TABLE "tagente_modulo" ADD COLUMN "max_retries" INTEGER default 0; -- ----------------------------------------------------- -- Table "tevent_filter" @@ -252,6 +253,7 @@ ALTER TABLE "talert_compound" ADD COLUMN "special_day" SMALLINT default 0; -- ----------------------------------------------------- ALTER TABLE "tnetwork_component" ADD COLUMN "unit" text default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "max_retries" INTEGER default 0; -- ----------------------------------------------------- -- Table "talert_commands" @@ -310,6 +312,7 @@ ALTER TABLE "tnetwork_component" ADD COLUMN "macros" TEXT default ''; ALTER TABLE "tplugin" ADD COLUMN "macros" TEXT default ''; ALTER TABLE "tplugin" ADD COLUMN "parameters" TEXT default ''; +ALTER TABLE "tplugin" ADD COLUMN "max_retries" INTEGER default '0'; ------------------------------------------------------------------------ -- Table "trecon_task" diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index 34e37405f3..9cd633ba69 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -78,6 +78,7 @@ if (isset ($_POST["template_id"])) { 'plugin_pass' => $row2["plugin_pass"], 'plugin_parameter' => $row2["plugin_parameter"], 'max_timeout' => $row2["max_timeout"], + 'max_retries' => $row2["max_retries"], 'id_plugin' => $row2['id_plugin'], 'post_process' => $row2['post_process'], 'min_warning' => $row2['min_warning'], @@ -211,4 +212,4 @@ if (!empty ($table->data)) { else { echo '
No modules
'; } -?> \ No newline at end of file +?> diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index e8da17dcbb..0b3208780c 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -681,6 +681,7 @@ if ($update_module || $create_module) { $post_process = (string) get_parameter ('post_process', 0.0); $prediction_module = 1; $max_timeout = (int) get_parameter ('max_timeout'); + $max_retries = (int) get_parameter ('max_retries'); $min = (int) get_parameter_post ("min"); $max = (int) get_parameter ('max'); $interval = (int) get_parameter ('module_interval', $intervalo); @@ -839,6 +840,7 @@ if ($update_module) { 'post_process' => $post_process, 'prediction_module' => $prediction_module, 'max_timeout' => $max_timeout, + 'max_retries' => $max_retries, 'custom_id' => $custom_id, 'history_data' => $history_data, 'min_warning' => $min_warning, @@ -954,7 +956,8 @@ if ($create_module) { 'id_plugin' => $id_plugin, 'post_process' => $post_process, 'prediction_module' => $prediction_module, - 'max_timeout' => $max_timeout, + 'max_timeout' => $max_timeout, + 'max_retries' => $max_retries, 'disabled' => $disabled, 'id_modulo' => $id_module, 'custom_id' => $custom_id, diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 82e6335ce6..6139c1a5ec 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -190,6 +190,7 @@ if ($id_agent_module) { $prediction_module = $module['prediction_module']; $custom_integer_2 = $module ['custom_integer_2']; $max_timeout = $module['max_timeout']; + $max_retries = $module['max_retries']; $custom_id = $module['custom_id']; $history_data = $module['history_data']; $min_warning = $module['min_warning']; @@ -234,7 +235,8 @@ else { $id_module_group = 1; $id_module_type = 1; $post_process = ''; - $max_timeout = ''; + $max_timeout = 0; + $max_retries = 0; $min = ''; $max = ''; $interval = ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 48dc9899e7..c6a8e53591 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -373,6 +373,12 @@ $table_advanced->data[11][0] = __('Cron') . ui_print_help_tip (__('If cron is se $table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true); $table_advanced->colspan[11][1] = 4; +$table_advanced->data[12][0] = __('Timeout'); +$table_advanced->data[12][1] = html_print_input_text ('max_timeout', $max_timeout, '', 5, 10, true); +$table_advanced->data[12][2] = ''; +$table_advanced->data[12][3] = __('Retries'); +$table_advanced->data[12][4] = html_print_input_text ('max_retries', $max_retries, '', 5, 10, true); + ?> diff --git a/pandora_console/godmode/netflow/nf_report.php b/pandora_console/godmode/netflow/nf_report.php deleted file mode 100644 index af38a9b18c..0000000000 --- a/pandora_console/godmode/netflow/nf_report.php +++ /dev/null @@ -1,170 +0,0 @@ - $id)); - - if ($result !== false) $result = true; - else $result = false; - - ui_print_result_message ($result, - __('Successfully deleted'), - __('Not deleted. Error deleting data')); -} - - -if ($multiple_delete) { - $ids = (array)get_parameter('delete_multiple', array()); - - db_process_sql_begin(); - - foreach ($ids as $id) { - $result = db_process_sql_delete ('tnetflow_report', - array ('id_report' => $id)); - - if ($result === false) { - db_process_sql_rollback(); - break; - } - } - - if ($result !== false) { - db_process_sql_commit(); - } - - if ($result !== false) $result = true; - else $result = false; - - ui_print_result_message ($result, - __('Successfully deleted'), - __('Not deleted. Error deleting data')); -} - -$own_info = get_user_info ($config['id_user']); -// Get group list that user has access -$groups_user = users_get_groups ($config['id_user'], "IW", $own_info['is_admin'], true); - -$groups_id = array(); -foreach($groups_user as $key => $groups){ - $groups_id[] = $groups['id_grupo']; -} - -$sql = "SELECT * FROM tnetflow_report WHERE id_group IN (".implode(',',$groups_id).")"; - -$reports = db_get_all_rows_sql($sql); -if ($reports === false) - $reports = array(); - -$table->width = '98%'; -$table->head = array (); -$table->head[0] = __('Report name'); -$table->head[1] = __('Description'); -$table->head[2] = __('Group'); -$table->head[3] = __('Action') . - html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();'); - -$table->style = array (); -$table->style[0] = 'font-weight: bold'; -$table->align = array (); -$table->align[2] = 'center'; -$table->align[3] = 'center'; -$table->size = array (); -$table->size[0] = '40%'; -$table->size[1] = '30%'; -$table->size[2] = '20%'; -$table->size[3] = '50px'; -$table->data = array (); - -$total_reports = db_get_all_rows_filter ('tnetflow_report', false, 'COUNT(*) AS total'); -$total_reports = $total_reports[0]['total']; - -//ui_pagination ($total_reports, $url); - -foreach ($reports as $report) { - $data = array (); - $data[0] = ''.$report['id_name'].''; - - $data[1] = $report['description']; - - $group = db_get_value('nombre','tgrupo', 'id_grupo', $report['id_group']); - if ($group == '') - $group = 'All'; - $data[2] = $group; - - $data[3] = "" . - html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "" . - html_print_checkbox_extended ('delete_multiple[]', $report['id_report'], false, false, '', 'class="check_delete"', true); - - array_push ($table->data, $data); -} - -if (isset($data)) { - echo "
"; - html_print_input_hidden('multiple_delete', 1); - html_print_table ($table); - echo "
"; - html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); - echo "
"; - echo "
"; -} -else { - echo "
".__('There are no defined reports')."
"; -} - -echo '
'; - echo "
"; - html_print_submit_button (__('Create report'), 'crt', false, 'class="sub wand"'); - echo "
"; - echo "
"; - -?> - - \ No newline at end of file diff --git a/pandora_console/godmode/netflow/nf_report_form.php b/pandora_console/godmode/netflow/nf_report_form.php deleted file mode 100644 index b9d1356dc4..0000000000 --- a/pandora_console/godmode/netflow/nf_report_form.php +++ /dev/null @@ -1,186 +0,0 @@ - $name, - 'id_group' => $group, - 'description' => $description, - 'server_name' => $connection_name, - ); - - $result_ins = db_process_sql_insert('tnetflow_report', $values); - - $id = $result_ins; - -} -else { - $id = (int)get_parameter('id'); -} - -if (! defined ('METACONSOLE')) { - $buttons['report_list']['active'] = false; - $buttons['report_list'] = '' - . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) - . ''; - - $buttons['report_items']['active'] = false; - $buttons['report_items']['text'] = '' - . html_print_image ("images/god6.png", true, array ("title" => __('Report items'))) - . ''; - - $buttons['edit_report']['active'] = true; - $buttons['edit_report']['text'] = '' - . html_print_image ("images/config.png", true, array ("title" => __('Edit report'))) - . ''; - - //Header - ui_print_page_header (__('Netflow Report'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); -} else { - $nav_bar = array(array('link' => 'index.php?sec=main', 'text' => __('Main')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/operation/netflow/nf_reporting', 'text' => __('Netflow reports')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_report_form', 'text' => __('Edit netflow report'))); - ui_meta_print_page_header($nav_bar); -} - -//Control error creating report -if (($result_ins === false) && ($result_ins != -1)) { - ui_print_error_message ('Error creating report'); -} -else if (($result_ins != false) && ($result_ins != -1)){ - ui_print_success_message ('Report created successfully'); -} - -if ($id) { - $permission = netflow_check_report_group ($id, false); - if (!$permission) { //no tiene permisos para acceder a un informe - require ("general/noaccess.php"); - return; - } -} - -if ($id) { - $report = netflow_reports_get_reports ($id); - $name = $report['id_name']; - $description = $report['description']; - $group = $report['id_group']; - $connection_name = $report['server_name']; - -} -else { - $name = ''; - $group = ''; - $description = ''; - $connection_name = ''; -} - -if ($update) { - $id = get_parameter('id'); - $name = (string) get_parameter ('name'); - $description = get_parameter ('description'); - $group = get_parameter('id_group'); - $connection_name = get_parameter('connection_name'); - - if ($name == '') { - ui_print_error_message (__('Not updated. Blank name')); - } - else { - $result = db_process_sql_update ('tnetflow_report', - array ( - 'id_name' => $name, - 'id_group' => $group, - 'description' => $description, - 'server_name' => $connection_name, - ), - array ('id_report' => $id)); - ui_print_result_message ($result, __('Report updated successfully'), __('Error updating report')); - } -} - -$table->width = '80%'; -$table->border = 0; -$table->cellspacing = 3; -$table->cellpadding = 5; -$table->class = "databox_color"; -$table->style[0] = 'vertical-align: top;'; - -$table->data = array (); - -$table->data[0][0] = ''.__('Name').''; -$table->data[0][1] = html_print_input_text ('name', $name, false, 30, 80, true); - -$own_info = get_user_info ($config['id_user']); -$table->data[1][0] = ''.__('Group').''; -$table->data[1][1] = html_print_select_groups($config['id_user'], "IW", - $own_info['is_admin'], 'id_group', $group, '','', -1, true, - false, false); - -$table->data[2][0] = ''.__('Description').''; -$table->data[2][1] = html_print_textarea ('description', 2, 65, $description, '', true); - -if (defined ('METACONSOLE')) { - $table->data[3][0] = ''.__('Connection').''; - $table->data[3][1] = html_print_select (metaconsole_get_connection_names (), 'connection_name', $connection_name, '', '', 0, true, false, false); -} - - -if (defined ('METACONSOLE')) { - echo '
'; -} - -html_print_table ($table); -echo '
'; - -if ($id) { - html_print_input_hidden ('update', 1); - html_print_input_hidden ('id', $id); - html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"'); -} -else { - html_print_input_hidden ('create', 1); - html_print_submit_button (__('Create'), 'crt', false, 'class="sub wand"'); -} -echo '
'; -echo '
'; -?> diff --git a/pandora_console/godmode/netflow/nf_report_item.php b/pandora_console/godmode/netflow/nf_report_item.php deleted file mode 100644 index fe89f0e54c..0000000000 --- a/pandora_console/godmode/netflow/nf_report_item.php +++ /dev/null @@ -1,201 +0,0 @@ -' - . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) - . ''; - -$buttons['report_items']['active'] = true; -$buttons['report_items']['text'] = '' - . html_print_image ("images/god6.png", true, array ("title" => __('Report items'))) - . ''; - -$buttons['edit_report']['active'] = false; -$buttons['edit_report']['text'] = '' - . html_print_image ("images/config.png", true, array ("title" => __('Edit report'))) - . ''; - -//Header -if (! defined ('METACONSOLE')) { - ui_print_page_header (__('Report item editor'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); -} else { - $nav_bar = array(array('link' => 'index.php?sec=main', 'text' => __('Main')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/operation/netflow/nf_reporting', 'text' => __('Netflow reports')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_item_list&id=' . $id, 'text' => __('Item list')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_report_item&id=' . $id, 'text' => __('Edit item'))); - ui_meta_print_page_header($nav_bar); -} - -if ($id_rc) { - $item = netflow_reports_get_content ($id_rc); - $id_filter = $item['id_filter']; - $name_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id_filter); - $max_val = $item['max']; - $show_graph = $item['show_graph']; - $description = $item['description']; - -} -else { - $name_filter = ''; - $max_val = ''; - $show_graph = ''; - $description = ''; -} - -if ($update) { - $id_filter = get_parameter('id_filter'); - $name_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id_filter); - $max_val = get_parameter('max','2'); - $show_graph = get_parameter('show_graph',''); - $description = get_parameter('description',''); - - $result = db_process_sql_update ('tnetflow_report_content', - array ( - 'id_report' => $id, - 'id_filter' => $id_filter, - 'max' => $max_val, - 'show_graph' => $show_graph, - 'description' => $description - ), - array ('id_rc' => $id_rc)); - - ui_print_result_message ($result, - __('Successfully updated'), - __('Not updated. Error updating data')); -} - -if ($create){ - $id_filter = (int)get_parameter('id_filter', 0); - $name_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id_filter); - $max_val = (int)get_parameter('max',2); - $show_graph = (string)get_parameter('show_graph',''); - $description = get_parameter('description',''); - - //insertion order - $sql = "SELECT max(`order`) as max_order FROM tnetflow_report_content where id_report=$id"; - $result = db_get_row_sql($sql); - $order = $result['max_order']; - if ($order == '') { - $order = 0; - } - else { - $order++; - } - - $values = array ( - 'id_report' => $id, - 'id_filter' => $id_filter, - 'max' => $max_val, - 'show_graph' => $show_graph, - 'description' => $description, - '`order`' => $order - ); - $id_rc = db_process_sql_insert('tnetflow_report_content', $values); - if ($id_rc === false) { - if ($id_filter == 0) - echo '

'.__ ('Error creating item. No filter.').'

'; - else - echo '

'.__ ('Error creating item').'

'; - } - else { - echo '

'.__ ('Item created successfully').'

'; - } -} - -$table->width = '70%'; -$table->border = 0; -$table->cellspacing = 3; -$table->cellpadding = 5; -$table->class = "databox_color"; -$table->style[0] = 'vertical-align: top;'; - -$table->data = array (); - -$filters = netflow_get_filters (); -if ($filters === false) { - $filters = array (); -} - -$own_info = get_user_info ($config['id_user']); -// Get group list that user has access -$groups_user = users_get_groups ($config['id_user'], "IW", $own_info['is_admin'], true); - -$groups_id = array(); -foreach($groups_user as $key => $groups){ - $groups_id[] = $groups['id_grupo']; -} - -$sql = "SELECT * FROM tnetflow_filter WHERE id_group IN (".implode(',',$groups_id).")"; -$table->data[0][0] = ''.__('Filter').''; -$table->data[0][1] = html_print_select_from_sql($sql, 'id_filter', $id_filter, '', '', 0, true); - -$table->data[1][0] = ''.__('Max. values').''; - $max_values = array ('2' => '2', - '5' => '5', - '10' => '10', - '15' => '15', - '20' => '20', - '25' => '25', - '50' => '50' - ); -$table->data[1][1] = html_print_select ($max_values, 'max', $max_val, '', '', 0, true); - -$table->data[2][0] = ''.__('Chart type').''; -$table->data[2][1] = html_print_select (netflow_get_chart_types (), 'show_graph', $show_graph,'','',0,true); -$table->data[2][1] = html_print_select (netflow_get_chart_types (), 'show_graph', $show_graph,'','',0,true); - -$table->data[3][0] = ''.__('Description').''; -$table->data[3][1] = html_print_textarea ('description', 2, 65, $description, '', true); - -echo '
'; -html_print_table ($table); -echo '
'; - -if ($id_rc) { - html_print_input_hidden ('update', 1); - html_print_input_hidden ('id_rc', $id_rc); - html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"'); -} -else { - html_print_input_hidden ('create', 1); - html_print_submit_button (__('Create item'), 'crt', false, 'class="sub wand"'); -} -echo '
'; -echo '
'; -?> diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 50627bdb52..8cde8a2754 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1882,7 +1882,6 @@ function chooseType() { $("#row_netflow_filter").show(); $("#row_description").show(); $("#row_period").show(); - $("#row_max_values").show(); $("#row_resolution").show(); $("#row_servers").show(); break; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index e691f3b8f9..957dc50151 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -650,6 +650,18 @@ switch ($action) { $values['external_source'] = json_encode($es); $good_format = true; break; + case 'netflow_area': + case 'netflow_pie': + case 'netflow_data': + case 'netflow_statistics': + case 'netflow_summary': + $values['text'] = get_parameter('netflow_filter'); + $values['description'] = get_parameter('description'); + $values['period'] = get_parameter('period'); + $values['top_n'] = get_parameter('resolution'); + $values['top_n_value'] = get_parameter('max_values'); + $good_format = true; + break; default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter('radiobutton_max_min_avg',0); diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 56fd2baab1..8c0774ab49 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -47,6 +47,7 @@ if ($view != "") { $form_name = $plugin["name"]; $form_description = $plugin["description"]; $form_max_timeout = $plugin ["max_timeout"]; + $form_max_retries = $plugin ["max_retries"]; $form_execute = $plugin ["execute"]; $form_plugin_type = $plugin ["plugin_type"]; $macros = $plugin ["macros"]; @@ -56,6 +57,7 @@ if ($create != "") { $form_name = ""; $form_description = ""; $form_max_timeout = 15; + $form_max_retries = 1; $form_execute = ""; $form_plugin_type = 0; $form_parameters = ""; @@ -100,10 +102,13 @@ if (($create != "") OR ($view != "")) { $fields[0]= __("Standard"); $fields[1]= __("Nagios"); $data[1] = html_print_select ($fields, "form_plugin_type", $form_plugin_type, '', '', 0, true); - $data[2] = __('Max. timeout').ui_print_help_tip (__('This value only will be applied if is minor than the server general configuration plugin timeout').'.

'.__('If you set a 0 seconds timeout, the server plugin timeout will be used'), true); - $data[3] = ''; - $data[3] = html_print_extended_select_for_time ('form_max_timeout', $form_max_timeout, '', '', '0', false, true); - $table->data['plugin_type_timeout'] = $data; + $table->data['plugin_type'] = $data; + + $data[0] = __('Max. timeout').ui_print_help_tip (__('This value only will be applied if is minor than the server general configuration plugin timeout').'.

'.__('If you set a 0 seconds timeout, the server plugin timeout will be used'), true); + $data[1] = html_print_extended_select_for_time ('form_max_timeout', $form_max_timeout, '', '', '0', false, true); + $data[2] = __('Max. retries'); + $data[3] = ''; + $table->data['plugin_timeout'] = $data; $data = array(); $data[0] = __('Description'); @@ -277,6 +282,7 @@ else { $plugin_name = get_parameter ("form_name", ""); $plugin_description = get_parameter ("form_description", ""); $plugin_max_timeout = get_parameter ("form_max_timeout", ""); + $plugin_max_retries = get_parameter ("form_max_retries", ""); $plugin_execute = get_parameter ("form_execute", ""); $plugin_plugin_type = get_parameter ("form_plugin_type", "0"); $parameters = get_parameter ("form_parameters", ""); @@ -307,6 +313,7 @@ else { 'name' => $plugin_name, 'description' => $plugin_description, 'max_timeout' => $plugin_max_timeout, + 'max_retries' => $plugin_max_retries, 'execute' => $plugin_execute, 'plugin_type' => $plugin_plugin_type, 'parameters' => $parameters, @@ -329,6 +336,7 @@ else { $plugin_name = get_parameter ("form_name", ""); $plugin_description = get_parameter ("form_description", ""); $plugin_max_timeout = get_parameter ("form_max_timeout", ""); + $plugin_max_retries = get_parameter ("form_max_retries", ""); $plugin_execute = get_parameter ("form_execute", ""); $plugin_plugin_type = get_parameter ("form_plugin_type", "0"); $plugin_parameters = get_parameter ("form_parameters", "0"); @@ -359,6 +367,7 @@ else { 'name' => $plugin_name, 'description' => $plugin_description, 'max_timeout' => $plugin_max_timeout, + 'max_retries' => $plugin_max_retries, 'execute' => $plugin_execute, 'plugin_type' => $plugin_plugin_type, 'parameters' => $plugin_parameters, diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 214df449bd..440eea7c92 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -412,6 +412,7 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType) 'module_post_process' => $module['post_process'], 'module_prediction_module' => $module['prediction_module'], 'module_max_timeout' => $module['max_timeout'], + 'module_max_retries' => $module['max_retries'], 'module_custom_id' => $module['custom_id'], 'module_history_data' => $module['history_data'], 'module_min_warning' => $module['min_warning'], @@ -599,6 +600,7 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType) 'module_post_process', 'module_prediction_module', 'module_max_timeout', + 'module_max_retries', 'module_custom_id', 'module_history_data', 'module_min_warning', @@ -1697,7 +1699,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) { * @param array $other it's array, $other as param is ;; * ;;;;;; * ;;;;;;; - * ;; in this + * ;;; in this * order and separator char (after text ; ) and separator (pass in param * othermode as othermode=url_encode_separator_) * example: @@ -1741,7 +1743,9 @@ function api_set_new_network_component($id, $thrash1, $other, $thrash2) { 'max_critical' => $other['data'][13], 'str_critical' => $other['data'][14], 'min_ff_event' => $other['data'][15], - 'post_process' => $other['data'][16]); + 'post_process' => $other['data'][16], + 'max_retries' => $other['data'][17], + ); $name_check = db_get_value ('name', 'tnetwork_component', 'name', $id); @@ -1766,7 +1770,7 @@ function api_set_new_network_component($id, $thrash1, $other, $thrash2) { * @param array $other it's array, $other as param is ;; * ;;;;;;; * ;;;;;;; - * ;; in this + * ;;; in this * order and separator char (after text ; ) and separator (pass in param * othermode as othermode=url_encode_separator_) * example: @@ -1814,7 +1818,8 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2) { 'max_critical' => $other['data'][17], 'str_critical' => $other['data'][18], 'min_ff_event' => $other['data'][19], - 'post_process' => $other['data'][20]); + 'post_process' => $other['data'][20], + 'max_retries' => $other['data'][11]); $name_check = db_get_value ('name', 'tnetwork_component', 'name', $id); @@ -1840,7 +1845,7 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2) { * ;;;;; * ;;;;;;; * ;;;;; - * ;;;;;;; in this + * ;;;;;;;; in this * order and separator char (after text ; ) and separator (pass in param * othermode as othermode=url_encode_separator_) * example: @@ -1891,7 +1896,7 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) { 'max' => $other['data'][3], 'min' => $other['data'][4], 'id_module_group' => $other['data'][5], - 'max_timeout' => $other['data'][6], + 'max_timeout' => $other['data'][6], 'history_data' => $other['data'][7], 'min_warning' => $other['data'][8], 'max_warning' => $other['data'][9], @@ -1912,6 +1917,7 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) { 'custom_string_2' => $other['data'][23], // snmp3_privacy_pass 'plugin_parameter' => $other['data'][24], // snmp3_auth_method 'custom_string_3' => $other['data'][25], // snmp3_security_level + 'max_retries' => $other['data'][26], ); } else { @@ -1938,6 +1944,7 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) { 'plugin_pass' => '', 'tcp_port' => $other['data'][21], 'id_modulo' => 2 + 'max_retries' => $other['data'][22], ); } diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index fa45bd491b..880b5aba9e 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -209,6 +209,7 @@ function netflow_stat_table ($data, $start_date, $end_date, $aggregate, $unit){ $end_date = date ($nfdump_date_format, $end_date); $values = array(); $table->width = '50%'; + $table->border = 1; $table->cellpadding = 0; $table->cellspacing = 0; $table->class = 'databox'; @@ -276,6 +277,7 @@ function netflow_data_table ($data, $start_date, $end_date, $aggregate) { $values = array(); $table->size = array ('50%'); $table->class = 'databox'; + $table->border = 1; $table->cellpadding = 0; $table->cellspacing = 0; $table->data = array(); @@ -1040,20 +1042,49 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi $data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name); if ($aggregate != 'none') { if ($output == 'HTML') { - return graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit); + $html = "" . __('Unit') . ": $unit"; + $html .= " " . __('Aggregate') . ": $aggregate"; + if ($interval_length != 0) { + $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); + } + $html .= graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit); + return $html; } else if ($output == 'PDF') { - return graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit, 2, true); + $html = "" . __('Unit') . ": $unit"; + $html .= " " . __('Aggregate') . ": $aggregate"; + if ($interval_length != 0) { + $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); + } + $html .= graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit, 2, true); + return $html; } else if ($output == 'XML') { - return netflow_aggregate_area_xml ($data); + $xml = "$unit\n"; + $xml .= "$aggregate\n"; + $xml .= "$interval_length\n"; + $xml .= netflow_aggregate_area_xml ($data); + return $xml; } } else { if ($output == 'HTML') { - return graph_netflow_total_area ($data, $interval, 660, 320, $unit); + $html = "" . __('Unit') . ": $unit"; + if ($interval_length != 0) { + $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); + } + $html .= graph_netflow_total_area ($data, $interval, 660, 320, $unit); + return $html; } else if ($output == 'PDF') { - return graph_netflow_total_area ($data, $interval, 660, 320, $unit, 2, true); + $html = "" . __('Unit') . ": $unit"; + if ($interval_length != 0) { + $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); + } + $html .= graph_netflow_total_area ($data, $interval, 660, 320, $unit, 2, true); + return $html; } else if ($output == 'XML') { - return netflow_total_area_xml ($data); + $xml = "$unit\n"; + $xml .= "$interval_length\n"; + $xml .= netflow_total_area_xml ($data); + return $xml; } } break; @@ -1061,21 +1092,40 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi case 'netflow_pie': $data = netflow_get_stats ($start_date, $end_date, $filter, $aggregate, $max_aggregates, $unit, $connection_name); if ($output == 'HTML') { - return graph_netflow_aggregate_pie ($data, $aggregate); + $html = "" . __('Unit') . ": $unit"; + $html .= " " . __('Aggregate') . ": $aggregate"; + $html .= graph_netflow_aggregate_pie ($data, $aggregate); + return $html; } else if ($output == 'PDF') { - return graph_netflow_aggregate_pie ($data, $aggregate, 2, true); + $html = "" . __('Unit') . ": $unit"; + $html .= " " . __('Aggregate') . ": $aggregate"; + $html .= graph_netflow_aggregate_pie ($data, $aggregate, 2, true); + return $html; } else if ($output == 'XML') { - return netflow_aggregate_pie_xml ($data); + $xml = "$unit\n"; + $xml .= "$aggregate\n"; + $xml .= netflow_aggregate_pie_xml ($data); + return $xml; } break; case '2': case 'netflow_data': $data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name); if ($output == 'HTML' || $output == 'PDF') { - return netflow_data_table ($data, $start_date, $end_date, $aggregate); + $html = "" . __('Unit') . ": $unit"; + $html .= " " . __('Aggregate') . ": $aggregate"; + if ($interval_length != 0) { + $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); + } + $html .= netflow_data_table ($data, $start_date, $end_date, $aggregate); + return $html; } else if ($output == 'XML') { + $xml = "$unit\n"; + $xml .= "$aggregate\n"; + $xml .= "$interval_length\n"; // Same as netflow_aggregate_area_xml - return netflow_aggregate_area_xml ($data); + $xml .= netflow_aggregate_area_xml ($data); + return $xml; } break; case '3': diff --git a/pandora_console/include/functions_network_components.php b/pandora_console/include/functions_network_components.php index 9471c74382..8283d47f01 100644 --- a/pandora_console/include/functions_network_components.php +++ b/pandora_console/include/functions_network_components.php @@ -332,6 +332,7 @@ function network_components_create_module_from_network_component ($id_network_co 'plugin_pass', 'plugin_parameter', 'max_timeout', + 'max_retries', 'history_data', 'min_warning', 'max_warning', @@ -399,6 +400,7 @@ function network_components_duplicate_network_component ($id_local_component) { $networkCopy['plugin_pass'] = $network['plugin_pass']; $networkCopy['plugin_parameter'] = $network['plugin_parameter']; $networkCopy['max_timeout'] = $network['max_timeout']; + $networkCopy['max_retries'] = $network['max_retries']; $networkCopy['history_data'] = $network['history_data']; $networkCopy['min_warning'] = $network['min_warning']; $networkCopy['max_warning'] = $network['max_warning']; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 28f3562317..56b637d7c8 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4790,13 +4790,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date); $table->colspan[0][0] = 4; - if ($filter['aggregate'] != 'none') { - $table->data[0][0] = '

' . $description . ' (' . __($filter['aggregate']) . '/' . __($filter['output']) . ')

'; - } - else { - $table->data[0][0] = '

' . $description . ' (' . __($filter['output']) . ')

'; - } - + $table->data[0][0] = '

' . $description . '

'; $table->colspan[1][0] = 4; $table->data[1][0] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $unique_id, $server_name, 'HTML'); break; diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 6292add168..0c7e8182eb 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -236,6 +236,7 @@ function configure_modules_form () { $("#oid, img#edit_oid").hide (); $("#id_module_group option[value="+data["id_module_group"]+"]").select (1); $("#max_timeout").attr ("value", data["max_timeout"]); + $("#max_retries").attr ("value", data["max_retries"]); $("#id_plugin option[value="+data["id_plugin"]+"]").select (1); $("#id_plugin").trigger('change'); $("#text-plugin_user").attr ("value", js_html_entity_decode (data["plugin_user"])); diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 50282a4a3d..ef7d5fb8c2 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -336,12 +336,9 @@ $menu_operation["workspace"]["sub"] = $sub; if (check_acl ($config['id_user'], 0, "IR")) { if ($config['activate_netflow']) { - $menu_operation["netf"]["text"] = __('Netflow'); - $menu_operation["netf"]["sec2"] = "operation/netflow/nf_reporting"; + $menu_operation["netf"]["text"] = __('Netflow Live View'); + $menu_operation["netf"]["sec2"] = "operation/netflow/nf_live_view"; $menu_operation["netf"]["id"] = "oper-netflow"; - $sub = array (); - $sub["operation/netflow/nf_live_view"]["text"] = __('Live view'); - $menu_operation["netf"]["sub"] = $sub; } } // Rest of options, all with AR privilege (or should events be with incidents?) @@ -400,4 +397,4 @@ $operation_menu_array = $menu_operation; if(!$config['pure']) { menu_print_menu ($menu_operation, true); } -?> \ No newline at end of file +?> diff --git a/pandora_console/operation/netflow/nf_reporting.php b/pandora_console/operation/netflow/nf_reporting.php deleted file mode 100644 index 27b5748847..0000000000 --- a/pandora_console/operation/netflow/nf_reporting.php +++ /dev/null @@ -1,148 +0,0 @@ - 'index.php?sec=main', 'text' => __('Main')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/operation/netflow/nf_reporting', 'text' => __('Netflow reports'))); - - ui_meta_print_page_header($nav_bar); -} - -$delete_report = get_parameter ('delete_report', false); -$report_id = (int) get_parameter ('report_id', 0); - -if ($delete_report && $report_id != 0 && $write_permissions) { - $result = db_process_sql_delete ('tnetflow_report', - array ('id_report' => $report_id)); - - if ($result !== false) $result = true; - else $result = false; - - ui_print_result_message ($result, - __('Successfully deleted'), - __('Not deleted. Error deleting data')); -} - -/* -$filter = array (); - -$filter['offset'] = (int) get_parameter ('offset'); -$filter['limit'] = (int) $config['block_size']; -*/ - -// Get group list that user has access -$groups_user = users_get_groups ($config['id_user'], "AR", true, true); - -$groups_id = array(); -foreach($groups_user as $key => $groups){ - $groups_id[] = $groups['id_grupo']; -} -//$sql = "SELECT * FROM tnetflow_report WHERE 'group' IN (\"".implode('","',$groups_id)."\")"; -$sql = "SELECT * FROM tnetflow_report WHERE id_group IN (".implode(',',$groups_id).")"; -$reports = db_get_all_rows_sql($sql); - -if ($reports == false){ - $reports = array(); -} - -$table->width = '98%'; -$table->head = array (); -$table->head[0] = __('Report name'); -$table->head[1]= __('Description'); -$table->head[2] = __('Group'); -if (defined ('METACONSOLE') && $write_permissions) { - $table->head[3] = '' . __('Op.') . ''; -} - -$table->style = array (); -$table->style[0] = 'font-weight: bold'; -$table->align = array (); -$table->align[2] = 'center'; -$table->size = array (); -$table->size[0] = '30%'; -$table->size[2] = '10px'; -if (defined ('METACONSOLE') && $write_permissions) { - $table->size[3] = '85px'; -} -$table->data = array (); - -$total_reports = db_get_all_rows_filter ('tnetflow_report', false, 'COUNT(*) AS total'); -$total_reports = $total_reports[0]['total']; - -//ui_pagination ($total_reports, $url); - -foreach ($reports as $report) { - $data = array (); - - $data[0] = ''.$report['id_name'].''; - $data[1] = $report['description']; - - if (! defined ('METACONSOLE')) { - $data[2] = ui_print_group_icon($report['id_group'], true); - } else { - // No link to the group page in the metaconsole - $data[2] = ui_print_group_icon($report['id_group'], true, 'groups_small', '', false); - } - - if (defined ('METACONSOLE') && $write_permissions) { - $data[3] = '
'; - $data[3] .= html_print_input_image ('edit', 'images/config.png', 1, '', true, array ('title' => __('Edit'))); - $data[3] .= '
'; - - $data[3] .= '  
'; - $data[3] .= html_print_input_image ('edit', 'images/god6.png', 1, '', true, array ('title' => __('Items'))); - $data[3] .= '
'; - - $data[3] .= '  
'; - $data[3] .= html_print_input_hidden ('report_id', $report['id_report'], true); - $data[3] .= html_print_input_hidden ('delete_report', true, true); - $data[3] .= html_print_input_image ('delete', 'images/cross.png', 1, '', - true, array ('title' => __('Delete'))); - $data[3] .= '
'; - } - - array_push ($table->data, $data); -} - -html_print_table ($table); - -echo '
'; - echo '
'; - html_print_submit_button (__('Create report'), 'crt', false, 'class="sub wand"'); - echo "
"; - echo "
"; - -?> diff --git a/pandora_console/operation/netflow/nf_view.php b/pandora_console/operation/netflow/nf_view.php deleted file mode 100644 index 6c8453856c..0000000000 --- a/pandora_console/operation/netflow/nf_view.php +++ /dev/null @@ -1,191 +0,0 @@ -' - . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) - . ''; - ui_print_page_header (__('Netflow'), "images/networkmap/so_cisco_new.png", false, "", false, $buttons); -} else { - $nav_bar = array(array('link' => 'index.php?sec=main', 'text' => __('Main')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/operation/netflow/nf_reporting', 'text' => __('Netflow reports')), - array('link' => 'index.php?sec=netf&sec2=' . $config['homedir'] . '/operation/netflow/nf_view', 'text' => __('View netflow report'))); - ui_meta_print_page_header($nav_bar); -} - -echo '
'; - - $table->width = '60%'; - $table->border = 0; - $table->cellspacing = 3; - $table->cellpadding = 5; - $table->class = "databox_color"; - $table->style[0] = 'vertical-align: top;'; - - $table->data = array (); - - $table->data[0][0] = ''.__('Date').''; - - $table->data[0][1] = html_print_input_text ('date', $date, false, 10, 10, true); - $table->data[0][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-date'),this);")); - $table->data[0][1] .= html_print_input_text ('time', $time, false, 10, 5, true); - - $table->data[1][0] = ''.__('Interval').''; - $table->data[1][1] = html_print_select (netflow_get_valid_intervals (), 'period', $period, '', '', 0, true, false, false); - - $table->data[2][0] = ''.__('Export').''; - if (! defined ('METACONSOLE')) { - $table->data[2][1] = '" . html_print_image("images/database_lightning.png", true) . ''; - } else { - $table->data[2][1] = '" . html_print_image("images/database_lightning.png", true) . ''; - } - if (defined ('METACONSOLE')) { - $table->data[2][1] .= '  " . html_print_image("images/pdf.png", true) . ''; - } else if (defined ('PANDORA_ENTERPRISE')) { - $table->data[2][1] .= '  " . html_print_image("images/pdf.png", true) . ''; - } - - html_print_table ($table); - - echo '
'; - html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"'); - echo '
'; -echo'
'; - -$report = db_get_row_sql('SELECT * FROM tnetflow_report WHERE id_report =' . (int)$id); -if (empty ($report)){ - echo fs_error_image(); - return; -} - -$report_name = $report['id_name']; -$connection_name = $report['server_name']; -$report_contents = db_get_all_rows_sql("SELECT * FROM tnetflow_report_content WHERE id_report='$id' ORDER BY `order`"); -if (empty ($report_contents)) { - echo fs_error_image(); - return; -} - -// Process report items -foreach ($report_contents as $content_report) { - - // Get report item - $report_id = $content_report['id_report']; - $content_id = $content_report['id_rc']; - $max_aggregates= $content_report['max']; - $type = $content_report['show_graph']; - $description = $content_report['description']; - - // Get item filters - $filter = db_get_row_sql("SELECT * FROM tnetflow_filter WHERE id_sg = '" . io_safe_input ($content_report['id_filter']) . "'", false, true); - if ($description == '') { - $description = $filter['id_name']; - } - - if ($filter['aggregate'] != 'none') { - echo '

' . $description . ' (' . __($filter['aggregate']) . '/' . __($filter['output']) . ')

'; - } - else { - echo '

' . $description . ' (' . __($filter['output']) . ')

'; - } - - // Build a unique id for the cache - $unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date); - - // Draw - echo netflow_draw_item ($start_date, $end_date, 0, $type, $filter, $max_aggregates, $unique_id, $connection_name, 'HTML'); -} -?> diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 65cb0ba47f..8c919ad250 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -208,6 +208,7 @@ CREATE TABLE tagente_modulo ( post_process BINARY_DOUBLE default NULL, prediction_module NUMBER(19, 0) default 0, max_timeout NUMBER(10, 0) default 0, + max_retries NUMBER(10, 0) default 0, custom_id VARCHAR2(255) default '', history_data NUMBER(5, 0) default 1, min_warning BINARY_DOUBLE default 0, @@ -692,6 +693,7 @@ CREATE TABLE tnetwork_component ( plugin_pass CLOB default '', plugin_parameter CLOB, max_timeout NUMBER(10, 0) default 0, + max_retries NUMBER(10, 0) default 0, history_data NUMBER(5, 0) default 1, min_warning BINARY_DOUBLE default 0, max_warning BINARY_DOUBLE default 0, @@ -1171,6 +1173,7 @@ CREATE TABLE tplugin ( name VARCHAR2(200) NOT NULL, description CLOB, max_timeout NUMBER(10, 0) default 0 NOT NULL, + max_retries NUMBER(10, 0) default 0, execute VARCHAR2(250) NOT NULL, net_dst_opt VARCHAR2(50) default '', net_port_opt VARCHAR2(50) default '', diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 6bb6f120a5..9671c475a7 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -200,6 +200,7 @@ CREATE TABLE "tagente_modulo" ( "post_process" DOUBLE PRECISION default NULL, "prediction_module" BIGINT default 0, "max_timeout" INTEGER default 0, + "max_retries" INTEGER default 0, "custom_id" varchar(255) default '', "history_data" SMALLINT default 1, "min_warning" DOUBLE PRECISION default 0, @@ -569,6 +570,7 @@ CREATE TABLE "tnetwork_component" ( "plugin_pass" text default '', "plugin_parameter" text, "max_timeout" INTEGER default 0, + "max_retries" INTEGER default 0, "history_data" SMALLINT default 1, "min_warning" DOUBLE PRECISION default 0, "max_warning" DOUBLE PRECISION default 0, @@ -989,6 +991,7 @@ CREATE TABLE "tplugin" ( "name" varchar(200) NOT NULL, "description" TEXT, "max_timeout" INTEGER NOT NULL default 0, + "max_retries" INTEGER NOT NULL default 0, "execute" varchar(250) NOT NULL, "net_dst_opt" varchar(50) default '', "net_port_opt" varchar(50) default '', diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 43bb9c3b4f..869d4f5cf9 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -200,6 +200,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `post_process` double(18,5) default NULL, `prediction_module` bigint(14) default '0', `max_timeout` int(4) unsigned default '0', + `max_retries` int(4) unsigned default '0', `custom_id` varchar(255) default '', `history_data` tinyint(1) unsigned default '1', `min_warning` double(18,2) default 0, @@ -670,7 +671,8 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `plugin_user` text, `plugin_pass` text, `plugin_parameter` text, - `max_timeout` tinyint(3) unsigned default '0', + `max_timeout` int(4) unsigned default '0', + `max_retries` int(4) unsigned default '0', `history_data` tinyint(1) unsigned default '1', `min_warning` double(18,2) default 0, `max_warning` double(18,2) default 0, @@ -1155,6 +1157,7 @@ CREATE TABLE IF NOT EXISTS `tplugin` ( `name` varchar(200) NOT NULL, `description` mediumtext, `max_timeout` int(4) UNSIGNED NOT NULL default 0, + `max_retries` int(4) UNSIGNED NOT NULL default 0, `execute` varchar(250) NOT NULL, `net_dst_opt` varchar(50) default '', `net_port_opt` varchar(50) default '',