2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
if (!isset($_GET['optb']) ) { $_GET['optb'] = "graphs"; }
|
2010-03-11 21:58:50 +00:00
|
|
|
|
2011-05-15 15:29:47 +00:00
|
|
|
$interface = dbFetchRow("SELECT * FROM `ports` WHERE `interface_id` = ?", array($_GET['opta']));
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$port_details = 1;
|
2009-06-19 10:43:02 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$hostname = $device['hostname'];
|
|
|
|
$hostid = $device['interface_id'];
|
|
|
|
$ifname = $interface['ifDescr'];
|
|
|
|
$ifIndex = $interface['ifIndex'];
|
|
|
|
$speed = humanspeed($interface['ifSpeed']);
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$ifalias = $interface['name'];
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
if ($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$color = "black";
|
|
|
|
if ($interface['ifAdminStatus'] == "down") { $status = "<span class='grey'>Disabled</span>"; }
|
|
|
|
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "<span class='red'>Enabled / Disconnected</span>"; }
|
|
|
|
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "<span class='green'>Enabled / Connected</span>"; }
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$i = 1;
|
|
|
|
$inf = fixifName($ifname);
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$bg="#ffffff";
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$show_all = 1;
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
echo("<div class=ifcell style='margin: 0px;'><table width=100% cellpadding=10 cellspacing=0>");
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
include("includes/print-interface.inc.php");
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
echo("</table></div>");
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$pos = strpos(strtolower($ifname), "vlan");
|
|
|
|
if ($pos !== false )
|
|
|
|
{
|
|
|
|
$broke = yes;
|
|
|
|
}
|
|
|
|
|
|
|
|
$pos = strpos(strtolower($ifname), "loopback");
|
|
|
|
|
|
|
|
if ($pos !== false )
|
|
|
|
{
|
2009-02-06 14:53:33 +00:00
|
|
|
$broke = yes;
|
2011-03-16 23:10:10 +00:00
|
|
|
}
|
2009-02-06 14:53:33 +00:00
|
|
|
|
|
|
|
echo("<div style='clear: both;'>");
|
|
|
|
|
2010-01-13 23:56:33 +00:00
|
|
|
print_optionbar_start();
|
|
|
|
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "graphs" || !$_GET['optb']) { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/'>Graphs</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "graphs" || !$_GET['optb']) { echo("</span>"); }
|
|
|
|
|
|
|
|
|
2011-05-15 15:29:47 +00:00
|
|
|
if (dbFetchCell("SELECT COUNT(*) FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'") )
|
2011-04-09 16:04:04 +00:00
|
|
|
{
|
|
|
|
echo(" | ");
|
|
|
|
if ($_GET['optb'] == "adsl") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/port/".$interface['interface_id']."/adsl/'>ADSL</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "adsl") { echo("</span>"); }
|
|
|
|
}
|
|
|
|
|
|
|
|
echo(" | ");
|
|
|
|
|
|
|
|
if ($_GET['optb'] == "arp") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/arp/'>ARP Table</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "arp") { echo("</span>"); }
|
2010-07-18 08:20:30 +00:00
|
|
|
|
2011-05-15 15:29:47 +00:00
|
|
|
if (dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `pagpGroupIfIndex` = '".
|
|
|
|
$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'") )
|
2010-07-18 08:20:30 +00:00
|
|
|
{
|
2011-04-09 16:04:04 +00:00
|
|
|
echo(" | ");
|
|
|
|
if ($_GET['optb'] == "pagp") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/pagp/'>PAgP</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "pagp") { echo("</span>"); }
|
2010-07-18 08:20:30 +00:00
|
|
|
}
|
|
|
|
|
2009-10-13 20:07:31 +00:00
|
|
|
|
2011-05-15 15:29:47 +00:00
|
|
|
if (dbFetchCell("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'") > "0" )
|
2011-03-16 23:10:10 +00:00
|
|
|
{
|
2011-04-09 16:04:04 +00:00
|
|
|
echo(" | Mac Accounting : ");
|
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && !$_GET['optd']) { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/bits/'>Bits</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && !$_GET['optd']) { echo("</span>"); }
|
|
|
|
echo("(");
|
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "thumbs") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/bits/thumbs/'>Mini</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "thumbs") { echo("</span>"); }
|
|
|
|
echo('|');
|
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "top10") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-13 13:00:56 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/bits/top10/'>Top10</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "top10") { echo("</span>"); }
|
2011-04-13 13:00:56 +00:00
|
|
|
echo(") | ");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && !$_GET['optd']) { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/pkts/'>Packets</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && !$_GET['optd']) { echo("</span>"); }
|
|
|
|
echo("(");
|
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && $_GET['optd'] == "thumbs") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/pkts/thumbs/'>Mini</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && $_GET['optd'] == "thumbs") { echo("</span>"); }
|
|
|
|
echo(")");
|
2011-03-16 23:10:10 +00:00
|
|
|
}
|
2009-05-11 13:43:59 +00:00
|
|
|
|
2011-05-15 15:29:47 +00:00
|
|
|
if (dbFetchCell("SELECT COUNT(*) FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'") > "0" )
|
2011-03-16 23:10:10 +00:00
|
|
|
{
|
2011-04-09 16:04:04 +00:00
|
|
|
echo(" | ATM VPs : ");
|
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/bits/'>Bits</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
|
|
|
echo(" | ");
|
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "packets") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/packets/'>Packets</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
|
|
|
echo(" | ");
|
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "cells") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/cells/'>Cells</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
|
|
|
echo(" | ");
|
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "errors") { echo("<span class='pagemenu-selected'>"); }
|
2011-04-09 16:08:39 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/errors/'>Errors</a>");
|
2011-04-09 16:04:04 +00:00
|
|
|
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
2011-03-16 23:10:10 +00:00
|
|
|
}
|
2009-10-28 13:49:37 +00:00
|
|
|
|
2010-03-11 21:58:50 +00:00
|
|
|
print_optionbar_end();
|
2009-02-06 14:53:33 +00:00
|
|
|
|
2010-07-18 08:51:18 +00:00
|
|
|
echo("<div style='margin: 5px;'>");
|
2010-03-11 21:58:50 +00:00
|
|
|
include("pages/device/port/".mres($_GET['optb']).".inc.php");
|
2010-07-18 08:51:18 +00:00
|
|
|
echo("</div>");
|
2011-03-16 23:10:10 +00:00
|
|
|
|
2011-04-09 16:04:04 +00:00
|
|
|
?>
|