diff --git a/CHANGELOG b/CHANGELOG index 2f363be7e5..54570f545c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ Cacti CHANGELOG -issue#5622: Errors and deprecation warnings with PHP 8.3.0 -issue#5629: auth_changepassword.php cannot return to the refer url by just clicking the "Return" button once -issue#5638: Add tooltip info about IPv6 address +-issue#5645: Boost poller fail to update rrd which Data Template and Graph Template items do not match -issue#5648: Fractional time offsets can cause huge webserver error-logs -issue#5649: Inapprorpiate use of PHP_OS in lib/ping.php on Windows Platform -issue#5655: Function get_allowed_devices can returns incorrect device list if session user_id variable is not set diff --git a/lib/boost.php b/lib/boost.php index 5f7d92374e..4edc9a20a2 100644 --- a/lib/boost.php +++ b/lib/boost.php @@ -844,10 +844,25 @@ function boost_process_poller_output($local_data_id, $rrdtool_pipe = '') { cacti_log('The RRDpath is ' . $rrd_path, false, 'BOOST', POLLER_VERBOSITY_MEDIUM); cacti_log('The RRDpath template is ' . $rrd_tmpl, false, 'BOOST', POLLER_VERBOSITY_MEDIUM); + $unused_data_source_names = array_rekey( + db_fetch_assoc_prepared('SELECT DISTINCT dtr.data_source_name, dtr.data_source_name + FROM data_template_rrd AS dtr + LEFT JOIN graph_templates_item AS gti + ON dtr.id = gti.task_item_id + WHERE dtr.local_data_id = ? + AND gti.task_item_id IS NULL', + array($local_data_id)), + 'data_source_name', 'data_source_name' + ); + boost_timer('results_cycle', BOOST_TIMER_START); /* go through each poller_output_boost entries and process */ foreach ($results as $item) { + if (cacti_sizeof($unused_data_source_names) && isset($unused_data_source_names[$item['rrd_name']])) { + continue; + } + /** * detect duplicate records, this should not happen, * but adding just in case. diff --git a/poller_boost.php b/poller_boost.php index b29e8cd1fc..55c77e436f 100755 --- a/poller_boost.php +++ b/poller_boost.php @@ -762,6 +762,8 @@ function boost_process_local_data_ids($last_id, $child, $rrdtool_pipe) { $last_update = -1; $reset_template = true; + $unused_data_source_names = array(); + /* we are going to blow away all record if ok */ $vals_in_buffer = 0; @@ -769,6 +771,10 @@ function boost_process_local_data_ids($last_id, $child, $rrdtool_pipe) { /* go through each poller_output_boost entries and process */ foreach ($results as $item) { + if ($local_data_id == $item['local_data_id'] && cacti_sizeof($unused_data_source_names) && isset($unused_data_source_names[$item['rrd_name']])) { + continue; + } + $item['timestamp'] = trim($item['timestamp']); if (!$locked) { @@ -789,6 +795,20 @@ function boost_process_local_data_ids($last_id, $child, $rrdtool_pipe) { * and discover the template for the next RRDfile. */ if ($local_data_id != $item['local_data_id']) { + $unused_data_source_names = array_rekey( + db_fetch_assoc_prepared('SELECT DISTINCT dtr.data_source_name, dtr.data_source_name + FROM data_template_rrd AS dtr + LEFT JOIN graph_templates_item AS gti + ON dtr.id = gti.task_item_id + WHERE dtr.local_data_id = ? + AND gti.task_item_id IS NULL', + array($item['local_data_id'])), + 'data_source_name', 'data_source_name' + ); + if (cacti_sizeof($unused_data_source_names) && isset($unused_data_source_names[$item['rrd_name']])) { + continue; + } + $reset_template = true; if (isset($nt_rrd_field_names)) {