Merge pull request #2967 from laf/issue-2870

This commit is contained in:
Søren Rosiak
2016-02-11 22:59:06 +01:00
+11 -3
View File
@@ -1,7 +1,16 @@
<?php
if ($config['enable_bgp']) {
foreach (dbFetchRows('SELECT * FROM bgpPeers WHERE device_id = ?', array($device['device_id'])) as $peer) {
$peers = dbFetchRows('SELECT * FROM bgpPeers WHERE device_id = ?', array($device['device_id']));
if (!empty($peers)) {
if ($device['os'] != 'junos') {
$peer_data_check = snmpwalk_cache_oid($device, 'cbgpPeer2RemoteAs', array(), 'CISCO-BGP4-MIB', $config['mibdir']);
}
foreach ($peers as $peer) {
// Poll BGP Peer
$peer2 = false;
echo 'Checking BGP peer '.$peer['bgpPeerIdentifier'].' ';
@@ -9,8 +18,6 @@ if ($config['enable_bgp']) {
if (!empty($peer['bgpPeerIdentifier'])) {
if (!strstr($peer['bgpPeerIdentifier'], ':') || $device['os'] != 'junos') {
// v4 BGP4 MIB
// FIXME - needs moved to function
$peer_data_check = snmpwalk_cache_oid($device, 'cbgpPeer2RemoteAs', array(), 'CISCO-BGP4-MIB', $config['mibdir']);
if (count($peer_data_check) > 0) {
$peer2 = true;
}
@@ -308,3 +315,4 @@ if ($config['enable_bgp']) {
echo "\n";
} //end foreach
} //end if
} //end if