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'); } } } else { echo "disabled\n"; } if ($debug) { print_r($link_exists); } $sql = "SELECT * FROM `links` AS L, `ports` AS I WHERE L.local_port_id = I.port_id AND I.device_id = '".$device['device_id']."'"; foreach (dbFetchRows($sql) as $test) { $local_port_id = $test['local_port_id']; $remote_hostname = $test['remote_hostname']; $remote_port = $test['remote_port']; if ($debug) { echo("$local_port_id -> $remote_hostname -> $remote_port \n"); } if (!$link_exists[$local_port_id][$remote_hostname][$remote_port]) { echo("-"); $rows = dbDelete('links', '`id` = ?', array($test['id'])); if ($debug) { echo("$rows deleted "); } } } unset($link_exists); echo("\n"); ?>