fixed bgp consolidation code

git-svn-id: http://www.observium.org/svn/observer/trunk@651 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-01-09 23:28:06 +00:00
parent 0d1f33224f
commit c9793a9b40
2 changed files with 43 additions and 38 deletions
+7 -2
View File
@@ -60,8 +60,10 @@
## Process disovered peers
foreach ($peerlist as $peer)
if (isset($peerlist))
{
foreach ($peerlist as $peer)
{
$astext = get_astext($peer['as']);
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `bgpPeers` WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['ip']."'"),0) < '1')
@@ -105,7 +107,8 @@ foreach ($peerlist as $peer)
}
} # AF list
} # if os = ios
} # Foreach
} # Foreach
} # isset
## Delete removed peers
@@ -127,6 +130,8 @@ while ($entry = mysql_fetch_array($query)) {
}
}
unset($peerlist);
echo("\n");
?>
+1 -1
View File
@@ -51,7 +51,7 @@ if ($device['os'] == "junos")
$peer_cmd .= " jnxBgpM2PeerFsmEstablishedTime.0.ipv6." . $junos_v6[$peer_ip];
$peer_cmd .= " jnxBgpM2PeerInUpdatesElapsedTime.0.ipv6." . $junos_v6[$peer_ip];
$peer_cmd .= " jnxBgpM2PeerLocalAddr.0.ipv6." . $junos_v6[$peer_ip];
$peer_data = trim(`$peer_cmd`);
$peer_data = trim(`$peer_cmd . '|grep -v "No Such Instance"'`);
if ($debug) echo "\n$peer_cmd\n";
list($bgpPeerState, $bgpPeerAdminStatus, $bgpPeerInUpdates, $bgpPeerOutUpdates, $bgpPeerInTotalMessages, $bgpPeerOutTotalMessages, $bgpPeerFsmEstablishedTime, $bgpPeerInUpdateElapsedTime, $bgpLocalAddr) = explode("\n", $peer_data);