Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(broker): fix issue with rrdcached external information
Browse files Browse the repository at this point in the history
  • Loading branch information
garnier-quentin authored and adr-mo committed Apr 12, 2019
1 parent da90286 commit dda2557
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions www/class/config-generate/broker.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ private function generate($poller_id, $localhost)
foreach ($resultParameters as $key => $value) {
// We search the BlockId
$blockId = 0;
$configGroupdId = null;
for ($i = count($value); $i > 0; $i--) {
if (isset($value[$i]['config_key']) && $value[$i]['config_key'] == 'blockId') {
$blockId = $value[$i]['config_value'];
$configGroupId = $value[$i]['config_group_id'];
break;
}
}
Expand Down Expand Up @@ -221,6 +223,16 @@ private function generate($poller_id, $localhost)
}
$flow_count++;
}

// Check if we need to add values from external
foreach ($this->cacheExternalValue as $key2 => $value2) {
if (preg_match('/^(.+)_' . $blockId . '$/', $key2, $matches)) {
if (!isset($object[$configGroupId][$key][$matches[1]])) {
$object[$configGroupId][$key][$matches[1]] =
$this->getInfoDb($value2);
}
}
}
}

# Stats parameters
Expand Down

0 comments on commit dda2557

Please sign in to comment.