diff --git a/html/includes/print-interface.inc b/html/includes/print-interface.inc
index 2820ff96d..c47653d58 100644
--- a/html/includes/print-interface.inc
+++ b/html/includes/print-interface.inc
@@ -9,6 +9,9 @@
$ifSpeed = humanspeed($interface['ifSpeed']);
$ifPhysAddress = $interface['ifPhysAddress'];
$ifType = fixiftype($interface['ifType']);
+ $ifHardType = $interface['ifHardType'];
+
+# echo($interface['ifHardType']);
if($ifAlias) {$ifAlias = $ifAlias . "";}
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
@@ -22,7 +25,7 @@
$ifAlias");
unset ($break);
if(!$dographs) {
- $ipdata = mysql_query("SELECT * FROM `ipaddr` WHERE `interface_id` = '$interface[interface_id]'");
+ $ipdata = mysql_query("SELECT * FROM `ipaddr` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
while($ip = mysql_fetch_Array($ipdata)) {
echo("$break $ip[addr]/$ip[cidr]");
$break = " ";
@@ -30,20 +33,22 @@
echo("");
echo("
");
if($ifSpeed && $ifSpeed != "") { echo("$ifSpeed"); }
+ echo(" ");
+ if($interface[ifDuplex] != unknown) { echo("Duplex " . $interface['ifDuplex'] . ""); } else { echo("-"); }
+ echo(" | ");
+ if($ifType && $ifType != "") { echo("" . $ifType . ""); } else { echo("-"); }
+ echo(" ");
+ if($ifHardType && $ifHardType != "") { echo("" . $ifHardType . ""); } else { echo("-"); }
echo(" | ");
- if($ifType && $iftype != "") { echo("" . $ifType . ""); } else { echo("-"); }
- echo(" | ");
if($interface['ifPhysAddress'] && $interface['ifPhysAddress'] != "") { echo("" . $interface['ifPhysAddress'] . ""); } else { echo("-"); }
- echo(" | ");
+ echo(" ");
if($interface['ifMtu'] && $interface['ifMtu'] != "") { echo("MTU " . $interface['ifMtu'] . ""); } else { echo("-"); }
-
-# if($interface[ifDuplex] != unknown) { echo("Duplex " . $interface['ifDuplex'] . ""); } else { echo("-"); }
}
echo(" | ");
echo("");
if ( strpos($ifDescr, "oopback") === false && !$dographs) {
- $link_query = mysql_query("select I.ifDescr, D.hostname, D.id, I.interface_id from links AS L, interfaces AS I, devices AS D WHERE L.src_if = '$if_id' AND L.dst_if = I.interface_id AND I.device_id = D.id");
+ $link_query = mysql_query("select * from links AS L, interfaces AS I, devices AS D WHERE L.src_if = '$if_id' AND L.dst_if = I.interface_id AND I.device_id = D.device_id");
while($link = mysql_fetch_array($link_query)) {
echo(" " . generateiflink($link) . " on " . generatedevicelink($link) . " ");
$br = " ";
diff --git a/html/pages/interface.php b/html/pages/interface.php
index 68a636cb9..06efcc9b7 100644
--- a/html/pages/interface.php
+++ b/html/pages/interface.php
@@ -1,16 +1,14 @@
-$interface_query = mysql_query("select * from interfaces WHERE id = '$_GET[id]'");
+$interface_query = mysql_query("select * from interfaces WHERE interface_id = '$_GET[id]'");
$interface = mysql_fetch_array($interface_query);
$device_query = mysql_query("select * from devices where id = '$interface[host]'");
$device = mysql_fetch_array($device_query);
$hostname = $device['hostname'];
- $hostid = $device['id'];
- $ifname = $interface['if'];
- $up = $interface['up'];
- $up_admin = $interface['up_admin'];
+ $hostid = $device['interface_id'];
+ $ifname = $interface['ifDescr'];
$ifIndex = $interface['ifIndex'];
$speed = humanspeed($interface['ifSpeed']);
@@ -19,9 +17,9 @@ $interface = mysql_fetch_array($interface_query);
if($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
$color = "black";
- if ($up_admin == "down") { $status = "Disabled"; }
- if ($up_admin == "up" && $up == "down") { $status = "Enabled / Disconnected"; }
- if ($up_admin == "up" && $up == "up") { $status = "Enabled / Connected"; }
+ if ($interface['ifAdminStatus'] == "down") { $status = "Disabled"; }
+ if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "Enabled / Disconnected"; }
+ if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "Enabled / Connected"; }
$i = 1;
$inf = fixifName($ifname);
diff --git a/includes/functions.php b/includes/functions.php
index cd58d6ec5..fe976704c 100755
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -300,9 +300,11 @@ function makeshortif($if) {
$if = str_replace("pos","Pos", $if);
$if = str_replace("port-channel","Po", $if);
$if = str_replace("atm","Atm", $if);
+ $if = str_replace("null", "Null", $if);
$if = str_replace("loopback","Lo", $if);
$if = str_replace("dialer","Di", $if);
$if = str_replace("vlan","Vlan", $if);
+ $if = str_replace("tunnel","Tunnel", $if);
return $if;
}
diff --git a/poll-interface.php b/poll-interface.php
index 2080ffb5e..dbeff73b5 100755
--- a/poll-interface.php
+++ b/poll-interface.php
@@ -121,7 +121,7 @@ while ($interface = mysql_fetch_array($interface_query)) {
if ($update) {
$update_query = "UPDATE `interfaces` SET ";
$update_query .= $update;
- $update_query .= " WHERE `id` = '" . $interface['interface_id'] . "'";
+ $update_query .= " WHERE `interface_id` = '" . $interface['interface_id'] . "'";
echo("Updating : " . $device['hostname'] . " $ifDescr\nSQL :$update_query\n\n");
$update_result = mysql_query($update_query);
} else {
|