diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0e84e71e19..803f822411 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,25 @@ +2009-04-02 Esteban Sanchez + + * extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed id on tconfig + inserts. + + * godmode/agentes/configurar_agente.php: Min and max module values + were not being updated. + + * godmode/alerts/configure_alert_template.php: Removed duplicated + example. Added support for next warning and critical template types. + + * include/functions_ui.php, include/functions_alerts.php: Added new + alert template types. + + * include/functions_db.php: temp_sql_delete() moved out of + delete_agent() because there were errors if it was calling more than + once. + + * include/functions_reports.php: Fixed doc for get_reports(). + + * include/config_process.php: Updated build number. + 2009-04-02 Esteban Sanchez * reporting/fgraph.php: Removed id_agente reference on combined diff --git a/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql b/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql index f1e6e291e5..0f13eaa561 100644 --- a/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql @@ -7,11 +7,11 @@ ALTER TABLE treport_content_sla_combined CHANGE sla_limit `sla_limit` double(18, ALTER TABLE ttrap add `priority` tinyint(4) unsigned NOT NULL default '2'; -INSERT INTO `tconfig` VALUES (24, 'loginhash_pwd', ''); -INSERT INTO `tconfig` VALUES (25, 'trap2agent', 0); -INSERT INTO `tconfig` VALUES (26, 'prominent_time', 0); -INSERT INTO `tconfig` VALUES (27, 'timesource', 'system'); -INSERT INTO `tconfig` VALUES (28, 'event_view_hr', 8); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('loginhash_pwd', ''); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('trap2agent', 0); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('prominent_time', 0); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('timesource', 'system'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('event_view_hr', 8); ALTER TABLE tagente ADD `custom_id` varchar(255) default ''; ALTER TABLE tagente_modulo ADD `custom_id` varchar(255) default ''; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 2188ccfc5b..d000b06b3b 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -380,8 +380,8 @@ if ($update_module || $create_module) { $post_process = (float) get_parameter ('post_process'); $prediction_module = (int) get_parameter ('prediction_module'); $max_timeout = (int) get_parameter ('max_timeout'); - $minvalue = (int) get_parameter_post ("minvalue"); - $maxvalue = (int) get_parameter ('maxvalue'); + $minvalue = (int) get_parameter_post ("min"); + $maxvalue = (int) get_parameter ('max'); $interval = (int) get_parameter ('module_interval', $intervalo); $id_prediction_module = (int) get_parameter ('id_prediction_module'); $id_plugin = (int) get_parameter ('id_plugin'); diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 3e64cb2a76..28f0e528df 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -439,11 +439,6 @@ if ($step == 2) { $table->data[2][0] = __('Priority'); $table->data[2][1] = print_select (get_priorities (), 'priority', $priority, '', 0, 0, true, false, false); - $table->data[2][1] .= ''; - $table->data[2][1] .= ' '.print_checkbox ('matches_value', 1, $matches, true); - $table->data[2][1] .= print_label (__('Trigger when matches the value'), - 'checkbox-matches_value', true); - $table->data[2][1] .= ''; $table->data[3][0] = __('Condition type'); $table->data[3][1] = print_select (get_alert_templates_types (), 'type', @@ -518,6 +513,8 @@ var between = " and ');?>"; var under = "');?>"; var over = "');?>"; +var warning = ""; +var critical = ""; function check_regex () { if ($("#type").attr ('value') != 'regex') { @@ -620,6 +617,20 @@ $(document).ready (function () { /* Show example */ $("span#example").empty ().append (under); break; + case "warning": + $("#template-value, #template-max, span#matches_value, #template-min").hide (); + $("#template-example").show (); + + /* Show example */ + $("span#example").empty ().append (warning); + break; + case "critical": + $("#template-value, #template-max, span#matches_value, #template-min").hide (); + $("#template-example").show (); + + /* Show example */ + $("span#example").empty ().append (critical); + break; default: $("#template-value, #template-max, #template-min, #template-example, span#matches_value").hide (); break; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7ebed1aebf..0c707338ad 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //Pandora Version -$build_version = 'PC090324'; +$build_version = 'PC090402'; $pandora_version = 'v3.0-dev'; $config['start_time'] = microtime (true); diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 8b4c4fabca..5c7aff5b2d 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -186,6 +186,8 @@ function get_alert_templates_types () { $types['min'] = __('Min.'); $types['equal'] = __('Equal to'); $types['not_equal'] = __('Not equal to'); + $types['warning'] = __('Warning status'); + $types['critical'] = __('Critical status'); return $types; } diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 2dc8644c06..22bb59b693 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -2502,6 +2502,20 @@ function server_status ($id_server) { return $serverinfo[$id_server]; } +/** + * Subfunciton for less typing + * @ignore + */ +function temp_sql_delete ($table, $row, $value) { + global $error; //Globalize the errors variable + + $result = process_sql_delete ($table, $row.' = '.$value); + if ($result === false) { + $error = true; + } +} + + /** * Delete an agent from the database. * @@ -2514,19 +2528,6 @@ function delete_agent ($id_agents) { $error = false; - //Subfunciton for less typing - /** - * @ignore - */ - function temp_sql_delete ($table, $row, $value) { - global $error; //Globalize the errors variable - $result = process_sql_delete ($table, $row.' = '.$value); - if ($result === false) { - $error = true; - echo $table, $row.' = '.$value; - } - } - //Convert single values to an array if (! is_array ($id_agents)) $id_agents = (array) $id_agents; diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 2dce229bac..0dec4b5cca 100644 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -53,7 +53,9 @@ function get_report ($id_report, $filter = false, $fields = false) { * - The report is not private and the user has reading privileges on * the group associated to the report * - * @param string $id_user User id + * @param array Extra filter to retrieve reports. All reports are returned by + * default + * @param array Fields to be fetched on every report. * * @return array An array with all the reports the user can view. */ @@ -69,7 +71,7 @@ function get_reports ($filter = false, $fields = false) { } $reports = array (); - $all_reports = get_db_all_rows_filter ('treport', $filter, $fields); + $all_reports = @get_db_all_rows_filter ('treport', $filter, $fields); if ($all_reports !== FALSE) foreach ($all_reports as $report){ if ($config['id_user'] != $report['id_user'] && ! give_acl ($config['id_user'], $report['id_group'], 'AR')) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 4e49c3c441..ef5ff937f7 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -422,6 +422,16 @@ function print_alert_template_example ($id_alert_template, $return = false, $pri case 'min': /* Do not translate the HTML attributes */ $output .= __('The alert would fire when the value is under '); + + break; + case 'warning': + /* Do not translate the HTML attributes */ + $output .= __('The alert would fire when the module is in warning status'); + + break; + case 'critical': + /* Do not translate the HTML attributes */ + $output .= __('The alert would fire when the module is in critical status'); break; }