mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #1088 from laf/issue-1063
Update SQL query for ospf_nbrs lookup to use device_id
This commit is contained in:
@ -148,9 +148,8 @@ echo("OSPF Discovery: ");
|
||||
|
||||
if ($config['autodiscovery']['ospf'] === TRUE) {
|
||||
echo "enabled\n";
|
||||
foreach (dbFetchRows("SELECT DISTINCT(`ospfNbrIpAddr`),`device_id` FROM `ospf_nbrs`") as $nbr) {
|
||||
foreach (dbFetchRows("SELECT DISTINCT(`ospfNbrIpAddr`),`device_id` FROM `ospf_nbrs` WHERE `device_id`=?", array($device['device_id'])) as $nbr) {
|
||||
$ip = $nbr['ospfNbrIpAddr'];
|
||||
$device_id = $nbr['device_id'];
|
||||
if (match_network($config['autodiscovery']['nets-exclude'], $ip)) {
|
||||
echo("x");
|
||||
continue;
|
||||
@ -164,7 +163,7 @@ if ($config['autodiscovery']['ospf'] === TRUE) {
|
||||
if (isset($remote_device_id) && $remote_device_id > 0) {
|
||||
log_event("Device $name ($ip) autodiscovered through OSPF", $remote_device_id, 'system');
|
||||
} else {
|
||||
log_event("OSPF discovery of $name ($ip) failed - check ping and SNMP access", $device_id, 'system');
|
||||
log_event("OSPF discovery of $name ($ip) failed - check ping and SNMP access", $device['device_id'], 'system');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user