2010-04-24 22:43:25 +00:00
|
|
|
|
2011-03-19 01:43:13 +00:00
|
|
|
<table cellpadding=3 cellspacing=0 class="devicetable sortable" width=100%>
|
2010-04-24 22:43:25 +00:00
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2011-09-12 02:35:58 +00:00
|
|
|
echo("<tr class=tablehead><td></td><th>Device</a></th><th>Interface</th><th>Speed</th><th>Down</th><th>Up</th><th>Media</th><th>Description</th></tr>");
|
2010-04-24 22:43:25 +00:00
|
|
|
|
|
|
|
$row = 1;
|
|
|
|
|
2011-10-17 10:33:06 +00:00
|
|
|
$ports_disabled = 0; $ports_down = 0; $ports_up = 0; $ports_total = 0;
|
|
|
|
|
2011-09-19 11:15:01 +00:00
|
|
|
foreach ($ports as $port)
|
2011-03-17 00:09:20 +00:00
|
|
|
{
|
2010-04-24 22:43:25 +00:00
|
|
|
|
2011-10-17 10:33:06 +00:00
|
|
|
if ($port['ifAdminStatus'] == "down") { $ports_disabled++;
|
|
|
|
} elseif ($port['ifAdminStatus'] == "up" && $port['ifOperStatus']== "down") { $ports_down++;
|
|
|
|
} elseif ($port['ifAdminStatus'] == "up" && $port['ifOperStatus']== "up") { $ports_up++; }
|
|
|
|
$ports_total++;
|
|
|
|
|
2011-09-19 11:15:01 +00:00
|
|
|
if (port_permitted($port['interface_id'], $port['device_id']))
|
2011-09-17 19:14:44 +00:00
|
|
|
{
|
2010-04-24 22:43:25 +00:00
|
|
|
|
2011-09-17 19:14:44 +00:00
|
|
|
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
2011-09-12 02:35:58 +00:00
|
|
|
|
2011-09-19 11:15:01 +00:00
|
|
|
$speed = humanspeed($port['ifSpeed']);
|
|
|
|
$type = humanmedia($port['ifType']);
|
2011-10-17 10:33:06 +00:00
|
|
|
$ifclass = ifclass($port['ifOperStatus'], $port['ifAdminStatus']);
|
|
|
|
|
2011-09-12 02:35:58 +00:00
|
|
|
|
2011-09-19 11:15:01 +00:00
|
|
|
if ($port['in_errors'] > 0 || $port['out_errors'] > 0)
|
2011-09-17 19:14:44 +00:00
|
|
|
{
|
2011-09-19 11:15:01 +00:00
|
|
|
$error_img = generate_port_link($port,"<img src='images/16/chart_curve_error.png' alt='Interface Errors' border=0>",errors);
|
2011-09-17 19:14:44 +00:00
|
|
|
} else { $error_img = ""; }
|
|
|
|
|
2011-09-19 11:15:01 +00:00
|
|
|
$port['in_rate'] = formatRates($port['ifInOctets_rate'] * 8);
|
|
|
|
$port['out_rate'] = formatRates($port['ifOutOctets_rate'] * 8);
|
2010-04-24 22:43:25 +00:00
|
|
|
|
2011-09-19 11:15:01 +00:00
|
|
|
$port = ifLabel($port, $device);
|
2010-04-24 22:43:25 +00:00
|
|
|
echo("<tr bgcolor=$row_colour>
|
|
|
|
<td width=5></td>
|
2011-09-19 11:15:01 +00:00
|
|
|
<td width=200 class=list-bold><a href='" . generate_device_url($port) . "'>".$port['hostname']."</a></td>
|
2011-10-17 10:33:06 +00:00
|
|
|
<td width=150 class=list-bold><a class='".$ifclass."'href='" . generate_port_url($port) . "'>".fixIfName($port['label'])." $error_img</td>
|
2010-04-24 22:43:25 +00:00
|
|
|
<td width=110 >$speed</td>
|
2011-09-19 11:15:01 +00:00
|
|
|
<td width=110 class=green>".$port['in_rate']."</td>
|
|
|
|
<td width=110 class=blue>".$port['out_rate']."</td>
|
2010-04-24 22:43:25 +00:00
|
|
|
<td width=200>$type</td>
|
2011-09-19 11:15:01 +00:00
|
|
|
<td>" . $port['ifAlias'] . "</td>
|
2010-04-24 22:43:25 +00:00
|
|
|
</tr>\n");
|
|
|
|
|
|
|
|
$row++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo("</table>");
|
|
|
|
|
2011-10-17 10:33:06 +00:00
|
|
|
echo("Ports: $ports_total ( Up $ports_up | Down $ports_down | Disabled $ports_disabled )");
|
|
|
|
|
|
|
|
|
2011-03-19 01:43:13 +00:00
|
|
|
?>
|