|
20 | 20 | * |
21 | 21 | * @link https://www.librenms.org |
22 | 22 | * |
23 | | - * @copyright 2025 Peca Nesovanovic |
24 | | - * @author Peca Nesovanovic <[email protected]> |
| 23 | + * @copyright 2026 Frederik Kriewitz |
| 24 | + * @author Frederik Kriewitz <[email protected]> |
25 | 25 | */ |
26 | 26 |
|
27 | 27 | namespace LibreNMS\OS; |
28 | 28 |
|
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 |
38 | 30 | { |
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) |
68 | 32 | } |
0 commit comments