diff --git a/html/map.php b/html/map.php index 7a7eb1e2fe..680ddc4c0f 100755 --- a/html/map.php +++ b/html/map.php @@ -91,7 +91,7 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format'])) $dst = mysql_result(mysql_query("SELECT `hostname` FROM `devices` AS D, `ports` AS I WHERE I.interface_id = '$remote_interface_id' AND D.device_id = I.device_id"),0); $dst_host = mysql_result(mysql_query("SELECT D.device_id FROM `devices` AS D, `ports` AS I WHERE I.interface_id = '$remote_interface_id' AND D.device_id = I.device_id"),0); } else { - $dst_host = $link['remote_hostname']; + #$dst_host = $link['remote_hostname']; $dst = $link['remote_hostname']; } @@ -111,7 +111,11 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format'])) $ifdone[$src][$sif['interface_id']] = 1; } - $map .= "\"$dst\" [URL=\"{$config['base_url']}/device/$dst_host/map/\" fontsize=20 shape=box3d]\n"; + if($dst_host) { + $map .= "\"$dst\" [URL=\"{$config['base_url']}/device/$dst_host/map/\" fontsize=20 shape=box3d]\n"; + } else { + $map .= "\"$dst\" [ fontsize=20 shape=box3d]\n"; + } if ($dst_host == $device['device_id'] || $where == '') { @@ -177,4 +181,4 @@ else } } -?> \ No newline at end of file +?> diff --git a/includes/discovery/discovery-protocols.inc.php b/includes/discovery/discovery-protocols.inc.php index afd7b6c40a..0e56979fe6 100755 --- a/includes/discovery/discovery-protocols.inc.php +++ b/includes/discovery/discovery-protocols.inc.php @@ -53,6 +53,7 @@ if ($cdp_array) $remote_interface_id = @mysql_result(mysql_query("SELECT interface_id FROM `ports` WHERE (`ifDescr` = '$if' OR `ifName`='$if') AND `device_id` = '".$remote_device_id."'"),0); } else { $remote_interface_id = "0"; } + if ($interface['interface_id'] && $cdp['cdpCacheDeviceId'] && $cdp['cdpCacheDevicePort']) { discover_link($interface['interface_id'], 'cdp', $remote_interface_id, $cdp['cdpCacheDeviceId'], $cdp['cdpCacheDevicePort'], $cdp['cdpCachePlatform'], $cdp['cdpCacheVersion']); @@ -126,4 +127,4 @@ if ($query = mysql_query($sql)) unset($link_exists); echo("\n"); -?> \ No newline at end of file +?>