diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f2d74eb91a..541086433f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2009-06-24 Sancho Lerena + + * operation/agentes/estado_generalagente.php, + godmode/setup/setup.php: Added support for new option for have enabled or + disabled the agent access data/graphs. + + * include/functions_db.php: Modified the agent_delete function to don't delete + all data, just delete agent and mark modules for deletion. This increase a lot + the massive agent deletion. This fixes bug #2809015. + + * include/config_process.php: Updated version/build. + + * include/functions_config.php: Added autoupdate to config check for + non-existant values. Added new agentaccess config token. + 2009-06-24 Miguel de Dios * include/styles/pandora.css: fix sintaxis error in comment. diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 528f9ce95c..ce5ca8909d 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -110,6 +110,10 @@ $table->data[14][1] = print_input_text ('attachment_store', $config["attachment_ enterprise_hook ('setup'); +$table->data[18][0] = __('Use agent access graph'); +$table->data[18][1] = __('Yes').' '.print_radio_button ('agentaccess', 1, '', $config["agentaccess"], true).'  '; +$table->data[18][1] .= __('No').' '.print_radio_button ('agentaccess', 0, '', $config["agentaccess"], true); + echo '
'; print_input_hidden ('update_config', 1); print_table ($table); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 83a578cec8..f18236eb76 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -15,7 +15,7 @@ // GNU General Public License for more details. //Pandora Version -$build_version = 'PC090512'; +$build_version = 'PC090623'; $pandora_version = 'v3.0-dev'; $config['start_time'] = microtime (true); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index dee2ab6bab..d3af7880e8 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -102,6 +102,7 @@ function update_config () { update_config_value ('compact_header', (bool) get_parameter ('compact_header', $config["compact_header"])); update_config_value ('round_corner', (bool) get_parameter ('round_corner', $config["round_corner"])); update_config_value ('status_images_set', (string) get_parameter ('status_images_set', $config["status_images_set"])); + update_config_value ('agentaccess', (int) get_parameter ('agentaccess', $config['agentaccess'])); } /** @@ -218,6 +219,14 @@ function process_config () { update_config_value ('round_corner', false); } + if (!isset ($config["agentaccess"])){ + update_config_value ('agentaccess', true); + } + + if (!isset ($config["autoupdate"])){ + update_config_value ('autoupdate', true); + } + if (!isset ($config["auth"])) { require_once ($config["homedir"]."/include/auth/mysql.php"); } else { diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 8f958e732b..fc5b21f39a 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -2662,9 +2662,11 @@ function delete_agent ($id_agents) { //Alert temp_sql_delete ("talert_compound", "id_agent", $id_agent); temp_sql_delete ("talert_template_modules", "id_agent_module", $where_modules); - + //Events (up/down monitors) - temp_sql_delete ("tevento", "id_agente", $id_agent); + // Dont delete here, could be very time-exausting, let the daily script + // delete them after XXX days + // temp_sql_delete ("tevento", "id_agente", $id_agent); //Graphs, layouts & reports temp_sql_delete ("tgraph_source", "id_agent_module", $where_modules); @@ -2675,21 +2677,23 @@ function delete_agent ($id_agents) { temp_sql_delete ("tplanned_downtime_agents", "id_agent", $id_agent); //The status of the module - temp_sql_delete ("tagente_estado", "id_agente_modulo", $where_modules); + temp_sql_delete ("tagente_estado", "id_agente", $id_agent); //The actual modules, don't put anything based on - //tagente_modulo after this - temp_sql_delete ("tagente_modulo", "id_agente", $id_agent); + // DONT Delete this, just mark for deletion + // temp_sql_delete ("tagente_modulo", "id_agente", $id_agent); process_sql_update ('tagente_modulo', array ('delete_pending' => 1, 'disabled' => 1), 'id_agente = '. $id_agent); - //Access entries - temp_sql_delete ("tagent_access", "id_agent", $id_agent); + // Access entries + // Dont delete here, this records are deleted in daily script + // temp_sql_delete ("tagent_access", "id_agent", $id_agent); - //tagente_datos_inc - temp_sql_delete ("tagente_datos_inc", "id_agente_modulo", $where_modules); + // tagente_datos_inc + // Dont delete here, this records are deleted later, in database script + // temp_sql_delete ("tagente_datos_inc", "id_agente_modulo", $where_modules); // Delete remote configuration if (isset ($config["remote_config"])) { diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index db25d7582d..fa9e096af6 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -42,8 +42,11 @@ echo '
 
'; //Floating div echo '
'; -echo ''.__('Agent access rate (24h)').'
'; -echo ''; +if ($config["agentaccess"] == 1){ + echo ''.__('Agent access rate (24h)').'
'; + echo ''; +} + echo '
 
'; echo ''.__('Events generated -by module-').'
'; echo '';