Skip to content

Commit

Permalink
change rrdchecker timeout (#5572)
Browse files Browse the repository at this point in the history
* change rrdchecker timeout

* update

* change format from date to timestamp

* change format
  • Loading branch information
xmacan authored Nov 14, 2023
1 parent 0f84e44 commit b465b88
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Cacti CHANGELOG
-issue#5534: When deleting a single Data Source the table data_debug is not purged
-issue#5542: When a form element does not include a 'value' column, provide a more helpful warning message
-issue#5554: Interface description with equal sign (=) in ifAlias does not show Alias
-issue#5572: RRD Checker timeouts to low

1.2.25
-security#GHSA-77rf-774j-6h3p: Protect against Insecure deserialization of filter data
Expand Down
Empty file modified cache/index.php
100644 → 100755
Empty file.
16 changes: 7 additions & 9 deletions include/global_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1368,18 +1368,16 @@
)
),
'rrdcheck_timeout' => array(
'friendly_name' => __('RRDfile Check Timeout'),
'friendly_name' => __('RRDChecker Timeout'),
'description' => __('The maximum amount of time Cacti\'s RRDfile check script can run without generating a timeout error and being killed.'),
'method' => 'drop_array',
'default' => '300',
'default' => '3600',
'array' => array(
'60' => __('%s Minute', 1),
'120' => __('%s Minutes', 2),
'300' => __('%s Minutes', 5),
'600' => __('%s Minutes', 10),
'1200' => __('%s Minutes', 20),
'1800' => __('%s Minutes', 30),
'3600' => __('1 Hour')
'300' => __('%s Minutes', 5),
'1800' => __('%s Minutes', 30),
'3600' => __('%s Hour', 1),
'7200' => __('%s Hour', 2),
'14400' => __('%s Hour', 4)
)
),
'commands_timeout' => array(
Expand Down
2 changes: 1 addition & 1 deletion lib/rrdcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ function rrdcheck_boost_bottom() {
include_once($config['base_path'] . '/lib/rrd.php');

/* run the daily stats. log to database to prevent secondary runs */
set_config_option('rrdcheck_last_run_time', date('Y-m-d G:i:s', time()));
set_config_option('rrdcheck_last_run_time', time());

/* run the daily stats */
rrdcheck_launch_children('bmaster');
Expand Down
6 changes: 3 additions & 3 deletions poller_rrdcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@

rrdcheck_debug('Polling Ending');

set_config_option('rrdchecker_last_run_time', time());
set_config_option('rrdcheck_last_run_time', time());

if (!$forcerun) {
unregister_process('rrdcheck', $type, $thread_id);
Expand Down Expand Up @@ -204,11 +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($current_time));
set_config_option('rrdcheck_last_run_time', ($current_time - 86400));
}

// if it's time to check, do so now
if ((!empty($last_run) && ((strtotime($last_run) + ($run_interval * 60)) < $current_time)) || $forcerun) {
if ((!empty($last_run) && (($last_run + ($run_interval * 60)) < $current_time)) || $forcerun) {

rrdcheck_launch_children($type);

Expand Down

0 comments on commit b465b88

Please sign in to comment.