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:
@@ -14,11 +14,12 @@ if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $l
|
||||
if ($interface['ifInErrors_delta'] > 0 || $interface['ifOutErrors_delta'] > 0)
|
||||
{
|
||||
$error_img = generate_port_link($interface,"<img src='images/16/chart_curve_error.png' alt='Interface Errors' border=0>","port_errors");
|
||||
} else { $error_img = ""; }
|
||||
} else {
|
||||
$error_img = "";
|
||||
}
|
||||
|
||||
# FIXME leading slash - does javascript honor base tag?
|
||||
echo("<tr style=\"background-color: $row_colour; padding: 5px;\" valign=top onmouseover=\"this.style.backgroundColor='$list_highlight';\" onmouseout=\"this.style.backgroundColor='$row_colour';\"
|
||||
onclick=\"location.href='/device/".$device['device_id']."/port/".$interface['interface_id']."/'\" style='cursor: pointer;'>
|
||||
onclick=\"location.href='device/".$device['device_id']."/port/".$interface['interface_id']."/'\" style='cursor: pointer;'>
|
||||
<td valign=top width=350>");
|
||||
echo(" <span class=list-large>
|
||||
" . generate_port_link($interface, $interface['ifIndex'] . ". ".$interface['label']) . "
|
||||
@@ -30,17 +31,15 @@ unset ($break);
|
||||
if ($port_details)
|
||||
{
|
||||
$ipdata = mysql_query("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
|
||||
while ($ip = mysql_fetch_Array($ipdata))
|
||||
while ($ip = mysql_fetch_assoc($ipdata))
|
||||
{
|
||||
# FIXME leading slash - does javascript honor base tag?
|
||||
echo("$break <a class=interface-desc href=\"javascript:popUp('/netcmd.php?cmd=whois&query=$ip[ipv4_address]')\">$ip[ipv4_address]/$ip[ipv4_prefixlen]</a>");
|
||||
echo("$break <a class=interface-desc href=\"javascript:popUp('netcmd.php?cmd=whois&query=".$ip['ipv4_address']."')\">".$ip['ipv4_address']."/".$ip['ipv4_prefixlen']."</a>");
|
||||
$break = ",";
|
||||
}
|
||||
$ip6data = mysql_query("SELECT * FROM `ipv6_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
|
||||
while ($ip6 = mysql_fetch_Array($ip6data))
|
||||
while ($ip6 = mysql_fetch_assoc($ip6data))
|
||||
{
|
||||
# FIXME leading slash - does javascript honor base tag?
|
||||
echo("$break <a class=interface-desc href=\"javascript:popUp('/netcmd.php?cmd=whois&query=".$ip6['ipv6_address']."')\">".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen']."</a>");
|
||||
echo("$break <a class=interface-desc href=\"javascript:popUp('netcmd.php?cmd=whois&query=".$ip6['ipv6_address']."')\">".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen']."</a>");
|
||||
$break = ",";
|
||||
}
|
||||
}
|
||||
@@ -141,7 +140,6 @@ if ($graph_type && is_file($graph_file))
|
||||
onmouseout=\"return nd();\"> <img src='$yearly_traffic' border=0></a>");
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -87,15 +87,16 @@ if ($updated && $update_message)
|
||||
<select name="type">
|
||||
<?php
|
||||
$unknown = 1;
|
||||
foreach ($device_types as $type)
|
||||
|
||||
foreach ($config['device_types'] as $type)
|
||||
{
|
||||
echo(' <option value="'.$type.'"');
|
||||
if ($device['type'] == $type)
|
||||
echo(' <option value="'.$type['type'].'"');
|
||||
if ($device['type'] == $type['type'])
|
||||
{
|
||||
echo('selected="1"');
|
||||
echo(' selected="1"');
|
||||
$unknown = 0;
|
||||
}
|
||||
echo(' >' . ucfirst($type) . '</option>');
|
||||
echo(' >' . ucfirst($type['type']) . '</option>');
|
||||
}
|
||||
if ($unknown)
|
||||
{
|
||||
|
@@ -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);
|
||||
@@ -73,17 +71,21 @@ 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>');
|
||||
@@ -95,12 +97,12 @@ while($instance = mysql_fetch_assoc($query))
|
||||
|
||||
$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>');
|
||||
|
@@ -21,7 +21,6 @@ echo("<span style='font-weight: bold;'>Routing</span> » ");
|
||||
unset($sep);
|
||||
foreach ($datas as $type)
|
||||
{
|
||||
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
|
||||
echo($sep);
|
||||
|
@@ -142,14 +142,12 @@ else
|
||||
$afi = $afisafi['afi'];
|
||||
$safi = $afisafi['safi'];
|
||||
$this_afisafi = $afi.$safi;
|
||||
#$peer['afi'] .= $sep . $config['afi'][$afi][$safi]; ##### CLEAN ME UP, I AM MESSY AND I SMELL OF CHEESE! FIXME!
|
||||
$peer['afi'] .= $sep . $afi .".".$safi;
|
||||
$sep = "<br />";
|
||||
$peer['afisafi'][$this_afisafi] = 1; ## Build a list of valid AFI/SAFI for this peer
|
||||
}
|
||||
unset($sep);
|
||||
|
||||
|
||||
echo(" <td></td>
|
||||
<td width=150>" . $localaddresslink . "<br />".generate_device_link($peer, shorthost($peer['hostname']), 'routing/bgp/')."</td>
|
||||
<td width=30><b>»</b></td>
|
||||
|
@@ -10,9 +10,8 @@ echo('<tr><th>Device</th><th>Router Id</th><th>Status</th><th>ABR</th><th>ASBR</
|
||||
|
||||
#### 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; }
|
||||
|
||||
$device = device_by_id_cache($instance['device_id']);
|
||||
@@ -26,9 +25,9 @@ while($instance = mysql_fetch_assoc($query))
|
||||
$ip_query .= " AND I.device_id = '".$device['device_id']."'";
|
||||
$ipv4_host = mysql_fetch_assoc(mysql_query($ip_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 bgcolor="'.$instance_bg.'">');
|
||||
echo(' <td class="list-large">'.generate_device_link($device, 0, "routing/ospf/"). '</td>');
|
||||
@@ -42,7 +41,6 @@ while($instance = mysql_fetch_assoc($query))
|
||||
echo('</tr>');
|
||||
|
||||
$i_i++;
|
||||
|
||||
} ### End loop instances
|
||||
|
||||
echo('</table>');
|
||||
|
@@ -137,7 +137,7 @@ else
|
||||
{
|
||||
$afi = $peer_afi['afi'];
|
||||
$safi = $peer_afi['safi'];
|
||||
if ($debug) { echo("$afi $safi". $config['afi'][$afi][$safi]. "\n"); }
|
||||
if ($debug) { echo("$afi $safi\n"); }
|
||||
|
||||
if ($device['os_group'] == "ios")
|
||||
{
|
||||
|
@@ -6,14 +6,6 @@
|
||||
# YES, THAT MEANS YOU #
|
||||
#########################################################
|
||||
|
||||
## AFI / SAFI pairs for BGP (and other stuff, perhaps)
|
||||
$config['afi']['ipv4']['unicast'] = "IPv4";
|
||||
$config['afi']['ipv4']['multiicast'] = "IPv4 Multicast";
|
||||
$config['afi']['ipv4']['vpn'] = "VPNv4";
|
||||
$config['afi']['ipv6']['unicast'] = "IPv6";
|
||||
$config['afi']['ipv6']['multicast'] = "IPv6 Multicast";
|
||||
$config['afi']['ipv4']['vpn'] = "VPNv6";
|
||||
|
||||
$config['os']['default']['over'][0]['graph'] = "device_processor";
|
||||
$config['os']['default']['over'][0]['text'] = "Processor Usage";
|
||||
$config['os']['default']['over'][1]['graph'] = "device_mempool";
|
||||
@@ -23,7 +15,6 @@ $os_group = "unix";
|
||||
$config['os_group'][$os_group]['type'] = "server";
|
||||
$config['os_group'][$os_group]['processor_stacked'] = 1;
|
||||
|
||||
|
||||
$os = "generic";
|
||||
$config['os'][$os]['text'] = "Generic Device";
|
||||
|
||||
@@ -714,7 +705,8 @@ $config['os'][$os]['icon'] = "tripplite";
|
||||
|
||||
foreach($config['os'] as $this_os => $blah)
|
||||
{
|
||||
if (isset($config['os'][$this_os]['group'])){
|
||||
if (isset($config['os'][$this_os]['group']))
|
||||
{
|
||||
$this_os_group = $config['os'][$this_os]['group'];
|
||||
if (isset($config['os_group'][$this_os_group]))
|
||||
{
|
||||
@@ -729,8 +721,6 @@ foreach($config['os'] as $this_os => $blah)
|
||||
}
|
||||
}
|
||||
|
||||
$device_types = array('server', 'network', 'firewall', 'workstation', 'printer', 'power', 'environment');
|
||||
|
||||
### Graph Types
|
||||
|
||||
$config['graph_sections'] = array('system', 'firewall', 'netstats', 'wireless', 'storage');
|
||||
@@ -887,7 +877,6 @@ if (isset($config['enable_printers']) && $config['enable_printers'])
|
||||
}
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
# No changes below this line #
|
||||
##############################
|
||||
|
Reference in New Issue
Block a user