routing overview start

git-svn-id: http://www.observium.org/svn/observer/trunk@2177 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-04-27 02:03:33 +00:00
parent 9329a6ac9c
commit 6ac8b1ff80
3 changed files with 33 additions and 3 deletions
+14 -3
View File
@@ -47,9 +47,20 @@ if (is_file("pages/device/routing/".mres($_GET['opta']).".inc.php"))
{
if ($type != "overview")
{
$graph_title = $type_text[$type];
$graph_type = "device_".$type;
include("includes/print-device-graph.php");
if(is_file("pages/device/routing/overview/".mres($type).".inc.php")) {
$g_i++;
if (!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo('<div style="background-color: '.$row_colour.';">');
echo('<div style="padding:4px 0px 0px 8px;" class=graphhead>'.$type_text[$type].'</div>');
include("pages/device/routing/overview/".mres($type).".inc.php");
echo('</div>');
} else {
$graph_title = $type_text[$type];
$graph_type = "device_".$type;
include("includes/print-device-graph.php");
}
}
}
}
@@ -0,0 +1,14 @@
<?php
echo("<strong>AS".$device['bgpLocalAs']."</strong>");
echo("<br />");
$total = mysql_result(mysql_query("SELECT count(*) FROM `bgpPeers` WHERE `device_id` = '".$device['device_id']."'"),0);
$up = mysql_result(mysql_query("SELECT count(*) FROM `bgpPeers` WHERE `device_id` = '".$device['device_id']."' AND `bgpPeerState` = 'established'"),0);
$stop = mysql_result(mysql_query("SELECT count(*) FROM `bgpPeers` WHERE `device_id` = '".$device['device_id']."' AND `bgpPeerAdminStatus` = 'stop'"),0);
echo("Sessions: ".$total." Up: ".$up." Down: ".($total-$up) . ($stop != 0 ? " ( Shutdown: ".$stop." )" : ""));
?>
@@ -0,0 +1,5 @@
<?php
echo("<pre>");
print_r(mysql_fetch_assoc(mysql_query("SELECT * FROM `ospf_instances` WHERE `device_id` = '".$device['device_id']."'")));
echo("</pre>");
?>