diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 486e3c88a7..3c6ad42cfc 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,12 +1,24 @@ +2009-01-21 Esteban Sanchez + + * godmode/agentes/alert_manager.php: Added support to disable or + enable an alert. Improved a bit the interface to make it cleaner + because the modules are a bit separated now. + + * include/functions_alerts.php: Added support to disable or enable an + alert via set_alerts_agent_module_disable(). Added a flag to choose + wether to get disabled alerts on an agent or not. + + * ChangeLog: Style correction again. Please, be careful. + 2009-01-21 Sancho Lerena - + * pandoradb_data.sql: Updated DB Schema version/build. - * operation/agentes/status_monitor.php - operation/agentes/estado_agente.php: - operation/agentes/estado_ultimopaquete.php, - operation/agentes/estado_monitores.php: Manage correctly async modules - including keepalive. Show servertype with moduletype icon. + * operation/agentes/status_monitor.php, + operation/agentes/estado_agente.php, + operation/agentes/estado_ultimopaquete.php, + operation/agentes/estado_monitores.php: Manage correctly async modules + including keepalive. Show servertype with moduletype icon. 2009-01-21 Esteban Sanchez diff --git a/pandora_console/godmode/agentes/alert_manager.php b/pandora_console/godmode/agentes/alert_manager.php index 46949073df..4c2b6a03c9 100644 --- a/pandora_console/godmode/agentes/alert_manager.php +++ b/pandora_console/godmode/agentes/alert_manager.php @@ -30,6 +30,8 @@ $create_alert = (bool) get_parameter ('create_alert'); $add_action = (bool) get_parameter ('add_action'); $delete_action = (bool) get_parameter ('delete_action'); $delete_alert = (bool) get_parameter ('delete_alert'); +$disable_alert = (bool) get_parameter ('disable_alert'); +$enable_alert = (bool) get_parameter ('enable_alert'); if ($create_alert) { $id_alert_template = (int) get_parameter ('template'); @@ -85,17 +87,32 @@ if ($delete_action) { __('Could not be deleted')); } +if ($enable_alert) { + $id_alert = (int) get_parameter ('id_alert'); + + $result = set_alerts_agent_module_disable ($id_alert, false); + print_error_message ($id, __('Successfully enabled'), + __('Could not be enabled')); +} + +if ($disable_alert) { + $id_alert = (int) get_parameter ('id_alert'); + + $result = set_alerts_agent_module_disable ($id_alert, true); + print_error_message ($id, __('Successfully disabled'), + __('Could not be disabled')); +} + $modules = get_agent_modules ($id_agente, array ('id_tipo_modulo', 'nombre', 'id_agente')); echo "

".__('Modules defined')."

"; -$table->id = 'modules'; +$table->class = 'databox_color modules'; $table->cellspacing = '0'; $table->width = '90%'; -$table->head = array (); -$table->head[0] = __('Module'); $table->data = array (); +$table->rowstyle = array (); $table->style = array (); $table->style[1] = 'vertical-align: top'; @@ -109,39 +126,40 @@ $table_alerts->style[0] = 'vertical-align: top'; $table_alerts->style[1] = 'vertical-align: top'; foreach ($modules as $id_agent_module => $module) { - $data = array (); - $last_data = return_value_agent_module ($id_agent_module); if ($last_data === false) $last_data = ''.__('N/A').''; - $data[0] = ''.$module['nombre'].''; - $data[0] .= ''; - $data[0] .= ''; + $table->data[0][0] = ''.$module['nombre'].''; + $table->data[0][0] .= ''; + $table->data[0][0] .= ''; /* Alerts in module list */ $table_alerts->id = 'alerts-'.$id_agent_module; $table_alerts->data = array (); - $alerts = get_alerts_agent_module ($id_agent_module); + $alerts = get_alerts_agent_module ($id_agent_module, true); if ($alerts === false) { $alerts = array (); + $table->data[1][0] = ''; + $table->rowstyle[1] = 'display: none'; } else { - $data[0] .= '

'; - $data[0] .= __('Alerts'); - $data[0] .= '

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

'; + $table->data[1][0] .= __('Alerts'); + $table->data[1][0] .= '

'; + $table->rowstyle[1] = ''; } foreach ($alerts as $alert) { @@ -150,7 +168,6 @@ foreach ($modules as $id_agent_module => $module) { $alert_actions = get_alert_agent_module_actions ($alert['id']); $alert_data[0] = get_alert_template_name ($alert['id_alert_template']); - $alert_data[0] .= '