Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Jul 21, 2017 5:56 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Mactrack: Automatic db maintenance
PostPosted: Fri Mar 17, 2006 4:05 am 
Offline
Cacti User

Joined: Tue Apr 05, 2005 9:52 am
Posts: 367
Location: Munich, Germany
Hello,

I recognized that my mactrack-port table is getting very big (1 mio entries). I search for the last polling cycle and... the first was one month ago. So I started manually the db maintenance and 780000 entries were removed.
Could one look into the maintenance code and check it if it is really called at the given time?

Torsten


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 02, 2007 1:09 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14863
Location: MI, USA
This issue will be addressed in SVN soon. I know that the maintenance script code I wrote has some issues.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Mactrack: Automatic db maintenance
PostPosted: Fri Mar 06, 2015 6:26 am 
Offline

Joined: Fri Mar 06, 2015 6:07 am
Posts: 1
Hi,

I suppose this problem is already fixed, but I have not found anything about it in the web. I have fixed this problem changing some code in poller_mactrack.php, I replaced this code:

Code:
if (empty($last_db_maint_time)) {
        if (strtotime($database_maint_time) < $current_time) {
                $next_db_maint_time = strtotime(date("Y-m-d") . " " . $database_maint_time) +3600*24;
        }else{
                $next_db_maint_time = strtotime(date("Y-m-d") . " " . $database_maint_time);
        }             
}else{
        $next_db_maint_time = $last_db_maint_time + 24*3600;
}


with this one:

Code:
if (empty($last_db_maint_time)) {
    $next_db_maint_time = strtotime(date("Y-m-d") . " " . $database_maint_time);
}else{
    $next_db_maint_time = $last_db_maint_time + 24*3600;
}


It´s working fine right now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group