'); $cols = array('device' => 'Device', 'port' => 'Port', 'speed' => 'Speed', 'traffic_in' => 'Down', 'traffic_out' => 'Up', 'media' => 'Media', 'descr' => 'Description' ); foreach ($cols as $sort => $col) { if (isset($vars['sort']) && $vars['sort'] == $sort) { echo(''); } else { echo(''); } } echo(" "); $ports_disabled = 0; $ports_down = 0; $ports_up = 0; $ports_total = 0; foreach ($ports as $port) { if (port_permitted($port['port_id'], $port['device_id'])) { 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++; $speed = humanspeed($port['ifSpeed']); $type = humanmedia($port['ifType']); $ifclass = ifclass($port['ifOperStatus'], $port['ifAdminStatus']); if ((isset($port['in_errors']) && $port['in_errors'] > 0) || (isset($ports['out_errors']) && $port['out_errors'] > 0)) { $error_img = generate_port_link($port,"Interface Errors",errors); } else { $error_img = ""; } $port['in_rate'] = formatRates($port['ifInOctets_rate'] * 8); $port['out_rate'] = formatRates($port['ifOutOctets_rate'] * 8); $port = ifLabel($port, $device); echo("\n"); } } echo('
'.$col.' *'.$col.'
".generate_device_link($port, shorthost($port['hostname'], "20"))." ".fixIfName($port['label'])." $error_img $speed ".$port['in_rate']." ".$port['out_rate']." $type " . $port['ifAlias'] . "
'); echo("Matched Ports: $ports_total ( Up $ports_up | Down $ports_down | Disabled $ports_disabled )"); echo('
'); ?>