2009-09-07 11:07:59 +00:00
<? php
2009-02-06 14:53:33 +00:00
2009-03-25 09:21:44 +00:00
$interface_query = mysql_query ( "select * from interfaces WHERE interface_id = '" . $_GET [ 'opta' ] . "'" );
2009-02-06 14:53:33 +00:00
$interface = mysql_fetch_array ( $interface_query );
2009-06-19 10:43:02 +00:00
$port_details = 1 ;
2009-02-06 14:53:33 +00:00
$hostname = $device [ 'hostname' ];
$hostid = $device [ 'interface_id' ];
$ifname = $interface [ 'ifDescr' ];
$ifIndex = $interface [ 'ifIndex' ];
$speed = humanspeed ( $interface [ 'ifSpeed' ]);
$ifalias = $interface [ 'name' ];
if ( $interface [ 'ifPhysAddress' ]) { $mac = " $interface[ifPhysAddress] " ; }
$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>" ; }
$i = 1 ;
$inf = fixifName ( $ifname );
$bg = "#ffffff" ;
$show_all = 1 ;
echo ( "<div class=ifcell style='margin: 0px;'><table width=100% cellpadding=10 cellspacing=0>" );
2009-10-28 13:49:37 +00:00
include ( "includes/print-interface.inc.php" );
2009-02-06 14:53:33 +00:00
echo ( "</table></div>" );
$pos = strpos ( strtolower ( $ifname ), "vlan" );
if ( $pos !== false ) {
$broke = yes ;
}
$pos = strpos ( strtolower ( $ifname ), "loopback" );
if ( $pos !== false ) {
$broke = yes ;
}
2009-10-13 20:07:31 +00:00
if ( mysql_result ( mysql_query ( "SELECT COUNT(*) FROM `interfaces` WHERE `pagpGroupIfIndex` = '" . $interface [ 'ifIndex' ] . "' and `device_id` = '" . $device [ 'device_id' ] . "'" ), 0 )) {
$pagp = " | <a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/pagp/'>PAgP</a>" ;
}
2009-02-06 14:53:33 +00:00
echo ( "<div style='clear: both;'>" );
2010-01-13 23:56:33 +00:00
print_optionbar_start ();
echo ( "<a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/'>Graphs</a> |
2009-10-13 20:07:31 +00:00
<a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/arp/'>ARP Table</a> $pagp " );
2009-09-18 14:45:34 +00:00
if ( mysql_result ( mysql_query ( "SELECT count(*) FROM mac_accounting WHERE interface_id = '" . $interface [ 'interface_id' ] . "'" ), 0 )){
echo ( " | Mac Accounting :
<a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/macaccounting/bits/'>Bits</a>
2009-09-22 12:02:54 +00:00
(<a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/macaccounting/bits/thumbs/'>Mini</a>|<a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/macaccounting/bits/top10/'>Top10</a>) |
2009-09-18 14:45:34 +00:00
<a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/macaccounting/pkts/'>Packets</a>
(<a href='" . $config [ 'base_url' ] . "/device/" . $device [ 'device_id' ] . "/interface/" . $interface [ 'interface_id' ] . "/macaccounting/pkts/thumbs/'>Mini</a>)" );
}
2010-01-13 23:56:33 +00:00
print_optionbar_end ();
2009-09-18 14:45:34 +00:00
2009-05-11 13:43:59 +00:00
if ( $_GET [ 'optb' ]) {
2009-02-06 14:53:33 +00:00
2009-09-24 14:38:17 +00:00
include ( "pages/device/port/" . mres ( $_GET [ 'optb' ]) . ".inc.php" );
2009-02-06 14:53:33 +00:00
2009-05-11 13:43:59 +00:00
} else {
2009-10-28 13:49:37 +00:00
if ( file_exists ( $config [ 'rrd_dir' ] . "/" . $hostname . "/" . $ifIndex . ".rrd" )) {
2009-02-06 14:53:33 +00:00
2009-05-11 13:43:59 +00:00
$iid = $id ;
echo ( "<div class=graphhead>Interface Traffic</div>" );
2009-10-28 13:49:37 +00:00
$graph_type = "port_bits" ;
include ( "includes/print-interface-graphs.inc.php" );
2009-05-11 13:43:59 +00:00
echo ( "<div class=graphhead>Interface Packets</div>" );
2009-10-28 13:49:37 +00:00
$graph_type = "port_upkts" ;
include ( "includes/print-interface-graphs.inc.php" );
2009-05-11 13:43:59 +00:00
echo ( "<div class=graphhead>Interface Non Unicast</div>" );
2009-10-28 13:49:37 +00:00
$graph_type = "port_nupkts" ;
include ( "includes/print-interface-graphs.inc.php" );
2009-05-11 13:43:59 +00:00
echo ( "<div class=graphhead>Interface Errors</div>" );
2009-10-28 13:49:37 +00:00
$graph_type = "port_errors" ;
include ( "includes/print-interface-graphs.inc.php" );
if ( is_file ( $config [ 'rrd_dir' ] . "/" . $device [ 'hostname' ] . "/etherlike-" . $interface [ 'ifIndex' ] . ".rrd" )) {
echo ( "<div class=graphhead>Ethernet Errors</div>" );
$graph_type = "port_etherlike" ;
include ( "includes/print-interface-graphs.inc.php" );
}
2009-05-11 13:43:59 +00:00
}
2009-02-06 14:53:33 +00:00
}
2009-05-11 13:43:59 +00:00
2009-02-06 14:53:33 +00:00
?>