mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix BGP graphs
git-svn-id: http://www.observium.org/svn/observer/trunk@1600 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if(is_numeric($id))
|
||||
{
|
||||
|
||||
$data = mysql_fetch_assoc(mysql_query("SELECT * FROM bgpPeers WHERE bgpPeer_id = '".$id."'"));
|
||||
|
||||
if(is_numeric($data['device_id']) && device_permitted($data['device_id']))
|
||||
{
|
||||
$device = device_by_id_cache($data['device_id']);
|
||||
|
||||
$title = generatedevicelink($device);
|
||||
$title .= " :: BGP :: " . htmlentities($data['bgp_peerid']);
|
||||
$auth = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -4,9 +4,7 @@ include("includes/graphs/common.inc.php");
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$data = mysql_fetch_array(mysql_query("SELECT * FROM bgpPeers AS B, devices AS D WHERE bgpPeer_id = '".$_GET['peer']."' AND D.device_id = B.device_id"));
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $data['hostname'] . "/". safename("cbgp-" . $data['bgpPeerIdentifier'] . ".".$_GET['afi'].".".$_GET['safi'].".rrd");
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/". safename("cbgp-" . $data['bgpPeerIdentifier'] . ".".$_GET['afi'].".".$_GET['safi'].".rrd");
|
||||
|
||||
$rra = "AcceptedPrefixes";
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$data = mysql_fetch_array(mysql_query("SELECT * FROM bgpPeers AS B, devices AS D WHERE bgpPeer_id = '".$_GET['peer']."' AND D.device_id = B.device_id"));
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $data['hostname'] . "/" . safename("bgp-" . $data['bgpPeerIdentifier'] . ".rrd");
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("bgp-" . $data['bgpPeerIdentifier'] . ".rrd");
|
||||
|
||||
$rra_in = "bgpPeerInUpdates";
|
||||
$rra_out = "bgpPeerOutUpdates";
|
||||
|
||||
@@ -9,7 +9,7 @@ print_optionbar_start();
|
||||
echo("
|
||||
<div style='margin: auto; text-align: left; padding-left: 11px; clear: both; display:block; height:20px;'>
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/'>No Graphs</a> |
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/bgp_updates/'>Updates</a> | Prefixes:
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/updates/'>Updates</a> | Prefixes:
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/cbgp_prefixes/ipv4.unicast/'>IPv4</a> |
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/cbgp_prefixes/ipv4.vpn/'>VPNv4</a> |
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/cbgp_prefixes/ipv6.unicast/'>IPv6</a>
|
||||
@@ -85,15 +85,15 @@ print_optionbar_end();
|
||||
if (isset($_GET['opta']) && $_GET['opta'] != "macaccounting") {
|
||||
foreach(explode(" ", $_GET['opta']) as $graph_type) {
|
||||
if($graph_type == "cbgp_prefixes") { list($afi, $safi) = explode(".", $_GET['optb']); $afisafi = "&afi=$afi&safi=$safi"; }
|
||||
if($graph_type == "bgp_updates" || $valid_afi_safi[$afi][$safi]) {
|
||||
$daily_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$day&to=$now&width=210&height=100$afisafi";
|
||||
$daily_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150$afisafi";
|
||||
$weekly_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$week&to=$now&width=210&height=100$afisafi";
|
||||
$weekly_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150$afisafi";
|
||||
$monthly_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$month&to=$now&width=210&height=100$afisafi";
|
||||
$monthly_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150$afisafi";
|
||||
$yearly_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$year&to=$now&width=210&height=100$afisafi";
|
||||
$yearly_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150$afisafi";
|
||||
if($graph_type == "updates" || $valid_afi_safi[$afi][$safi]) {
|
||||
$daily_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$day&to=$now&width=210&height=100$afisafi";
|
||||
$daily_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$day&to=$now&width=500&height=150$afisafi";
|
||||
$weekly_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$week&to=$now&width=210&height=100$afisafi";
|
||||
$weekly_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$week&to=$now&width=500&height=150$afisafi";
|
||||
$monthly_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$month&to=$now&width=210&height=100$afisafi";
|
||||
$monthly_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$month&to=$now&width=500&height=150$afisafi";
|
||||
$yearly_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$year&to=$now&width=210&height=100$afisafi";
|
||||
$yearly_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$year&to=$now&width=500&height=150$afisafi";
|
||||
echo("<tr bgcolor=$bg_colour><td colspan=7>");
|
||||
echo("<a href='' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"><img src='$daily_traffic' border=0></a> ");
|
||||
echo("<a href='' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"><img src='$weekly_traffic' border=0></a> ");
|
||||
|
||||
Reference in New Issue
Block a user