graphing for c6k fabric

git-svn-id: http://www.observium.org/svn/observer/trunk@2724 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-11-14 20:21:53 +00:00
parent 45c6d95501
commit 2c8a5633bc
3 changed files with 64 additions and 2 deletions

View File

@@ -0,0 +1,21 @@
<?php
include("includes/graphs/device/auth.inc.php");
if ($auth && is_numeric($_GET['mod']) && is_numeric($_GET['chan']))
{
$entity = dbFetchRow("SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?", array($device['device_id'], $_GET['mod']));
$title .= " :: ".$entity['entPhysicalName'];
$title .= " :: Fabric ".$_GET['chan'];
$graph_title = shorthost($device['hostname']) . "::" . $entity['entPhysicalName']. "::Fabric".$_GET['chan'];
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/c6kxbar-" . safename($_GET['mod']. "-".$_GET['chan']. ".rrd");
}
?>

View File

@@ -0,0 +1,19 @@
<?
$ds_in = "inutil";
$ds_out = "oututil";
$colour_area_in = "AA66AA";
$colour_line_in = "330033";
$colour_area_out = "FFDD88";
$colour_line_out = "FF6600";
$colour_area_in_max = "cc88cc";
$colour_area_out_max = "FFefaa";
$graph_max = 1;
$unit_text = "Percent";
include("includes/graphs/generic_duplex.inc.php");
?>

View File

@@ -14,8 +14,8 @@ foreach($entity_state['group']['c6kxbar'] as $index => $entry)
$entity = dbFetchRow("SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?", array($device['device_id'], $index));
echo("<tr bgcolor=$row_colour>
<td colspan=2 width=200><strong>".$entity['entPhysicalName']."</strong></td>
<td colspan=4>".$entry['']['cc6kxbarModuleModeSwitchingMode']."</td>
<td colspan=5 width=200><strong>".$entity['entPhysicalName']."</strong></td>
<td colspan=2>".$entry['']['cc6kxbarModuleModeSwitchingMode']."</td>
</tr>");
foreach($entity_state['group']['c6kxbar'][$index] as $subindex => $fabric)
@@ -35,12 +35,34 @@ foreach($entity_state['group']['c6kxbar'] as $index => $entry)
$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'] = $now;
$graph_array['id'] = $device['device_id'];
$graph_array['mod'] = $index;
$graph_array['chan'] = $subindex;
$graph_array['type'] = "c6kxbar_util";
$graph_array['from'] = $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);
$overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - " . $text_descr);
$graph_array['width'] = 80; $graph_array['height'] = 20; $graph_array['bg'] = $graph_colour;
$minigraph = generate_graph_tag($graph_array);
echo("<tr bgcolor=$row_colour>
<td width=10></td>
<td width=200><strong>Fabric ".$subindex."</strong></td>
<td><span style='font-weight: bold;' class=".$fabric['mode_class'].">".$fabric['cc6kxbarModuleChannelFabStatus']."</span></td>
<td>".formatRates($fabric['cc6kxbarModuleChannelSpeed']*1000000)."</td>
<td>".overlib_link($link, $minigraph, $overlib_content)."</td>
<td>".print_percentage_bar (125, 20, $percent_in, "Ingress", "ffffff", $background['left'], $percent_in . "%", "ffffff", $background['right'])."</td>
<td>".print_percentage_bar (125, 20, $percent_out, "Egress", "ffffff", $background['left'], $percent_out . "%", "ffffff", $background['right'])."</td>
</tr>");