mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
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:
@@ -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");
|
||||
|
||||
?>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user