diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 382e6bbc69..9927577ab9 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -640,9 +640,9 @@ sub pandora_delete_module_data ($$) { my $buffer = 1000; while(1) { - my $nd = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); - my $ndinc = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); - my $ndlog4x = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); + my $nd = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos WHERE id_agente_modulo=?', $id_module); + my $ndinc = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_inc WHERE id_agente_modulo=?', $id_module); + my $ndlog4x = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_log4x WHERE id_agente_modulo=?', $id_module); my $ndstring = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); my $ntot = $nd + $ndinc + $ndlog4x + $ndstring; @@ -652,19 +652,19 @@ sub pandora_delete_module_data ($$) { } if($nd > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos', 'id_agente_modulo='.$id_module, $buffer); } if($ndinc > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos_inc', 'id_agente_modulo='.$id_module, $buffer); } if($ndlog4x > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos_log4x WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos_log4x', 'id_agente_modulo='.$id_module, $buffer); } if($ndstring > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos_string WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos_string', 'id_agente_modulo='.$id_module, $buffer); } } @@ -4416,7 +4416,7 @@ sub cli_delete_data($) { print_log "DELETING THE DATA OF THE AGENT $name\n\n"; - pandora_delete_data($dbh, 'module', $id_agent); + pandora_delete_data($dbh, 'agent', $id_agent); } } else { my $id_agent = get_agent_id($dbh,$name); @@ -4424,7 +4424,7 @@ sub cli_delete_data($) { print_log "DELETING THE DATA OF THE AGENT $name\n\n"; - pandora_delete_data($dbh, 'module', $id_agent); + pandora_delete_data($dbh, 'agent', $id_agent); } } elsif($opt eq '-g' || $opt eq '--g') {