From b465b88013a7283a4382807f6c963176b72f9d9e Mon Sep 17 00:00:00 2001 From: Petr Macek Date: Tue, 14 Nov 2023 22:29:46 +0100 Subject: [PATCH] change rrdchecker timeout (#5572) * change rrdchecker timeout * update * change format from date to timestamp * change format --- CHANGELOG | 1 + cache/index.php | 0 include/global_settings.php | 16 +++++++--------- lib/rrdcheck.php | 2 +- poller_rrdcheck.php | 6 +++--- 5 files changed, 12 insertions(+), 13 deletions(-) mode change 100644 => 100755 cache/index.php diff --git a/CHANGELOG b/CHANGELOG index 5f56b372d6..a5bf060e27 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/cache/index.php b/cache/index.php old mode 100644 new mode 100755 diff --git a/include/global_settings.php b/include/global_settings.php index e1523fe452..14adac3a3f 100644 --- a/include/global_settings.php +++ b/include/global_settings.php @@ -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( diff --git a/lib/rrdcheck.php b/lib/rrdcheck.php index a0d5baff5d..0c8479f8d8 100644 --- a/lib/rrdcheck.php +++ b/lib/rrdcheck.php @@ -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'); diff --git a/poller_rrdcheck.php b/poller_rrdcheck.php index 179d6ce470..662d808cdd 100755 --- a/poller_rrdcheck.php +++ b/poller_rrdcheck.php @@ -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); @@ -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);