Fixed Procera ports ifIndex and ports added by the poller (#9384)

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
This commit is contained in:
Tony Murray
2018-11-28 15:08:42 -06:00
committed by Neil Lathwood
parent dc8647697f
commit 533c9022c9
4 changed files with 3516 additions and 2 deletions

View File

@@ -417,7 +417,7 @@ foreach ($port_stats as $ifIndex => $port) {
d_echo(' valid');
// Port newly discovered?
if (! $ports[$port_id]) {
if (!$port_id || empty($ports[$port_id])) {
/**
* When using the ifName or ifDescr as means to map discovered ports to
* known ports in the DB (think of port association mode) it's possible

View File

@@ -72,7 +72,7 @@ foreach ($packetlogic_stats as $index => $port) {
$procera_port['ifSpeed'] = $mediaType[$negotiatedMedia]['ifSpeed'];
$procera_port['ifDuplex'] = $mediaType[$negotiatedMedia]['ifDuplex'];
$procera_port['ifType'] = 'ethernetCsmacd';
array_push($port_stats, $procera_port);
$port_stats[$index] = $procera_port;
}
}

2256
tests/data/procera.json Normal file
View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff