2010-11-25 15:32:47 +00:00
|
|
|
<table cellpadding="7" cellspacing="0" class="devicetable" width="100%">
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
2011-04-11 09:22:12 +00:00
|
|
|
if ($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg = "#ffffff"; }
|
2009-05-03 22:32:01 +00:00
|
|
|
|
2010-11-25 15:32:47 +00:00
|
|
|
$type_where = " (";
|
2011-09-19 13:48:46 +00:00
|
|
|
foreach (explode(",", $vars['type']) as $type)
|
2010-11-25 15:32:47 +00:00
|
|
|
{
|
2011-05-14 21:51:58 +00:00
|
|
|
$type_where .= " $or `port_descr_type` = ?";
|
2010-11-25 15:32:47 +00:00
|
|
|
$or = "OR";
|
2011-09-20 09:55:11 +00:00
|
|
|
$type_param[] = $type;
|
2010-11-25 15:32:47 +00:00
|
|
|
}
|
2009-05-28 13:03:52 +00:00
|
|
|
|
2010-11-25 15:32:47 +00:00
|
|
|
$type_where .= ") ";
|
2011-05-14 21:51:58 +00:00
|
|
|
$ports = dbFetchRows("SELECT * FROM `ports` as I, `devices` AS D WHERE $type_where AND I.device_id = D.device_id ORDER BY I.ifAlias", $type_param);
|
2010-07-26 20:04:31 +00:00
|
|
|
|
2011-09-19 13:48:46 +00:00
|
|
|
foreach ($ports as $port)
|
2010-11-25 15:32:47 +00:00
|
|
|
{
|
2011-09-19 13:48:46 +00:00
|
|
|
$if_list .= $seperator . $port['interface_id'];
|
2010-11-25 15:32:47 +00:00
|
|
|
$seperator = ",";
|
|
|
|
}
|
|
|
|
unset($seperator);
|
|
|
|
|
2011-09-19 13:48:46 +00:00
|
|
|
$types_array = explode(',',$vars['type']);
|
2010-11-25 15:32:47 +00:00
|
|
|
for ($i = 0; $i < count($types_array);$i++) $types_array[$i] = ucfirst($types_array[$i]);
|
|
|
|
$types = implode(' + ',$types_array);
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2010-11-25 15:32:47 +00:00
|
|
|
echo("<tr bgcolor='$bg'>
|
2010-02-20 17:22:22 +00:00
|
|
|
<td><span class=list-large>Total Graph for ports of type : ".$types."</span></td></tr>");
|
2009-05-03 22:32:01 +00:00
|
|
|
|
2010-12-01 15:51:00 +00:00
|
|
|
if ($if_list)
|
2010-11-25 15:32:47 +00:00
|
|
|
{
|
2009-05-03 22:32:01 +00:00
|
|
|
echo("<tr bgcolor='$bg'><td>");
|
2011-09-19 13:48:46 +00:00
|
|
|
$graph_type = "multiport_bits_separate";
|
|
|
|
$port['interface_id'] = $if_list;
|
2009-10-28 13:49:37 +00:00
|
|
|
include("includes/print-interface-graphs.inc.php");
|
2009-05-03 22:32:01 +00:00
|
|
|
echo("</td></tr>");
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2011-09-19 13:48:46 +00:00
|
|
|
foreach ($ports as $port)
|
2010-11-25 15:32:47 +00:00
|
|
|
{
|
2007-04-03 14:10:23 +00:00
|
|
|
$done = "yes";
|
|
|
|
unset($class);
|
2011-09-19 13:48:46 +00:00
|
|
|
$port['ifAlias'] = str_ireplace($type . ": ", "", $port['ifAlias']);
|
|
|
|
$port['ifAlias'] = str_ireplace("[PNI]", "Private", $port['ifAlias']);
|
|
|
|
$ifclass = ifclass($port['ifOperStatus'], $port['ifAdminStatus']);
|
2011-04-11 09:22:12 +00:00
|
|
|
if ($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg = "#ffffff"; }
|
2007-04-03 14:10:23 +00:00
|
|
|
echo("<tr bgcolor='$bg'>
|
2011-09-19 13:48:46 +00:00
|
|
|
<td><span class=list-large>" . generate_port_link($port,$port['port_descr_descr']) . "</span><br />
|
|
|
|
<span class=interface-desc style='float: left;'>".generate_device_link($port)." ".generate_port_link($port)." </span>");
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2011-09-19 13:48:46 +00:00
|
|
|
if (dbFetchCell("SELECT count(*) FROM mac_accounting WHERE interface_id = ?", array($port['interface_id'])))
|
2010-11-25 15:32:47 +00:00
|
|
|
{
|
2011-09-19 13:48:46 +00:00
|
|
|
echo("<span style='float: right;'><a href='device/".$port['device_id']."/port/".$port['interface_id']."/macaccounting/'><img src='/images/16/chart_curve.png' align='absmiddle'> MAC Accounting</a></span>");
|
2009-02-02 15:38:34 +00:00
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2009-02-02 15:38:34 +00:00
|
|
|
echo("</td></tr><tr bgcolor='$bg'><td>");
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2011-09-19 13:48:46 +00:00
|
|
|
if (file_exists($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . $port['ifIndex'] . ".rrd"))
|
2010-11-25 15:32:47 +00:00
|
|
|
{
|
|
|
|
$graph_type = "port_bits";
|
|
|
|
include("includes/print-interface-graphs.inc.php");
|
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2010-11-25 15:32:47 +00:00
|
|
|
echo("</td></tr>");
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2010-11-25 15:32:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
echo("<tr><td>None found.</td></tr>");
|
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
?>
|
2011-05-14 21:51:58 +00:00
|
|
|
</table>
|