Skip to content

Commit 1194fb6

Browse files
committed
fsbdcom
1 parent 8d42f1b commit 1194fb6

File tree

1 file changed

+4
-40
lines changed

1 file changed

+4
-40
lines changed

LibreNMS/OS/FsBdcom.php

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,13 @@
2020
*
2121
* @link https://www.librenms.org
2222
*
23-
* @copyright 2025 Peca Nesovanovic
24-
* @author Peca Nesovanovic <[email protected]>
23+
* @copyright 2026 Frederik Kriewitz
24+
* @author Frederik Kriewitz <[email protected]>
2525
*/
2626

2727
namespace LibreNMS\OS;
2828

29-
use App\Facades\PortCache;
30-
use App\Models\Link;
31-
use Illuminate\Support\Collection;
32-
use Illuminate\Support\Facades\Log;
33-
use LibreNMS\Interfaces\Discovery\LinkDiscovery;
34-
use LibreNMS\OS;
35-
use SnmpQuery;
36-
37-
class FsBdcom extends OS implements LinkDiscovery
29+
class FsBdcom extends Bdcom
3830
{
39-
public function discoverLinks(): Collection
40-
{
41-
$links = new Collection;
42-
43-
Log::info('NMS-LLDP-MIB:');
44-
$lldp_array = SnmpQuery::hideMib()->walk('NMS-LLDP-MIB::lldpRemoteSystemsData')->table(2);
45-
foreach ($lldp_array as $lldp_array_inner) {
46-
foreach ($lldp_array_inner as $lldp) {
47-
$interface = PortCache::getByIfIndex($lldp['lldpRemLocalPortNum'] ?? 0, $this->getDeviceId());
48-
$remote_device_id = find_device_id($lldp['lldpRemSysName'] ?? 0);
49-
if (isset($interface['port_id']) && $lldp['lldpRemSysName'] && $lldp['lldpRemPortId']) {
50-
$remote_port_id = find_port_id($lldp['lldpRemPortDesc'], $lldp['lldpRemPortId'], $remote_device_id);
51-
$links->push(new Link([
52-
'local_port_id' => $interface['port_id'],
53-
'remote_hostname' => $lldp['lldpRemSysName'],
54-
'remote_device_id' => $remote_device_id,
55-
'remote_port_id' => $remote_port_id,
56-
'active' => 1,
57-
'protocol' => 'lldp',
58-
'remote_port' => $lldp['lldpRemPortId'] ?? '',
59-
'remote_platform' => null,
60-
'remote_version' => $lldp['lldpRemSysDesc'] ?? '',
61-
]));
62-
}
63-
}
64-
}
65-
66-
return $links->filter();
67-
}
31+
// No changes needed, inherits everything from Bdcom (OEM)
6832
}

0 commit comments

Comments
 (0)