'device', 'device' => $device['device_id'], 'tab' => 'ports', ); print_optionbar_start(); $menu_options['basic'] = 'Basic'; $menu_options['details'] = 'Details'; $menu_options['arp'] = 'ARP Table'; if (dbFetchCell("SELECT * FROM links AS L, ports AS I WHERE I.device_id = '".$device['device_id']."' AND I.port_id = L.local_port_id")) { $menu_options['neighbours'] = 'Neighbours'; } if (dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `ifType` = 'adsl'")) { $menu_options['adsl'] = 'ADSL'; } $sep = ''; foreach ($menu_options as $option => $text) { echo $sep; if ($vars['view'] == $option) { echo ""; } echo generate_link($text, $link_array, array('view' => $option)); if ($vars['view'] == $option) { echo ''; } $sep = ' | '; } unset($sep); echo ' | Graphs: '; $graph_types = array( 'bits' => 'Bits', 'upkts' => 'Unicast Packets', 'nupkts' => 'Non-Unicast Packets', 'errors' => 'Errors', 'etherlike' => 'Etherlike', ); foreach ($graph_types as $type => $descr) { echo "$type_sep"; if ($vars['graph'] == $type && $vars['view'] == 'graphs') { echo ""; } echo generate_link($descr, $link_array, array('view' => 'graphs', 'graph' => $type)); if ($vars['graph'] == $type && $vars['view'] == 'graphs') { echo ''; } echo ' ('; if ($vars['graph'] == $type && $vars['view'] == 'minigraphs') { echo ""; } echo generate_link('Mini', $link_array, array('view' => 'minigraphs', 'graph' => $type)); if ($vars['graph'] == $type && $vars['view'] == 'minigraphs') { echo ''; } echo ')'; $type_sep = ' | '; }//end foreach print_optionbar_end(); if ($vars['view'] == 'minigraphs') { $timeperiods = array( '-1day', '-1week', '-1month', '-1year', ); $from = '-1day'; echo "
"; unset($seperator); // FIXME - FIX THIS. UGLY. foreach (dbFetchRows('select * from ports WHERE device_id = ? ORDER BY ifIndex', array($device['device_id'])) as $port) { echo "
".makeshortif($port['ifDescr']).'
\
".$device['hostname'].' - '.$port['ifDescr'].'
\ '.$port['ifAlias']." \ \
\ ', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >"."
".truncate(short_port_descr($port['ifAlias']), 32, '').'
'; } echo ''; } else if ($vars['view'] == 'arp' || $vars['view'] == 'adsl' || $vars['view'] == 'neighbours') { include 'ports/'.$vars['view'].'.inc.php'; } else { if ($vars['view'] == 'details') { $port_details = 1; } ?>
$port) { $port_cache[$port['port_id']] = $port; $port_index_cache[$port['device_id']][$port['ifIndex']] = $port; $ports[$key]["ifOctets_rate"] = $port["ifInOctets_rate"] + $port["ifOutOctets_rate"]; } switch ($vars["sort"]) { case 'traffic': $ports = array_sort($ports, 'ifOctets_rate', SORT_DESC); break; default: $ports = array_sort($ports, 'ifIndex', SORT_ASC); break; } foreach ($ports as $port) { include 'includes/print-interface.inc.php'; $i++; } echo '
">Port ">Traffic Speed Media Mac Address
'; }//end if $pagetitle[] = 'Ports';