mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
cleanups etc
git-svn-id: http://www.observium.org/svn/observer/trunk@2213 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -9,9 +9,8 @@ echo('<table width=100% border=0 cellpadding=5>');
|
||||
|
||||
#### Loop Instances
|
||||
|
||||
while($instance = mysql_fetch_assoc($query))
|
||||
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);
|
||||
@@ -25,9 +24,9 @@ while($instance = mysql_fetch_assoc($query))
|
||||
$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>'; }
|
||||
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.'">');
|
||||
@@ -49,9 +48,8 @@ while($instance = mysql_fetch_assoc($query))
|
||||
$i_a = 0;
|
||||
$a_sql = "SELECT * FROM `ospf_areas` WHERE `device_id` = '".$device['device_id']."'";
|
||||
$a_query = mysql_query($a_sql);
|
||||
while($area = mysql_fetch_assoc($a_query))
|
||||
while ($area = mysql_fetch_assoc($a_query))
|
||||
{
|
||||
|
||||
if (!is_integer($i_a/2)) { $area_bg = $list_colour_b_a; } else { $area_bg = $list_colour_b_b; }
|
||||
|
||||
$area_port_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = '".$device['device_id']."' AND `ospfIfAreaId` = '".$area['ospfAreaId']."'"),0);
|
||||
@@ -62,7 +60,7 @@ while($instance = mysql_fetch_assoc($query))
|
||||
echo(' <td class="list-large">'.$area['ospfAreaId'] . '</td>');
|
||||
echo(' <td>' . $enabled . '</td>');
|
||||
echo(' <td>' . $area_port_count . '('.$area_port_count_enabled.')</td>');
|
||||
echo('</tr>');
|
||||
echo('</tr>');
|
||||
|
||||
echo('<tr bgcolor="'.$area_bg.'">');
|
||||
echo('<td colspan=7>');
|
||||
@@ -73,34 +71,38 @@ while($instance = mysql_fetch_assoc($query))
|
||||
$i_p = $i_a + 1;
|
||||
$p_sql = "SELECT * FROM `ospf_ports` AS O, `ports` AS P WHERE O.`ospfIfAdminStat` = 'enabled' AND O.`device_id` = '".$device['device_id']."' AND O.`ospfIfAreaId` = '".$area['ospfAreaId']."' AND P.interface_id = O.interface_id";
|
||||
$p_query = mysql_query($p_sql);
|
||||
while($ospfport = mysql_fetch_assoc($p_query))
|
||||
while ($ospfport = mysql_fetch_assoc($p_query))
|
||||
{
|
||||
|
||||
if (!is_integer($i_a/2)) {
|
||||
if (!is_integer($i_a/2))
|
||||
{
|
||||
if (!is_integer($i_p/2)) { $port_bg = $list_colour_b_b; } else { $port_bg = $list_colour_b_a; }
|
||||
} else {
|
||||
if (!is_integer($i_p/2)) { $port_bg = $list_colour_a_b; } else { $port_bg = $list_colour_a_a; }
|
||||
}
|
||||
|
||||
if ($ospfport['ospfIfAdminStat'] == "enabled")
|
||||
{
|
||||
$port_enabled = '<span style="color: #00aa00">enabled</span>';
|
||||
} else {
|
||||
$port_enabled = '<span style="color: #aaaaaa">disabled</span>';
|
||||
}
|
||||
|
||||
if($ospfport['ospfIfAdminStat'] == "enabled") { $port_enabled = '<span style="color: #00aa00">enabled</span>'; } else { $port_enabled = '<span style="color: #aaaaaa">disabled</span>'; }
|
||||
|
||||
echo('<tr bgcolor="'.$port_bg.'">');
|
||||
echo(' <td width=15></td>');
|
||||
echo(' <td><strong>'. generate_port_link($ospfport) . '</strong></td>');
|
||||
echo(' <td>' . $port_enabled . '</td>');
|
||||
echo(' <td>' . $ospfport['ospfIfType'] . '</td>');
|
||||
echo(' <td>' . $ospfport['ospfIfState'] . '</td>');
|
||||
echo('</tr>');
|
||||
echo('</tr>');
|
||||
|
||||
$i_p++;
|
||||
}
|
||||
|
||||
echo('</table>');
|
||||
echo('</td>');
|
||||
echo('</tr>');
|
||||
|
||||
$i_a++;
|
||||
|
||||
} ### End loop areas
|
||||
|
||||
echo('</table>');
|
||||
@@ -108,7 +110,6 @@ while($instance = mysql_fetch_assoc($query))
|
||||
echo('</tr>');
|
||||
|
||||
$i_i++;
|
||||
|
||||
} ### End loop instances
|
||||
|
||||
echo('</table>');
|
||||
|
@@ -9,9 +9,8 @@ echo('<table width=100%>');
|
||||
|
||||
#### Loop Instances
|
||||
|
||||
while($instance = mysql_fetch_assoc($query))
|
||||
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);
|
||||
@@ -22,9 +21,9 @@ while($instance = mysql_fetch_assoc($query))
|
||||
$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>'; }
|
||||
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.'">');
|
||||
@@ -37,9 +36,7 @@ while($instance = mysql_fetch_assoc($query))
|
||||
echo(' <td>' . ($neighbour_count+0) . '</td>');
|
||||
echo('</tr>');
|
||||
|
||||
|
||||
$i_i++;
|
||||
|
||||
} ### End loop instances
|
||||
|
||||
echo('</table>');
|
||||
|
Reference in New Issue
Block a user