updates and fixes to BGP graphs

git-svn-id: http://www.observium.org/svn/observer/trunk@438 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-06-10 05:42:48 +00:00
parent c05434abd8
commit 663a2e7729
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -55,6 +55,7 @@ echo("
<img src='images/16/arrow_up.png' align=absmiddle> " . $peer['bgpPeerOutUpdates'] . "</td></tr>");
if ($_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]) {
@@ -76,10 +77,10 @@ echo("
if ($_GET['opta'] == "macaccounting") {
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ipv4_mac` AS I, mac_accounting AS M WHERE I.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND M.mac = I.mac_address"),0)) {
$acc = mysql_fetch_array(mysql_query("SELECT * FROM `ipv4_mac` AS I, mac_accounting AS M WHERE I.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND M.mac = I.mac_address"));
$graph_type = "mac_acc";
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/mac-accounting/" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd";
if ( is_file($database) ) {
$daily_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$day&to=$now&width=210&height=100";
$daily_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
@@ -105,9 +106,12 @@ echo("
echo("</td></tr>");
}
}
}
}
}
$i++;
}
echo("</table></div>");
+1 -1
View File
@@ -31,7 +31,7 @@
}
$vrf_id = @mysql_result(mysql_query("SELECT vrf_id FROM vrfs WHERE `device_id` = '".$device['device_id']."' AND `vrf_oid`='".$vrf['oid']."'"),0);
$valid_vrf[$vrf_id] = 1;
echo("\nRD:".$vrf['mplsVpnVrfRouteDistinguisher']." ".$vrf['mplsVpnVrfDescription']." ");
echo("\nRD:".$vrf['mplsVpnVrfRouteDistinguisher']." ".$vrf['name']." ".$vrf['mplsVpnVrfDescription']." ");
$interfaces_oid = ".1.3.6.1.3.118.1.2.1.1.2." . $vrf['oid'];
$interfaces = shell_exec($config['snmpwalk'] . " -m MPLS-VPN-MIB -CI -Ln -Osqn -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " $interfaces_oid");
$interfaces = trim(str_replace($interfaces_oid . ".", "", $interfaces));