mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixes to map.php to display hosts not in database (found with discovery protocols)
git-svn-id: http://www.observium.org/svn/observer/trunk@892 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
12
html/map.php
12
html/map.php
@@ -64,11 +64,23 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$src = $device['hostname'];
|
$src = $device['hostname'];
|
||||||
|
if($remote_interface_id) {
|
||||||
$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 = 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);
|
$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 = $link['remote_hostname'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$sif = ifNameDescr(mysql_fetch_array(mysql_query("SELECT * FROM ports WHERE `interface_id`=" . $link['local_interface_id'])),$device);
|
$sif = ifNameDescr(mysql_fetch_array(mysql_query("SELECT * FROM ports WHERE `interface_id`=" . $link['local_interface_id'])),$device);
|
||||||
|
if($remote_interface_id) {
|
||||||
$dif = ifNameDescr(mysql_fetch_array(mysql_query("SELECT * FROM ports WHERE `interface_id`=" . $link['remote_interface_id'])));
|
$dif = ifNameDescr(mysql_fetch_array(mysql_query("SELECT * FROM ports WHERE `interface_id`=" . $link['remote_interface_id'])));
|
||||||
|
} else {
|
||||||
|
$dif['label'] = $link['remote_port'];
|
||||||
|
$dif['interface_id'] = $link['remote_hostname'] . $link['remote_port'];
|
||||||
|
}
|
||||||
|
|
||||||
$map .= "\"" . $sif['interface_id'] . "\" [label=\"" . $sif['label'] . "\", fontsize=12, fillcolor=lightblue URL=\"/device/".$device['device_id']."/interface/$local_interface_id/\"]\n";
|
$map .= "\"" . $sif['interface_id'] . "\" [label=\"" . $sif['label'] . "\", fontsize=12, fillcolor=lightblue URL=\"/device/".$device['device_id']."/interface/$local_interface_id/\"]\n";
|
||||||
if (!$ifdone[$src][$sif['interface_id']])
|
if (!$ifdone[$src][$sif['interface_id']])
|
||||||
|
|||||||
Reference in New Issue
Block a user