mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
2010-03-19 Eric Ross <eric.ross.c@gmail.com>
* util/pandora_db.pl: Added log4x tables to purge git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2518 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d71282f836
commit
353d7e5f79
@ -1,3 +1,7 @@
|
|||||||
|
2010-03-19 Eric Ross <eric.ross.c@gmail.com>
|
||||||
|
|
||||||
|
* util/pandora_db.pl: Added log4x tables to purge
|
||||||
|
|
||||||
2010-03-10 Sancho Lerena <slerena@artica.es>
|
2010-03-10 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/DataServer.pm: Fix for annoying notices from
|
* lib/PandoraFMS/DataServer.pm: Fix for annoying notices from
|
||||||
|
@ -103,6 +103,22 @@ sub pandora_purgedb ($$) {
|
|||||||
}
|
}
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Now the log4x data
|
||||||
|
#
|
||||||
|
$first_mark = get_db_value ($dbh, 'SELECT utimestamp FROM tagente_datos_log4x ORDER BY utimestamp ASC LIMIT 1');
|
||||||
|
$total_time = $ulimit_timestamp - $first_mark;
|
||||||
|
$purge_steps = int($total_time / $BIG_OPERATION_STEP);
|
||||||
|
|
||||||
|
for (my $ax = 1; $ax <= $BIG_OPERATION_STEP; $ax++){
|
||||||
|
|
||||||
|
db_do ($dbh, "DELETE FROM tagente_datos_log4x WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp > ". $first_mark );
|
||||||
|
print "[PURGE] Log4x data deletion progress %$ax .. \r";
|
||||||
|
}
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
|
||||||
# String data deletion
|
# String data deletion
|
||||||
print "[PURGE] Deleting old string data... \n";
|
print "[PURGE] Deleting old string data... \n";
|
||||||
if (!defined($conf->{'_string_purge'})){
|
if (!defined($conf->{'_string_purge'})){
|
||||||
@ -165,6 +181,7 @@ sub pandora_purgedb ($$) {
|
|||||||
foreach my $module (@deleted_modules) {
|
foreach my $module (@deleted_modules) {
|
||||||
print " Deleting data for module " . $module->{'id_agente_modulo'} . "\n";
|
print " Deleting data for module " . $module->{'id_agente_modulo'} . "\n";
|
||||||
db_do ($dbh, "DELETE FROM tagente_datos WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
db_do ($dbh, "DELETE FROM tagente_datos WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
||||||
|
db_do ($dbh, "DELETE FROM tagente_datos_log4x WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
||||||
db_do ($dbh, "DELETE FROM tagente_datos_string WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
db_do ($dbh, "DELETE FROM tagente_datos_string WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
||||||
db_do ($dbh, "DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
db_do ($dbh, "DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
||||||
db_do ($dbh, "DELETE FROM tagente_estado WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
db_do ($dbh, "DELETE FROM tagente_estado WHERE id_agente_modulo = ?", $module->{'id_agente_modulo'});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user