Mactrack: Automatic db maintenance

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Mactrack: Automatic db maintenance

Post by torstentfk »

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
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
avillaverdec
Posts: 1
Joined: Fri Mar 06, 2015 6:07 am

Re: Mactrack: Automatic db maintenance

Post by avillaverdec »

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: Select all

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: Select all

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests