mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
some formatting cleanups, introduce some more FIXMEs to look at, plus replace mysql_fetch_array by mysql_fetch_assoc, for great justice
git-svn-id: http://www.observium.org/svn/observer/trunk@2029 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -89,7 +89,7 @@ if ($device['os'] == "ios" || $device['os'] == "iosxe")
|
||||
} elseif ($interface['ifVlan']) {
|
||||
echo("<span class=box-desc><span class=blue>VLAN " . $interface['ifVlan'] . "</span></span>");
|
||||
} elseif ($interface['ifVrf']) {
|
||||
$vrf = mysql_fetch_array(mysql_query("SELECT * FROM vrfs WHERE vrf_id = '".$interface['ifVrf']."'"));
|
||||
$vrf = mysql_fetch_assoc(mysql_query("SELECT * FROM vrfs WHERE vrf_id = '".$interface['ifVrf']."'"));
|
||||
echo("<span style='color: green;'>" . $vrf['vrf_name'] . "</span>");
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ echo("<td width=375 valign=top class=interface-desc>");
|
||||
if (strpos($interface['label'], "oopback") === false && !$graph_type)
|
||||
{
|
||||
$link_query = mysql_query("select * from links AS L, ports AS I, devices AS D WHERE L.local_interface_id = '$if_id' AND L.remote_interface_id = I.interface_id AND I.device_id = D.device_id");
|
||||
while ($link = mysql_fetch_array($link_query))
|
||||
while ($link = mysql_fetch_assoc($link_query))
|
||||
{
|
||||
# echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generate_port_link($link, makeshortif($link['label'])) . " on " . generate_device_link($link, shorthost($link['hostname'])) . "</a><br />");
|
||||
# $br = "<br />";
|
||||
@@ -136,7 +136,7 @@ if (strpos($interface['label'], "oopback") === false && !$graph_type)
|
||||
{ ## Show which other devices are on the same subnet as this interface
|
||||
$sql = "SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `interface_id` = '".$interface['interface_id']."' AND `ipv4_address` NOT LIKE '127.%'";
|
||||
$nets_query = mysql_query($sql);
|
||||
while ($net = mysql_fetch_array($nets_query))
|
||||
while ($net = mysql_fetch_assoc($nets_query))
|
||||
{
|
||||
$ipv4_network_id = $net['ipv4_network_id'];
|
||||
$sql = "SELECT I.interface_id FROM ipv4_addresses AS A, ports AS I, devices AS D
|
||||
@@ -144,7 +144,7 @@ if (strpos($interface['label'], "oopback") === false && !$graph_type)
|
||||
AND A.ipv4_network_id = '".$net['ipv4_network_id']."' AND D.device_id = I.device_id
|
||||
AND D.device_id != '".$device['device_id']."'";
|
||||
$new_query = mysql_query($sql);
|
||||
while ($new = mysql_fetch_array($new_query))
|
||||
while ($new = mysql_fetch_assoc($new_query))
|
||||
{
|
||||
echo($new['ipv4_network_id']);
|
||||
$this_ifid = $new['interface_id'];
|
||||
@@ -158,7 +158,7 @@ if (strpos($interface['label'], "oopback") === false && !$graph_type)
|
||||
|
||||
$sql = "SELECT ipv6_network_id FROM ipv6_addresses WHERE interface_id = '".$interface['interface_id']."'";
|
||||
$nets_query = mysql_query($sql);
|
||||
while ($net = mysql_fetch_array($nets_query))
|
||||
while ($net = mysql_fetch_assoc($nets_query))
|
||||
{
|
||||
$ipv6_network_id = $net['ipv6_network_id'];
|
||||
$sql = "SELECT I.interface_id FROM ipv6_addresses AS A, ports AS I, devices AS D
|
||||
@@ -166,7 +166,7 @@ if (strpos($interface['label'], "oopback") === false && !$graph_type)
|
||||
AND A.ipv6_network_id = '".$net['ipv6_network_id']."' AND D.device_id = I.device_id
|
||||
AND D.device_id != '".$device['device_id']."' AND A.ipv6_origin != 'linklayer' AND A.ipv6_origin != 'wellknown'";
|
||||
$new_query = mysql_query($sql);
|
||||
while ($new = mysql_fetch_array($new_query))
|
||||
while ($new = mysql_fetch_assoc($new_query))
|
||||
{
|
||||
echo($new['ipv6_network_id']);
|
||||
$this_ifid = $new['interface_id'];
|
||||
@@ -181,7 +181,7 @@ if (strpos($interface['label'], "oopback") === false && !$graph_type)
|
||||
|
||||
foreach ($int_links as $int_link)
|
||||
{
|
||||
$link_if = mysql_fetch_array(mysql_query("SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.interface_id = '".$int_link."'"));
|
||||
$link_if = mysql_fetch_assoc(mysql_query("SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.interface_id = '".$int_link."'"));
|
||||
|
||||
echo("$br");
|
||||
|
||||
@@ -198,11 +198,11 @@ if (strpos($interface['label'], "oopback") === false && !$graph_type)
|
||||
}
|
||||
|
||||
$pseudowires = mysql_query("SELECT * FROM `pseudowires` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
|
||||
while ($pseudowire = mysql_fetch_array($pseudowires))
|
||||
while ($pseudowire = mysql_fetch_assoc($pseudowires))
|
||||
{
|
||||
#`interface_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid`
|
||||
$pw_peer_dev = mysql_fetch_array(mysql_query("SELECT * from `devices` WHERE `device_id` = '" . $pseudowire['peer_device_id'] . "'"));
|
||||
$pw_peer_int = mysql_fetch_array(mysql_query("SELECT * from `ports` AS I, pseudowires AS P WHERE I.device_id = '".$pseudowire['peer_device_id']."' AND
|
||||
$pw_peer_dev = mysql_fetch_assoc(mysql_query("SELECT * from `devices` WHERE `device_id` = '" . $pseudowire['peer_device_id'] . "'"));
|
||||
$pw_peer_int = mysql_fetch_assoc(mysql_query("SELECT * from `ports` AS I, pseudowires AS P WHERE I.device_id = '".$pseudowire['peer_device_id']."' AND
|
||||
P.cpwVcID = '".$pseudowire['cpwVcID']."' AND
|
||||
P.interface_id = I.interface_id"));
|
||||
$pw_peer_int = ifNameDescr($pw_peer_int);
|
||||
@@ -211,7 +211,7 @@ while ($pseudowire = mysql_fetch_array($pseudowires))
|
||||
}
|
||||
|
||||
$members = mysql_query("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'");
|
||||
while ($member = mysql_fetch_array($members))
|
||||
while ($member = mysql_fetch_assoc($members))
|
||||
{
|
||||
echo("$br<img src='images/16/brick_link.png' align=absmiddle> <strong>" . generate_port_link($member) . " (PAgP)</strong>");
|
||||
$br = "<br />";
|
||||
@@ -219,7 +219,7 @@ while ($member = mysql_fetch_array($members))
|
||||
|
||||
if ($interface['pagpGroupIfIndex'] && $interface['pagpGroupIfIndex'] != $interface['ifIndex'])
|
||||
{
|
||||
$parent = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE `ifIndex` = '".$interface['pagpGroupIfIndex']."' and `device_id` = '".$device['device_id']."'"));
|
||||
$parent = mysql_fetch_assoc(mysql_query("SELECT * FROM `ports` WHERE `ifIndex` = '".$interface['pagpGroupIfIndex']."' and `device_id` = '".$device['device_id']."'"));
|
||||
echo("$br<img src='images/16/bricks.png' align=absmiddle> <strong>" . generate_port_link($parent) . " (PAgP)</strong>");
|
||||
$br = "<br />";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user