New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Mikrotik LLDP discovery #7901
Conversation
Nice work @erotel :) out of interest can the other LLDP code further down not be re-used? |
Standard LLDP can not be used because Mikrotik does not meet the LLDP standard |
Oh how I laughed :( |
if (($device['os'] == 'routeros') && Config::get('autodiscovery.xdp') === true) { | ||
echo ' LLDP-MIB: '; | ||
$lldp_array = snmpwalk_group($device, 'lldpRemEntry', 'LLDP-MIB', 3); | ||
$lldp_ports = snmpwalk_group($device, 'mtxrInterfaceStatsName', 'MIKROTIK-MIB'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not unconditionally do 3 snmpwalks here.
If the first one fails, there is no point in doing the other two.
Looks great @erotel, looks good to merge after the small change I mentioned |
@laf The Mikrotik has a lot of things wrong standart lldp in edge core
and Mikrotik
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one change from me then good to go.
if (!empty($lldp_array)) { | ||
$lldp_ports = snmpwalk_group($device, 'mtxrInterfaceStatsName', 'MIKROTIK-MIB'); | ||
$lldp_ports_num = snmpwalk_group($device, 'mtxrNeighborInterfaceID', 'MIKROTIK-MIB'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May as well move the foreach ($lldp_array)
into this if check, no point in even attempting to loop through the empty array.
The inspection completed: 2 new issues |
This thread has been automatically locked since there has not been any recent activity after it was closed. |
DO NOT DELETE THIS TEXT
Please note
Testers
If you would like to test this pull request then please run:
./scripts/github-apply <pr_id>
, i.e./scripts/github-apply 5926
RouterOS must be > 6.38