* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited * */ echo(generate_link($descr,$link_array,array('view'=>'macaccounting'))); $graphs = array('bits' => 'Bits', 'pkts' => 'Packets'); $navbar = array(); $navbar['class'] = "navbar-narrow"; $navbar['brand'] = 'Mac Accounting'; $subviews = array('details', 'graphs', 'minigraphs', 'top10'); foreach ($subviews as $type) { $navbar['options'][$type]['text'] = nicecase($type); $navbar['options'][$type]['url'] = generate_url($vars,array('subview'=>$type)); if ($vars['subview'] == $type) {$navbar['options'][$type]['class'] = "active"; } } foreach ($graphs as $type => $text) { $navbar['options_right'][$type]['text'] = $text; $navbar['options_right'][$type]['url'] = generate_url($link_array,array('view' => 'macaccounting', 'subview' => 'graphs', 'graph'=>$type)); if ($vars['graph'] == $type) {$navbar['options_right'][$type]['class'] = "active"; } } print_navbar($navbar); // FIXME - REWRITE! $hostname = $device['hostname']; $hostid = $device['port_id']; $ifname = $port['port_label']; $ifIndex = $port['ifIndex']; $speed = humanspeed($port['ifSpeed']); $ifalias = $port['name']; if ($port['ifPhysAddress']) { $mac = $port['ifPhysAddress']; } $color = "black"; if ($port['ifAdminStatus'] == "down") { $status = "Disabled"; } else if ($port['ifAdminStatus'] == "up") { if ($port['ifOperStatus'] == "down" || $port['ifOperStatus'] == "lowerLayerDown") { $status = "Enabled / Disconnected"; } else { $status = "Enabled / Connected"; } } $i = 1; echo("
'); } elseif ($vars['sort'] == $sort) { echo(' | '.$col.' * | '); } else { echo(''.$col.' | '); } } echo("|||||
---|---|---|---|---|---|---|---|
".implode(" ", $ips)." |
".$name." ".$arp_name . " | ".formatRates($acc['bytes_input_rate'] / 8)." | ".formatRates($acc['bytes_output_rate'] / 8)." | ".format_number($acc['pkts_input_rate'] / 8)."pps | ".format_number($acc['pkts_output_rate'] / 8)."pps | ||
'); print_graph_row($graph_array); echo(" |