mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #343 from elbuit/issue-341
Add option to clean old perf_times table entries #341
This commit is contained in:
@@ -48,5 +48,12 @@ if ($options['f'] === 'authlog') {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($options['f'] === 'perf_times') {
|
||||
if (is_numeric($config['perf_times_purge'])) {
|
||||
if (dbDelete('perf_times', "start < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL ? DAY))", array($config['perf_times_purge'])) ) {
|
||||
echo 'Performance poller times cleared for entries over ' . $config['perf_times_purge'] . " days\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
1
daily.sh
1
daily.sh
@@ -10,3 +10,4 @@ fi
|
||||
php daily.php -f syslog
|
||||
php daily.php -f eventlog
|
||||
php daily.php -f authlog
|
||||
php daily.php -f perf_times
|
||||
|
||||
@@ -576,6 +576,7 @@ $config['update'] = 1;
|
||||
$config['syslog_purge'] = 30; # Number in days of how long to keep syslog entries for.
|
||||
$config['eventlog_purge'] = 30; # Number in days of how long to keep eventlog entries for.
|
||||
$config['authlog_purge'] = 30; # Number in days of how long to keep authlog entries for.
|
||||
$config['perf_times_purge'] = 30; # Number in days of how long to keep performace pooling stats entries for.
|
||||
|
||||
# Date format for PHP date()s
|
||||
$config['dateformat']['long'] = "r"; # RFC2822 style
|
||||
|
||||
Reference in New Issue
Block a user