Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for Poller Last Run Date #5478

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/poller_reindex_hosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
$i++;
}

set_config_option('reindex_last_run_time', time());
unregister_process('reindex', 'master');

}
Expand Down
1 change: 1 addition & 0 deletions poller_maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ function rrdfile_purge($force) {

/* record the start time */
$poller_end = microtime(true);
set_config_option('rrdcleaner_last_run_time', time());
$string = sprintf('RRDMAINT STATS: Time:%4.4f Purged:%s Archived:%s', ($poller_end - $poller_start), $purged, $archived);
cacti_log($string, true, 'SYSTEM');
}
Expand Down
5 changes: 3 additions & 2 deletions poller_rrdcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@

rrdcheck_debug('Polling Ending');

set_config_option('rrdchecker_last_run_time', time());

if (!$forcerun) {
unregister_process('rrdcheck', $type, $thread_id);
}
Expand Down Expand Up @@ -202,12 +204,11 @@ function rrdcheck_master_handler($forcerun) {
// determine if it's time to determine hourly averages
if (empty($last_run)) {
// since the poller has never run before, let's fake it out
set_config_option('rrdcheck_last_run_time', date('Y-m-d G:i:s', $current_time));
set_config_option('rrdcheck_last_run_time', date($current_time));
}

// if it's time to check, do so now
if ((!empty($last_run) && ((strtotime($last_run) + ($run_interval * 60)) < $current_time)) || $forcerun) {
set_config_option('rrdcheck_last_run_time', date('Y-m-d G:i:s', $current_time));

rrdcheck_launch_children($type);

Expand Down