2009-11-01 Ramon Novoa <rnovoa@artica.es>

* util/pandora_db.pl: Date::Manip is not used anymore.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2068 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2009-11-01 20:43:04 +00:00
parent bad0b9141a
commit 31fa8b3d93
2 changed files with 11 additions and 7 deletions

View File

@ -1,3 +1,7 @@
2009-11-01 Ramon Novoa <rnovoa@artica.es>
* util/pandora_db.pl: Date::Manip is not used anymore.
2009-10-26 Sancho Lerena <slerena@artica.es>
* spec: Added net-tools dependency (includes ping and traceroute).

View File

@ -21,9 +21,9 @@
use strict;
use Time::Local; # DateTime basic manipulation
use DBI; # DB interface with MySQL
use Date::Manip; # Date/Time manipulation
use PandoraFMS::Tools;
use PandoraFMS::DB;
use POSIX qw(strftime);
# version: define la version actual del programa
my $version = "3.0-dev PS090930";
@ -82,11 +82,11 @@ sub pandora_purgedb {
my $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost:3306",$dbuser, $dbpass,{RaiseError => 1, AutoCommit => 1 });
# Calculate limit for deletion, today - $days
my $timestamp = &UnixDate("today","%Y-%m-%d %H:%M:%S");
my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime());
my $ulimit_access_timestamp = &UnixDate("today","%s") - 86400;
my $ulimit_timestamp = &UnixDate("today","%s") - (86400 * $days);
my $limit_timestamp = DateCalc("today","-$days days",\$err);
my $ulimit_access_timestamp = time() - 86400;
my $ulimit_timestamp = time() - (86400 * $days);
my $limit_timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime($ulimit_timestamp));
print "[PURGE] Deleting old event data (More than $config_days_purge days)... \n";
$dbh->do("DELETE FROM tevento WHERE utimestamp < '$ulimit_timestamp'");
@ -501,13 +501,13 @@ sub help_screen{
###############################################################################
sub pandoradb_main {
print "Starting at ". &UnixDate("today","%Y/%m/%d %H:%M:%S"). "\n";
print "Starting at ". strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "\n";
pandora_purgedb ($config_days_purge, $dbname, $dbuser, $dbpass, $dbhost);
pandora_checkdb_consistency ($dbname, $dbuser, $dbpass, $dbhost);
if ($onlypurge == 0){
pandora_compactdb ($config_days_compact, $dbname, $dbuser, $dbpass, $dbhost);
}
print "Ending at ". &UnixDate("today","%Y/%m/%d %H:%M:%S"). "\n";
print "Ending at ". strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "\n";
exit;
}