git-svn-id: http://www.observium.org/svn/observer/trunk@2336 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-16 12:48:50 +00:00
parent d9439aaf65
commit fc40257da9
18 changed files with 125 additions and 125 deletions

View File

@@ -1,15 +1,12 @@
<?php
$sql = "SELECT * FROM `ospf_instances` WHERE `device_id` = '".$device['device_id']."'";
$query = mysql_query($sql);
$i_i = "0";
echo('<table width=100% border=0 cellpadding=5>');
#### Loop Instances
while ($instance = mysql_fetch_assoc($query))
foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", array($device['device_id'])) as $instance)
{
if (!is_integer($i_i/2)) { $instance_bg = $list_colour_a; } else { $instance_bg = $list_colour_b; }

View File

@@ -1,14 +0,0 @@
<?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." )" : ""));
?>

View File

@@ -1,44 +0,0 @@
<?php
$sql = "SELECT * FROM `ospf_instances` WHERE `device_id` = '".$device['device_id']."'";
$query = mysql_query($sql);
$i_i = "1";
echo('<table width=100%>');
#### Loop Instances
while ($instance = mysql_fetch_assoc($query))
{
if (!is_integer($i_i/2)) { $instance_bg = $list_colour_a; } else { $instance_bg = $list_colour_b; }
$area_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_areas` WHERE `device_id` = '".$device['device_id']."'"),0);
$port_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = '".$device['device_id']."'"),0);
$query = "SELECT * FROM ipv4_addresses AS A, ports AS I WHERE ";
$query .= "(A.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND I.interface_id = A.interface_id)";
$query .= " AND I.device_id = '".$device['device_id']."'";
$ipv4_host = mysql_fetch_assoc(mysql_query($query));
if ($instance['ospfAdminStat'] == "enabled") { $enabled = '<span style="color: #00aa00">enabled</span>'; } else { $enabled = '<span style="color: #aaaaaa">disabled</span>'; }
if ($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = '<span style="color: #00aa00">yes</span>'; } else { $abr = '<span style="color: #aaaaaa">no</span>'; }
if ($instance['ospfASBdrRtrStatus'] == "true") { $asbr = '<span style="color: #00aa00">yes</span>'; } else { $asbr = '<span style="color: #aaaaaa">no</span>'; }
echo('<tr><th>Router Id</th><th>Status</th><th>ABR</th><th>ASBR</th><th>Areas</th><th>Ports</th><th>Neighbours</th></tr>');
echo('<tr bgcolor="'.$instance_bg.'">');
echo(' <td class="list-large">'.$instance['ospfRouterId'] . '</td>');
echo(' <td>' . $enabled . '</td>');
echo(' <td>' . $abr . '</td>');
echo(' <td>' . $asbr . '</td>');
echo(' <td>' . $area_count . '</td>');
echo(' <td>' . $port_count . '</td>');
echo(' <td>' . ($neighbour_count+0) . '</td>');
echo('</tr>');
$i_i++;
} ### End loop instances
echo('</table>');
?>