Skip to content

Commit

Permalink
Fixing #5263 Warnings in Cacti log when re-indexing devices
Browse files Browse the repository at this point in the history
Warnings in Cacti log when re-indexing devices
  • Loading branch information
TheWitness committed Apr 1, 2023
1 parent fe7a3e7 commit 9053727
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Cacti CHANGELOG
-issue#5255: Data query xml path with space problem
-issue#5258: Warnings occur when installing thold plugin and as such thold will not upgrade correctly
-issue#5259: When the Data Template contains more Data Sources than the Graph Template RRDfiles won't update
-issue#5263: Warnings in Cacti log when re-indexing devices
-issue#5272: Boost continues to loose data when archive tables are missed due to overloaded MariaDB
-issue#5275: Boost stats can display odd values when running
-issue#5277: Boost should not attempt to start if there are no poller_output_boost records
Expand Down
6 changes: 2 additions & 4 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2237,9 +2237,9 @@ function is_valid_pathname($path) {
* @param $message - the message to output to the log
* @param $data - the data to be carried with the message
*/
function dsv_log($message, $data, $level = POLLER_VERBOSITY_LOW) {
function dsv_log($message, $data = null, $level = POLLER_VERBOSITY_LOW) {
if (read_config_option('data_source_trace') == 'on') {
cacti_log(($message . ' = ') . (is_array($data) ? json_encode($data) : $data), false, 'DSTRACE', $level);
cacti_log(($message . ' = ') . (is_array($data) ? json_encode($data) : ($data === null ? 'NULL' : $data)), false, 'DSTRACE', $level);
}
}

Expand Down Expand Up @@ -2566,7 +2566,6 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp
$value = $field['value'];

dsv_log('SNMP_QUERY field', $field);
dsv_log('SNMP_QUERY suggested_val', $suggested_vals['custom_data'][$data_template_id]);

if (!empty($suggested_vals['custom_data'][$data_template_id][$field['id']])) {
$value = $suggested_vals['custom_data'][$data_template_id][$field['id']];
Expand Down Expand Up @@ -2661,7 +2660,6 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp
$value = $field['value'];

dsv_log('SCRIPT field', $field);
dsv_log('SCRIPT suggested_val', $suggested_vals['custom_data'][$data_template_id]);

if (!empty($suggested_vals['custom_data'][$data_template_id][$field['id']])) {
$value = $suggested_vals['custom_data'][$data_template_id][$field['id']];
Expand Down

0 comments on commit 9053727

Please sign in to comment.