Skip to content

Commit

Permalink
Minor updated related to #5259 Make poller and boost consistent
Browse files Browse the repository at this point in the history
lib/poller.php uses a slightly different method to process the poller_output table.  Make boost consistent with lib/poller.php
  • Loading branch information
TheWitness committed Mar 18, 2023
1 parent 366d619 commit b20b9d4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/boost.php
Expand Up @@ -917,9 +917,11 @@ function boost_process_poller_output($local_data_id, $rrdtool_pipe = '') {
$first_tmpl = true;
$multi_ok = false;

for ($i=0; $i<cacti_count($values); $i++) {
if (preg_match("/^([a-zA-Z0-9_\.-]+):([eE0-9Uu\+\.-]+)$/", $values[$i], $matches)) {
if (isset($rrd_field_names[$matches[1]])) {
if (cacti_sizeof($values)) {
foreach($values as $value) {
$matches = explode(':', $value);

if (isset($rrd_field_names[$matches[0]])) {
$multi_ok = true;

if (!$multi_vals_set) {
Expand All @@ -931,12 +933,12 @@ function boost_process_poller_output($local_data_id, $rrdtool_pipe = '') {
$first_tmpl = false;
}

if (is_numeric($matches[2]) || ($matches[2] == 'U')) {
$output = ':' . $matches[2];
if (is_numeric($matches[1]) || ($matches[1] == 'U')) {
$output = ':' . $matches[1];
$outbuf .= $output;
$outlen += strlen($output);
} elseif ((function_exists('is_hexadecimal')) && (is_hexadecimal($matches[2]))) {
$output = ':' . hexdec($matches[2]);
$output = ':' . hexdec($matches[1]);
$outbuf .= $output;
$outlen += strlen($output);
} else {
Expand Down

0 comments on commit b20b9d4

Please sign in to comment.