'); echo(''); echo(" Catalyst 6k Crossbar"); echo('
'); foreach ($entity_state['group']['c6kxbar'] as $index => $entry) { // FIXME i'm not sure if this is the correct way to decide what entphysical index it is. slotnum+1? :> $entity = dbFetchRow("SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?", array($device['device_id'], $index+1)); echo(""); foreach ($entity_state['group']['c6kxbar'][$index] as $subindex => $fabric) { if (is_numeric($subindex)) { if ($fabric['cc6kxbarModuleChannelFabStatus'] == "ok") { $fabric['mode_class'] = "green"; } else { $fabric['mode_class'] = "red"; } $percent_in = $fabric['cc6kxbarStatisticsInUtil']; $background_in = get_percentage_colours($percent_in); $percent_out = $fabric['cc6kxbarStatisticsOutUtil']; $background_out = get_percentage_colours($percent_out); $graph_array = array(); $graph_array['height'] = "100"; $graph_array['width'] = "210"; $graph_array['to'] = $config['time']['now']; $graph_array['device'] = $device['device_id']; $graph_array['mod'] = $index; $graph_array['chan'] = $subindex; $graph_array['type'] = "c6kxbar_util"; $graph_array['from'] = $config['time']['day']; $graph_array['legend'] = "no"; $link_array = $graph_array; $link_array['page'] = "graphs"; unset($link_array['height'], $link_array['width'], $link_array['legend']); $link = generate_url($link_array); $text_descr = $entity['entPhysicalName'] . " - Fabric " . $subindex; $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - " . $text_descr); $graph_array['width'] = 80; $graph_array['height'] = 20; $graph_array['bg'] = 'ffffff00'; # the 00 at the end makes the area transparent. $minigraph = generate_graph_tag($graph_array); echo(""); } } } echo("
".$entity['entPhysicalName']." "); switch ($entry['']['cc6kxbarModuleModeSwitchingMode']) { case "busmode": # echo 'Bus'; break; case "crossbarmode": echo 'Crossbar'; break; case "dcefmode": echo 'DCEF'; break; default: echo $entry['']['cc6kxbarModuleModeSwitchingMode']; } echo("
Fabric ".$subindex." ". $fabric['cc6kxbarModuleChannelFabStatus']." ".formatRates($fabric['cc6kxbarModuleChannelSpeed']*1000000)." ".overlib_link($link, $minigraph, $overlib_content)." ".print_percentage_bar (125, 20, $percent_in, "Ingress", "ffffff", $background['left'], $percent_in . "%", "ffffff", $background['right'])." ".print_percentage_bar (125, 20, $percent_out, "Egress", "ffffff", $background['left'], $percent_out . "%", "ffffff", $background['right'])."
"); echo("
"); echo("
"); echo("
"); echo(""); ?>