From 43d6c24e39da5fe7276a59c09b1d665f9ff51e8c Mon Sep 17 00:00:00 2001 From: Vanessa Gil Date: Wed, 17 Sep 2014 17:22:43 +0200 Subject: [PATCH] Remove 'sla_period'. Ticket #1282 --- .../pandoradb_migrate_5.0.x_to_5.1.mysql.sql | 7 +- .../pandoradb_migrate_5.0.x_to_5.1.oracle.sql | 6 +- pandora_console/godmode/setup/performance.php | 3 - pandora_console/include/functions_config.php | 6 -- .../include/functions_reporting.php | 78 +++---------------- pandora_console/pandoradb.data.oracle.sql | 1 - pandora_console/pandoradb_data.sql | 1 - 7 files changed, 20 insertions(+), 82 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql index beb9d06a26..1d7a9c502c 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql @@ -244,4 +244,9 @@ INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fi -- --------------------------------------------------------------------- -- Table `talert_actions` -- --------------------------------------------------------------------- -INSERT INTO `talert_actions` (`name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`) VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); \ No newline at end of file +INSERT INTO `talert_actions` (`name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`) VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); + +-- --------------------------------------------------------------------- +-- Table `tconfig` +-- --------------------------------------------------------------------- +DELETE FROM `tconfig` WHERE `token`='sla_period'; diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql index c06a2a865e..7cc6f7733b 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql @@ -232,4 +232,8 @@ INSERT INTO talert_commands (name, command, description, internal, fields_descri -- --------------------------------------------------------------------- -- Table `talert_actions` -- --------------------------------------------------------------------- -INSERT INTO talert_actions (name, id_alert_command, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, id_group, action_threshold) VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); \ No newline at end of file +INSERT INTO talert_actions (name, id_alert_command, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, id_group, action_threshold) VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); +-- --------------------------------------------------------------------- +-- Table `tconfig` +-- --------------------------------------------------------------------- +DELETE FROM tconfig WHERE token='sla_period'; diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index 2ac9e68a58..6d35e9e056 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -87,9 +87,6 @@ $intervals[SECONDS_1WEEK] = __('Last week'); $intervals[SECONDS_2WEEK] = __('2 weeks'); $intervals[SECONDS_1MONTH] = __('Last month'); -$table_other->data[2][0] = __('SLA period (seconds)') . ui_print_help_tip(__('You can see this in SLA agent tab.'), true); -$table_other->data[2][1] = html_print_select ($intervals, 'sla_period', $config["sla_period"], '', '', '0', true); - $table_other->data[3][0] = __('Default hours for event view'); $table_other->data[3][1] = html_print_input_text ('event_view_hr', $config["event_view_hr"], '', 5, 5, true); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 541d6064c3..30be058e6a 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -345,8 +345,6 @@ function config_update_config () { $error_update[] = __('Max. days before compact data'); if (!config_update_value ('step_compact', (int) get_parameter ('step_compact'))) $error_update[] = __('Compact interpolation in hours (1 Fine-20 bad)'); - if (!config_update_value ('sla_period', (int) get_parameter ('sla_period'))) - $error_update[] = __('SLA period (seconds)'); if (!config_update_value ('event_view_hr', (int) get_parameter ('event_view_hr'))) $error_update[] = __('Default hours for event view'); if (!config_update_value ('realtimestats', get_parameter ('realtimestats'))) @@ -618,10 +616,6 @@ function config_process_config () { config_update_value ('trap2agent', 0); } - if (!isset ($config["sla_period"]) || empty ($config["sla_period"])) { - config_update_value ('sla_period', SECONDS_1WEEK); - } - if (!isset ($config["prominent_time"])) { // Prominent time tells us what to show prominently when a timestamp is // displayed. The comparation (... days ago) or the timestamp (full date) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 8452bf526b..a605f440a1 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -46,12 +46,11 @@ include_once($config['homedir'] . "/include/functions_netflow.php"); * * @return float The average module value in the interval. */ -function reporting_get_agentmodule_data_average ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_data_average ($id_agent_module, $period=0, $date = 0) { global $config; // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"]; $datelimit = $date - $period; $id_module_type = modules_get_agentmodule_type ($id_agent_module); @@ -150,12 +149,11 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period, $dat * * @return float The maximum module value in the interval. */ -function reporting_get_agentmodule_data_max ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_data_max ($id_agent_module, $period=0, $date = 0) { global $config; // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"]; $datelimit = $date - $period; $id_module_type = modules_get_agentmodule_type ($id_agent_module); @@ -230,12 +228,11 @@ function reporting_get_agentmodule_data_max ($id_agent_module, $period, $date = * * @return float The minimum module value of the module */ -function reporting_get_agentmodule_data_min ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_data_min ($id_agent_module, $period=0, $date = 0) { global $config; // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"]; $datelimit = $date - $period; $id_module_type = modules_get_agentmodule_type ($id_agent_module); @@ -305,12 +302,10 @@ function reporting_get_agentmodule_data_min ($id_agent_module, $period, $date = * * @return float The sumatory of the module values in the interval. */ -function reporting_get_agentmodule_data_sum ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_data_sum ($id_agent_module, $period=0, $date = 0) { global $config; // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) - $period = $config["sla_period"]; $datelimit = $date - $period; $id_module_type = db_get_value ('id_tipo_modulo', 'tagente_modulo','id_agente_modulo', $id_agent_module); @@ -414,9 +409,6 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, $min_valu if (empty ($date)) { $date = get_system_time (); } - if ((empty ($period)) OR ($period == 0)) { - $period = $config["sla_period"]; - } if ($daysWeek === null) { $daysWeek = array(); } @@ -600,9 +592,6 @@ function reporting_get_agentmodule_sla_array ($id_agent_module, $period = 0, $mi if (empty ($date)) { $date = get_system_time (); } - if ((empty ($period)) OR ($period == 0)) { - $period = $config["sla_period"]; - } if ($daysWeek === null) { $daysWeek = array(); } @@ -1783,12 +1772,7 @@ function reporting_alert_reporting_agent ($id_agent, $period = 0, $date = 0, $re } if (empty ($date)) { $date = get_system_time (); - } - if (empty ($period)) { - global $config; - $period = $config["sla_period"]; - } - + } $table->width = '99%'; $table->data = array (); $table->head = array (); @@ -1893,10 +1877,6 @@ function reporting_alert_reporting_group ($id_group, $period = 0, $date = 0, $re if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - $period = $config["sla_period"]; - } $table->width = '99%'; $table->data = array (); @@ -2035,10 +2015,6 @@ function reporting_alert_reporting_module ($id_agent_module, $period = 0, $date if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - $period = $config["sla_period"]; - } $table->width = '99%'; $table->data = array (); @@ -2548,10 +2524,6 @@ function reporting_get_agents_detailed_event ($id_agents, $period = 0, if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - $period = $config["sla_period"]; - } $table->width = '99%'; @@ -2670,10 +2642,6 @@ function reporting_get_group_detailed_event ($id_group, $period = 0, if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - $period = $config["sla_period"]; - } $table->width = '99%'; @@ -2794,10 +2762,6 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0, $date = if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - $period = $config["sla_period"]; - } $table->width = '99%'; $table->data = array (); @@ -6531,11 +6495,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f * * @return float The MTBF value in the interval. */ -function reporting_get_agentmodule_mtbf ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_mtbf ($id_agent_module, $period = 0, $date = 0) { // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"]; // Read module configuration $datelimit = $date - $period; @@ -6642,11 +6605,10 @@ function reporting_get_agentmodule_mtbf ($id_agent_module, $period, $date = 0) { * * @return float The MTTR value in the interval. */ -function reporting_get_agentmodule_mttr ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_mttr ($id_agent_module, $period = 0, $date = 0) { // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"]; // Read module configuration $datelimit = $date - $period; @@ -6752,11 +6714,10 @@ function reporting_get_agentmodule_mttr ($id_agent_module, $period, $date = 0) { * * @return float The TTO value in the interval. */ -function reporting_get_agentmodule_tto ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_tto ($id_agent_module, $period = 0, $date = 0) { // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"]; // Read module configuration $datelimit = $date - $period; @@ -6853,11 +6814,10 @@ function reporting_get_agentmodule_tto ($id_agent_module, $period, $date = 0) { * * @return float The TTR value in the interval. */ -function reporting_get_agentmodule_ttr ($id_agent_module, $period, $date = 0) { +function reporting_get_agentmodule_ttr ($id_agent_module, $period = 0, $date = 0) { // Initialize variables if (empty ($date)) $date = get_system_time (); - if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"]; // Read module configuration $datelimit = $date - $period; @@ -7017,11 +6977,6 @@ function reporting_get_count_events_by_agent ($id_group, $period = 0, if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - - $period = $config["sla_period"]; - } return events_get_count_events_by_agent($id_group, $period, $date, $filter_event_validated, $filter_event_critical, @@ -7050,11 +7005,6 @@ function reporting_get_count_events_validated_by_user ($filter, $period = 0, if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - - $period = $config["sla_period"]; - } return events_get_count_events_validated_by_user($filter, $period, $date, $filter_event_validated, $filter_event_critical, @@ -7083,11 +7033,6 @@ function reporting_get_count_events_by_criticity ($filter, $period = 0, if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - - $period = $config["sla_period"]; - } return events_get_count_events_by_criticity($filter, $period, $date, $filter_event_validated, $filter_event_critical, @@ -7116,11 +7061,6 @@ function reporting_get_count_events_validated ($filter, $period = 0, if (empty ($date)) { $date = get_system_time (); } - if (empty ($period)) { - global $config; - - $period = $config["sla_period"]; - } return events_get_count_events_validated($filter, $period, $date, $filter_event_validated, $filter_event_critical, diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 15d6aaec41..2f1eae4421 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -70,7 +70,6 @@ INSERT INTO tconfig (token, value) VALUES ('graph_color7', '#99FF99'); INSERT INTO tconfig (token, value) VALUES ('graph_color8', '#330066'); INSERT INTO tconfig (token, value) VALUES ('graph_color9', '#66FFFF'); INSERT INTO tconfig (token, value) VALUES ('graph_color10', '#6666FF'); -INSERT INTO tconfig (token, value) VALUES ('sla_period', '604800'); INSERT INTO tconfig (token, value) VALUES ('trap2agent', '0'); INSERT INTO tconfig (token, value) VALUES ('date_format', 'F j, Y, g:i a'); INSERT INTO tconfig (token, value) VALUES ('event_view_hr', 8); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 0d06cbe38a..e33f52e665 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -53,7 +53,6 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('graph_color8', '#330066'), ('graph_color9', '#ffff00'), ('graph_color10', '#99ffff'), -('sla_period', '604800'), ('trap2agent', '0'), ('date_format', 'F j, Y, g:i a'), ('event_view_hr', 8),