mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix a few Db* to Eloquent requests (#14278)
* Eloquent for 2 requests * Eloquent for 1 request * a few in Dell * Model * and more with timos * and more with timos * and firebrick * firebrick * one query instead of many * Should use collection get * Update timos.inc.php * Update dell-os10.inc.php * avoid changing timos as it breaks something * new try with timos * deps for BGP * revert deps for BGP * style * style * deps for BGP, 2nd try * typo * revert aos7 * fix create * firebricktests * firebrick * firebrick * cipsec-fix * cipsec * timos fix 100th time :) * ./scripts/save-test-data.php -m os,ports,processors,mempools,vrf,sensors,bgp-peers,mpls,ospf -o timos -v 7705 * remove timos from this PR Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -39,6 +39,7 @@ class LegacyModule implements Module
|
|||||||
/** @var array */
|
/** @var array */
|
||||||
private $module_deps = [
|
private $module_deps = [
|
||||||
'arp-table' => ['ports'],
|
'arp-table' => ['ports'],
|
||||||
|
'bgp-peers' => ['ports', 'vrf'],
|
||||||
'cisco-mac-accounting' => ['ports'],
|
'cisco-mac-accounting' => ['ports'],
|
||||||
'fdb-table' => ['ports', 'vlans'],
|
'fdb-table' => ['ports', 'vlans'],
|
||||||
'vlans' => ['ports'],
|
'vlans' => ['ports'],
|
||||||
|
@@ -35,7 +35,22 @@ class BgpPeer extends DeviceRelatedModel
|
|||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
protected $table = 'bgpPeers';
|
protected $table = 'bgpPeers';
|
||||||
protected $primaryKey = 'bgpPeer_id';
|
protected $primaryKey = 'bgpPeer_id';
|
||||||
|
protected $fillable = [
|
||||||
|
'vrf_id',
|
||||||
|
'bgpPeerIdentifier',
|
||||||
|
'bgpPeerRemoteAs',
|
||||||
|
'bgpPeerState',
|
||||||
|
'bgpPeerAdminStatus',
|
||||||
|
'bgpLocalAddr',
|
||||||
|
'bgpPeerRemoteAddr',
|
||||||
|
'bgpPeerInUpdates',
|
||||||
|
'bgpPeerOutUpdates',
|
||||||
|
'bgpPeerInTotalMessages',
|
||||||
|
'bgpPeerOutTotalMessages',
|
||||||
|
'bgpPeerFsmEstablishedTime',
|
||||||
|
'bgpPeerInUpdateElapsedTime',
|
||||||
|
'astext',
|
||||||
|
];
|
||||||
// ---- Query scopes ----
|
// ---- Query scopes ----
|
||||||
|
|
||||||
public function scopeInAlarm(Builder $query)
|
public function scopeInAlarm(Builder $query)
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
* @author LibreNMS Contributors
|
* @author LibreNMS Contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use App\Models\BgpPeer;
|
||||||
|
use App\Models\Vrf;
|
||||||
use LibreNMS\Config;
|
use LibreNMS\Config;
|
||||||
use LibreNMS\Util\IP;
|
use LibreNMS\Util\IP;
|
||||||
|
|
||||||
@@ -39,11 +41,11 @@ if (Config::get('enable_bgp')) {
|
|||||||
}
|
}
|
||||||
unset($bgpPeersCache);
|
unset($bgpPeersCache);
|
||||||
|
|
||||||
|
$vrfs = DeviceCache::getPrimary()->vrfs->pluck('vrf_id', 'vrf_oid');
|
||||||
|
|
||||||
foreach ($bgpPeers as $vrfInstance => $peer) {
|
foreach ($bgpPeers as $vrfInstance => $peer) {
|
||||||
$vrfId = dbFetchCell('SELECT vrf_id from `vrfs` WHERE vrf_oid = ?', [$vrfInstance]);
|
$vrfId = $vrfs->get($vrfInstance, 1); // According to the MIB
|
||||||
if (is_null($vrfId)) {
|
|
||||||
$vrfId = 1; // According to the MIB
|
|
||||||
}
|
|
||||||
foreach ($peer as $address => $value) {
|
foreach ($peer as $address => $value) {
|
||||||
// resolve AS number by DNS_TXT record
|
// resolve AS number by DNS_TXT record
|
||||||
$astext = get_astext($value['os10bgp4V2PeerRemoteAs']);
|
$astext = get_astext($value['os10bgp4V2PeerRemoteAs']);
|
||||||
@@ -52,9 +54,8 @@ if (Config::get('enable_bgp')) {
|
|||||||
// Setting it here avoids the code that resets it to null if not found in BGP4-MIB.
|
// Setting it here avoids the code that resets it to null if not found in BGP4-MIB.
|
||||||
$bgpLocalAs = $value['os10bgp4V2PeerLocalAs'];
|
$bgpLocalAs = $value['os10bgp4V2PeerLocalAs'];
|
||||||
|
|
||||||
if (dbFetchCell('SELECT count(*) FROM `bgpPeers` WHERE device_id = ? AND bgpPeerIdentifier = ? AND vrf_id = ?', [$device['device_id'], $address, $vrfId]) == 0) {
|
if (! DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->exists()) {
|
||||||
$row = [
|
$row = [
|
||||||
'device_id' => $device['device_id'],
|
|
||||||
'vrf_id' => $vrfId,
|
'vrf_id' => $vrfId,
|
||||||
'bgpPeerIdentifier' => $address,
|
'bgpPeerIdentifier' => $address,
|
||||||
'bgpPeerRemoteAs' => $value['os10bgp4V2PeerRemoteAs'],
|
'bgpPeerRemoteAs' => $value['os10bgp4V2PeerRemoteAs'],
|
||||||
@@ -70,7 +71,7 @@ if (Config::get('enable_bgp')) {
|
|||||||
'bgpPeerInUpdateElapsedTime' => 0,
|
'bgpPeerInUpdateElapsedTime' => 0,
|
||||||
'astext' => $astext,
|
'astext' => $astext,
|
||||||
];
|
];
|
||||||
dbInsert($row, 'bgpPeers');
|
DeviceCache::getPrimary()->bgppeers()->create($row);
|
||||||
|
|
||||||
if (Config::get('autodiscovery.bgp')) {
|
if (Config::get('autodiscovery.bgp')) {
|
||||||
$name = gethostbyaddr($address);
|
$name = gethostbyaddr($address);
|
||||||
@@ -78,7 +79,7 @@ if (Config::get('enable_bgp')) {
|
|||||||
}
|
}
|
||||||
echo '+';
|
echo '+';
|
||||||
} else {
|
} else {
|
||||||
dbUpdate(['bgpPeerRemoteAs' => $value['os10bgp4V2PeerRemoteAs'], 'astext' => $astext], 'bgpPeers', 'device_id = ? AND bgpPeerIdentifier = ? AND vrf_id = ?', [$device['device_id'], $address, $vrfId]);
|
BgpPeer::where('bgpPeerRemoteAs', $value['os10bgp4V2PeerRemoteAs'])->where('astext', $astext)->update(['bgpPeerIdentifier' => $address, 'device_id' => $device['device_id'], 'vrf_id' => $vrfId]);
|
||||||
echo '.';
|
echo '.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,8 +98,8 @@ if (Config::get('enable_bgp')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clean up peers
|
// clean up peers
|
||||||
if (dbFetchCell('SELECT count(*) FROM `vrfs` WHERE `device_id` = ?', [$device['device_id']]) == 0) {
|
if (Vrf::where('device_id', $device['device_id'])->count() == 0) {
|
||||||
$peers = dbFetchRows('SELECT `vrf_id`, `bgpPeerIdentifier` FROM `bgpPeers` WHERE `device_id` = ?', [$device['device_id']]);
|
$peers = BgpPeer::select('vrf_id', 'bgpPeerIdentifier')->where('device_id', $device['device_id']);
|
||||||
} else {
|
} else {
|
||||||
$peers = dbFetchRows('SELECT `B`.`vrf_id` AS `vrf_id`, `bgpPeerIdentifier` FROM `bgpPeers` AS B LEFT JOIN `vrfs` AS V ON `B`.`vrf_id` = `V`.`vrf_id` WHERE `B`.`device_id` = ?', [$device['device_id']]);
|
$peers = dbFetchRows('SELECT `B`.`vrf_id` AS `vrf_id`, `bgpPeerIdentifier` FROM `bgpPeers` AS B LEFT JOIN `vrfs` AS V ON `B`.`vrf_id` = `V`.`vrf_id` WHERE `B`.`device_id` = ?', [$device['device_id']]);
|
||||||
}
|
}
|
||||||
@@ -107,7 +108,7 @@ if (Config::get('enable_bgp')) {
|
|||||||
$address = $peer['bgpPeerIdentifier'];
|
$address = $peer['bgpPeerIdentifier'];
|
||||||
|
|
||||||
if (empty($bgpPeers[$vrfInstance][$address])) {
|
if (empty($bgpPeers[$vrfInstance][$address])) {
|
||||||
$deleted = dbDelete('bgpPeers', 'device_id = ? AND bgpPeerIdentifier = ? AND vrf_id = ?', [$device['device_id'], $address, $vrfId]);
|
$deleted = BgpPeer::where('device_id', $device['device_id'])->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->delete();
|
||||||
|
|
||||||
echo str_repeat('-', $deleted);
|
echo str_repeat('-', $deleted);
|
||||||
echo PHP_EOL;
|
echo PHP_EOL;
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
* @author Chris Malton (@cjsoftuk)
|
* @author Chris Malton (@cjsoftuk)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use App\Models\Vrf;
|
||||||
use LibreNMS\Config;
|
use LibreNMS\Config;
|
||||||
use LibreNMS\Util\IP;
|
use LibreNMS\Util\IP;
|
||||||
|
|
||||||
@@ -49,23 +50,22 @@ foreach ($bgpPeers as $vrfId => $vrf) {
|
|||||||
// Force to null to avoid 0s going to the DB instead of Nulls
|
// Force to null to avoid 0s going to the DB instead of Nulls
|
||||||
$vrfId = null;
|
$vrfId = null;
|
||||||
} else {
|
} else {
|
||||||
$checkVrf = ' AND vrf_id = ? ';
|
|
||||||
$vrfs = [
|
$vrfs = [
|
||||||
'vrf_oid' => 'firebrick.' . $vrfId,
|
'vrf_oid' => 'firebrick.' . $vrfId,
|
||||||
'vrf_name' => $vrfId,
|
'vrf_name' => $vrfId,
|
||||||
'device_id' => $device['device_id'],
|
'device_id' => $device['device_id'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (! dbFetchCell('SELECT COUNT(*) FROM vrfs WHERE device_id = ? AND `vrf_oid`=?', [$device['device_id'], $vrfs['vrf_oid']])) {
|
if (! DeviceCache::getPrimary()->vrfs()->where('vrf_oid', $vrfs['vrf_oid'])->exists()) {
|
||||||
|
//Should we insert a VRF here ? We are not in the VRF module !
|
||||||
dbInsert($vrfs, 'vrfs');
|
dbInsert($vrfs, 'vrfs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($vrf as $address => $value) {
|
foreach ($vrf as $address => $value) {
|
||||||
$bgpLocalAs = $value['fbBgpPeerLocalAS'] ?? $bgpLocalAs;
|
$bgpLocalAs = $value['fbBgpPeerLocalAS'] ?? $bgpLocalAs;
|
||||||
$astext = get_astext($value['fbBgpPeerRemoteAS']);
|
$astext = get_astext($value['fbBgpPeerRemoteAS']);
|
||||||
if (dbFetchCell('SELECT COUNT(*) from `bgpPeers` WHERE device_id = ? AND bgpPeerIdentifier = ? ' . $checkVrf, [$device['device_id'], $address, $vrfId]) < '1') {
|
if (! DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->exists()) {
|
||||||
$peers = [
|
$peers = [
|
||||||
'device_id' => $device['device_id'],
|
|
||||||
'vrf_id' => $vrfId,
|
'vrf_id' => $vrfId,
|
||||||
'bgpPeerIdentifier' => $address,
|
'bgpPeerIdentifier' => $address,
|
||||||
'bgpPeerRemoteAs' => $value['fbBgpPeerRemoteAS'],
|
'bgpPeerRemoteAs' => $value['fbBgpPeerRemoteAS'],
|
||||||
@@ -81,20 +81,30 @@ foreach ($bgpPeers as $vrfId => $vrf) {
|
|||||||
'bgpPeerInUpdateElapsedTime' => 0,
|
'bgpPeerInUpdateElapsedTime' => 0,
|
||||||
'astext' => $astext,
|
'astext' => $astext,
|
||||||
];
|
];
|
||||||
dbInsert($peers, 'bgpPeers');
|
|
||||||
|
DeviceCache::getPrimary()->bgppeers()->create($peers);
|
||||||
|
|
||||||
if (Config::get('autodiscovery.bgp')) {
|
if (Config::get('autodiscovery.bgp')) {
|
||||||
$name = gethostbyaddr($address);
|
$name = gethostbyaddr($address);
|
||||||
discover_new_device($name, $device, 'BGP');
|
discover_new_device($name, $device, 'BGP');
|
||||||
}
|
}
|
||||||
echo '+';
|
echo '+';
|
||||||
} else {
|
} else {
|
||||||
dbUpdate(['bgpPeerRemoteAs' => $value['fbBgpPeerRemoteAS'], 'astext' => $astext], 'bgpPeers', 'device_id = ? AND bgpPeerIdentifier = ? AND vrf_id = ?', [$device['device_id'], $address, $vrfId]);
|
$peers = [
|
||||||
|
'bgpPeerRemoteAs' => $value['fbBgpPeerRemoteAS'],
|
||||||
|
'astext' => $astext,
|
||||||
|
];
|
||||||
|
DeviceCache::getPrimary()->bgppeers()->update([
|
||||||
|
'bgpPeerIdentifier' => $address,
|
||||||
|
'vrf_id' => $vrfId,
|
||||||
|
],
|
||||||
|
$peers);
|
||||||
echo '.';
|
echo '.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// clean up peers
|
// clean up peers
|
||||||
$peers = dbFetchRows('SELECT `vrf_id`, `bgpPeerIdentifier` FROM `bgpPeers` WHERE `device_id` = ?', [$device['device_id']]);
|
$peers = DeviceCache::getPrimary()->bgppeers()->select('vrf_id', 'bgpPeerIdentifier');
|
||||||
foreach ($peers as $value) {
|
foreach ($peers as $value) {
|
||||||
$vrfId = $value['vrf_id'];
|
$vrfId = $value['vrf_id'];
|
||||||
$address = $value['bgpPeerIdentifier'];
|
$address = $value['bgpPeerIdentifier'];
|
||||||
@@ -102,7 +112,7 @@ foreach ($peers as $value) {
|
|||||||
// Cleanup code to deal with 0 vs Null in the DB
|
// Cleanup code to deal with 0 vs Null in the DB
|
||||||
if ($vrfId === 0) {
|
if ($vrfId === 0) {
|
||||||
// Database says it's table 0 - which is wrong. It should be "null" for global table
|
// Database says it's table 0 - which is wrong. It should be "null" for global table
|
||||||
$deleted = dbDelete('bgpPeers', 'device_id = ? AND bgpPeerIdentifier = ? AND vrf_id = ?', [$device['device_id'], $address, $vrfId]);
|
$deleted = DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->delete();
|
||||||
echo str_repeat('-', $deleted);
|
echo str_repeat('-', $deleted);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
@@ -110,11 +120,7 @@ foreach ($peers as $value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($bgpPeers[$testVrfId][$address])) {
|
if (empty($bgpPeers[$testVrfId][$address])) {
|
||||||
if ($vrfId === null) {
|
$deleted = DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->delete();
|
||||||
$deleted = dbDelete('bgpPeers', 'device_id = ? AND bgpPeerIdentifier = ? AND vrf_id IS NULL', [$device['device_id'], $address]);
|
|
||||||
} else {
|
|
||||||
$deleted = dbDelete('bgpPeers', 'device_id = ? AND bgpPeerIdentifier = ? AND vrf_id = ?', [$device['device_id'], $address, $vrfId]);
|
|
||||||
}
|
|
||||||
echo str_repeat('-', $deleted);
|
echo str_repeat('-', $deleted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
* @author PipoCanaja
|
* @author PipoCanaja
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use App\Models\BgpPeer;
|
||||||
use LibreNMS\Config;
|
use LibreNMS\Config;
|
||||||
use LibreNMS\Util\IP;
|
use LibreNMS\Util\IP;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ if (Config::get('enable_bgp')) {
|
|||||||
|
|
||||||
// So if we have HUAWEI BGP entries or if we don't have anything from HUAWEI nor BGP4-MIB
|
// So if we have HUAWEI BGP entries or if we don't have anything from HUAWEI nor BGP4-MIB
|
||||||
if (count($bgpPeersCache) > 0 || count($bgpPeersCache_ietf) == 0) {
|
if (count($bgpPeersCache) > 0 || count($bgpPeersCache_ietf) == 0) {
|
||||||
$vrfs = dbFetchRows('SELECT vrf_id, vrf_name from `vrfs` WHERE device_id = ?', [$device['device_id']]);
|
$vrfs = DeviceCache::getPrimary()->vrfs()->select('vrf_id', 'vrf_name');
|
||||||
foreach ($vrfs as $vrf) {
|
foreach ($vrfs as $vrf) {
|
||||||
$map_vrf['byId'][$vrf['vrf_id']]['vrf_name'] = $vrf['vrf_name'];
|
$map_vrf['byId'][$vrf['vrf_id']]['vrf_name'] = $vrf['vrf_name'];
|
||||||
$map_vrf['byName'][$vrf['vrf_name']]['vrf_id'] = $vrf['vrf_id'];
|
$map_vrf['byName'][$vrf['vrf_name']]['vrf_id'] = $vrf['vrf_id'];
|
||||||
@@ -88,7 +89,7 @@ if (Config::get('enable_bgp')) {
|
|||||||
|
|
||||||
foreach ($vrf as $address => $value) {
|
foreach ($vrf as $address => $value) {
|
||||||
$astext = get_astext($value['hwBgpPeerRemoteAs']);
|
$astext = get_astext($value['hwBgpPeerRemoteAs']);
|
||||||
if (dbFetchCell('SELECT COUNT(*) from `bgpPeers` WHERE device_id = ? AND bgpPeerIdentifier = ? ' . $checkVrf, [$device['device_id'], $address, $vrfId]) < '1') {
|
if (! DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->exists()) {
|
||||||
$peers = [
|
$peers = [
|
||||||
'device_id' => $device['device_id'],
|
'device_id' => $device['device_id'],
|
||||||
'vrf_id' => $vrfId,
|
'vrf_id' => $vrfId,
|
||||||
@@ -137,7 +138,7 @@ if (Config::get('enable_bgp')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// clean up peers
|
// clean up peers
|
||||||
$peers = dbFetchRows('SELECT `vrf_id`, `bgpPeerIdentifier` FROM `bgpPeers` WHERE `device_id` = ?', [$device['device_id']]);
|
$peers = DeviceCache::getPrimary()->bgppeers()->select('vrf_id', 'bgpPeerIdentifier');
|
||||||
foreach ($peers as $value) {
|
foreach ($peers as $value) {
|
||||||
$vrfId = $value['vrf_id'];
|
$vrfId = $value['vrf_id'];
|
||||||
$vrfName = $map_vrf['byId'][$vrfId]['vrf_name'];
|
$vrfName = $map_vrf['byId'][$vrfId]['vrf_name'];
|
||||||
@@ -148,7 +149,7 @@ if (Config::get('enable_bgp')) {
|
|||||||
if ((empty($vrfId) && empty($bgpPeers[''][$address])) ||
|
if ((empty($vrfId) && empty($bgpPeers[''][$address])) ||
|
||||||
(! empty($vrfId) && ! empty($vrfName) && empty($bgpPeers[$vrfName][$address])) ||
|
(! empty($vrfId) && ! empty($vrfName) && empty($bgpPeers[$vrfName][$address])) ||
|
||||||
(! empty($vrfId) && empty($vrfName))) {
|
(! empty($vrfId) && empty($vrfName))) {
|
||||||
$deleted = \App\Models\BgpPeer::where('device_id', $device['device_id'])
|
$deleted = BgpPeer::where('device_id', $device['device_id'])
|
||||||
->where('bgpPeerIdentifier', $address)
|
->where('bgpPeerIdentifier', $address)
|
||||||
->where('vrf_id', $vrfId)
|
->where('vrf_id', $vrfId)
|
||||||
->delete();
|
->delete();
|
||||||
|
@@ -3525,7 +3525,6 @@
|
|||||||
{
|
{
|
||||||
"peer_port": 0,
|
"peer_port": 0,
|
||||||
"peer_addr": "<private>",
|
"peer_addr": "<private>",
|
||||||
"local_addr": "<private>",
|
|
||||||
"local_port": 0,
|
"local_port": 0,
|
||||||
"tunnel_name": "<private>",
|
"tunnel_name": "<private>",
|
||||||
"tunnel_status": ""
|
"tunnel_status": ""
|
||||||
|
@@ -10,11 +10,11 @@
|
|||||||
"version": "V1.55.126",
|
"version": "V1.55.126",
|
||||||
"hardware": "FB2901",
|
"hardware": "FB2901",
|
||||||
"features": null,
|
"features": null,
|
||||||
|
"location": "<private>",
|
||||||
"os": "firebrick",
|
"os": "firebrick",
|
||||||
"type": "network",
|
"type": "network",
|
||||||
"serial": null,
|
"serial": null,
|
||||||
"icon": "firebrick.svg",
|
"icon": "firebrick.svg"
|
||||||
"location": "<private>"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@@ -10,11 +10,11 @@
|
|||||||
"version": "V1.56.000D29",
|
"version": "V1.56.000D29",
|
||||||
"hardware": "FB6010",
|
"hardware": "FB6010",
|
||||||
"features": null,
|
"features": null,
|
||||||
|
"location": "<private>",
|
||||||
"os": "firebrick",
|
"os": "firebrick",
|
||||||
"type": "network",
|
"type": "network",
|
||||||
"serial": null,
|
"serial": null,
|
||||||
"icon": "firebrick.svg",
|
"icon": "firebrick.svg"
|
||||||
"location": "<private>"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -1819,6 +1819,7 @@
|
|||||||
"bgpPeerLastErrorCode": null,
|
"bgpPeerLastErrorCode": null,
|
||||||
"bgpPeerLastErrorSubCode": null,
|
"bgpPeerLastErrorSubCode": null,
|
||||||
"bgpPeerLastErrorText": null,
|
"bgpPeerLastErrorText": null,
|
||||||
|
"bgpPeerIface": null,
|
||||||
"bgpLocalAddr": "00 00 00 00",
|
"bgpLocalAddr": "00 00 00 00",
|
||||||
"bgpPeerRemoteAddr": "0A 02 03 04",
|
"bgpPeerRemoteAddr": "0A 02 03 04",
|
||||||
"bgpPeerDescr": "",
|
"bgpPeerDescr": "",
|
||||||
@@ -1830,8 +1831,7 @@
|
|||||||
"bgpPeerInUpdateElapsedTime": 0,
|
"bgpPeerInUpdateElapsedTime": 0,
|
||||||
"context_name": null,
|
"context_name": null,
|
||||||
"bgpLocalAs": 20712,
|
"bgpLocalAs": 20712,
|
||||||
"vrfLocalAs": null,
|
"vrfLocalAs": null
|
||||||
"bgpPeerIface": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
||||||
@@ -1842,6 +1842,7 @@
|
|||||||
"bgpPeerLastErrorCode": null,
|
"bgpPeerLastErrorCode": null,
|
||||||
"bgpPeerLastErrorSubCode": null,
|
"bgpPeerLastErrorSubCode": null,
|
||||||
"bgpPeerLastErrorText": null,
|
"bgpPeerLastErrorText": null,
|
||||||
|
"bgpPeerIface": null,
|
||||||
"bgpLocalAddr": "0A 02 03 06",
|
"bgpLocalAddr": "0A 02 03 06",
|
||||||
"bgpPeerRemoteAddr": "0A 02 03 05",
|
"bgpPeerRemoteAddr": "0A 02 03 05",
|
||||||
"bgpPeerDescr": "",
|
"bgpPeerDescr": "",
|
||||||
@@ -1853,8 +1854,7 @@
|
|||||||
"bgpPeerInUpdateElapsedTime": 0,
|
"bgpPeerInUpdateElapsedTime": 0,
|
||||||
"context_name": null,
|
"context_name": null,
|
||||||
"bgpLocalAs": 20712,
|
"bgpLocalAs": 20712,
|
||||||
"vrfLocalAs": null,
|
"vrfLocalAs": null
|
||||||
"bgpPeerIface": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
||||||
@@ -1865,6 +1865,7 @@
|
|||||||
"bgpPeerLastErrorCode": null,
|
"bgpPeerLastErrorCode": null,
|
||||||
"bgpPeerLastErrorSubCode": null,
|
"bgpPeerLastErrorSubCode": null,
|
||||||
"bgpPeerLastErrorText": null,
|
"bgpPeerLastErrorText": null,
|
||||||
|
"bgpPeerIface": null,
|
||||||
"bgpLocalAddr": "FD 01 08 B0 00 00 00 FB 00 00 00 00 00 00 00 02",
|
"bgpLocalAddr": "FD 01 08 B0 00 00 00 FB 00 00 00 00 00 00 00 02",
|
||||||
"bgpPeerRemoteAddr": "FD 01 08 B0 00 00 00 FB 00 00 00 00 00 00 00 01",
|
"bgpPeerRemoteAddr": "FD 01 08 B0 00 00 00 FB 00 00 00 00 00 00 00 01",
|
||||||
"bgpPeerDescr": "",
|
"bgpPeerDescr": "",
|
||||||
@@ -1876,8 +1877,7 @@
|
|||||||
"bgpPeerInUpdateElapsedTime": 0,
|
"bgpPeerInUpdateElapsedTime": 0,
|
||||||
"context_name": null,
|
"context_name": null,
|
||||||
"bgpLocalAs": 20712,
|
"bgpLocalAs": 20712,
|
||||||
"vrfLocalAs": null,
|
"vrfLocalAs": null
|
||||||
"bgpPeerIface": null
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -1892,6 +1892,7 @@
|
|||||||
"bgpPeerLastErrorCode": null,
|
"bgpPeerLastErrorCode": null,
|
||||||
"bgpPeerLastErrorSubCode": null,
|
"bgpPeerLastErrorSubCode": null,
|
||||||
"bgpPeerLastErrorText": null,
|
"bgpPeerLastErrorText": null,
|
||||||
|
"bgpPeerIface": null,
|
||||||
"bgpLocalAddr": "0.0.0.0",
|
"bgpLocalAddr": "0.0.0.0",
|
||||||
"bgpPeerRemoteAddr": "10.2.3.4",
|
"bgpPeerRemoteAddr": "10.2.3.4",
|
||||||
"bgpPeerDescr": "",
|
"bgpPeerDescr": "",
|
||||||
@@ -1903,8 +1904,7 @@
|
|||||||
"bgpPeerInUpdateElapsedTime": 0,
|
"bgpPeerInUpdateElapsedTime": 0,
|
||||||
"context_name": null,
|
"context_name": null,
|
||||||
"bgpLocalAs": 20712,
|
"bgpLocalAs": 20712,
|
||||||
"vrfLocalAs": null,
|
"vrfLocalAs": null
|
||||||
"bgpPeerIface": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
||||||
@@ -1915,6 +1915,7 @@
|
|||||||
"bgpPeerLastErrorCode": null,
|
"bgpPeerLastErrorCode": null,
|
||||||
"bgpPeerLastErrorSubCode": null,
|
"bgpPeerLastErrorSubCode": null,
|
||||||
"bgpPeerLastErrorText": null,
|
"bgpPeerLastErrorText": null,
|
||||||
|
"bgpPeerIface": null,
|
||||||
"bgpLocalAddr": "10.2.3.6",
|
"bgpLocalAddr": "10.2.3.6",
|
||||||
"bgpPeerRemoteAddr": "10.2.3.5",
|
"bgpPeerRemoteAddr": "10.2.3.5",
|
||||||
"bgpPeerDescr": "",
|
"bgpPeerDescr": "",
|
||||||
@@ -1926,8 +1927,7 @@
|
|||||||
"bgpPeerInUpdateElapsedTime": 0,
|
"bgpPeerInUpdateElapsedTime": 0,
|
||||||
"context_name": null,
|
"context_name": null,
|
||||||
"bgpLocalAs": 20712,
|
"bgpLocalAs": 20712,
|
||||||
"vrfLocalAs": null,
|
"vrfLocalAs": null
|
||||||
"bgpPeerIface": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
"astext": "AS20712 Andrews & Arnold Ltd, GB",
|
||||||
@@ -1938,6 +1938,7 @@
|
|||||||
"bgpPeerLastErrorCode": null,
|
"bgpPeerLastErrorCode": null,
|
||||||
"bgpPeerLastErrorSubCode": null,
|
"bgpPeerLastErrorSubCode": null,
|
||||||
"bgpPeerLastErrorText": null,
|
"bgpPeerLastErrorText": null,
|
||||||
|
"bgpPeerIface": null,
|
||||||
"bgpLocalAddr": "fd01:08b0:0000:00fb:0000:0000:0000:0002",
|
"bgpLocalAddr": "fd01:08b0:0000:00fb:0000:0000:0000:0002",
|
||||||
"bgpPeerRemoteAddr": "fd01:8b0:0:fb::1",
|
"bgpPeerRemoteAddr": "fd01:8b0:0:fb::1",
|
||||||
"bgpPeerDescr": "",
|
"bgpPeerDescr": "",
|
||||||
@@ -1949,8 +1950,7 @@
|
|||||||
"bgpPeerInUpdateElapsedTime": 0,
|
"bgpPeerInUpdateElapsedTime": 0,
|
||||||
"context_name": null,
|
"context_name": null,
|
||||||
"bgpLocalAs": 20712,
|
"bgpLocalAs": 20712,
|
||||||
"vrfLocalAs": null,
|
"vrfLocalAs": null
|
||||||
"bgpPeerIface": null
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1961,7 +1961,6 @@
|
|||||||
{
|
{
|
||||||
"peer_port": 0,
|
"peer_port": 0,
|
||||||
"peer_addr": "0.0.0.0",
|
"peer_addr": "0.0.0.0",
|
||||||
"local_addr": "127.1.6.2",
|
|
||||||
"local_port": 0,
|
"local_port": 0,
|
||||||
"tunnel_name": "House",
|
"tunnel_name": "House",
|
||||||
"tunnel_status": "waiting"
|
"tunnel_status": "waiting"
|
||||||
@@ -1969,12 +1968,25 @@
|
|||||||
{
|
{
|
||||||
"peer_port": 0,
|
"peer_port": 0,
|
||||||
"peer_addr": "10.2.3.4",
|
"peer_addr": "10.2.3.4",
|
||||||
"local_addr": "127.1.6.2",
|
|
||||||
"local_port": 0,
|
"local_port": 0,
|
||||||
"tunnel_name": "ToToothless",
|
"tunnel_name": "ToToothless",
|
||||||
"tunnel_status": "waiting"
|
"tunnel_status": "waiting"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"vrf": {
|
||||||
|
"discovery": {
|
||||||
|
"vrfs": [
|
||||||
|
{
|
||||||
|
"vrf_oid": "firebrick.44",
|
||||||
|
"vrf_name": "44",
|
||||||
|
"bgpLocalAs": null,
|
||||||
|
"mplsVpnVrfRouteDistinguisher": null,
|
||||||
|
"mplsVpnVrfDescription": "",
|
||||||
|
"ifIndices": null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,7 @@ ports:
|
|||||||
order_by: ports.ifIndex, ports.ifDescr, ports.ifName
|
order_by: ports.ifIndex, ports.ifDescr, ports.ifName
|
||||||
cipsec-tunnels:
|
cipsec-tunnels:
|
||||||
ipsec_tunnels:
|
ipsec_tunnels:
|
||||||
excluded_fields: [tunnel_id, device_id]
|
excluded_fields: [local_addr, tunnel_id, device_id]
|
||||||
order_by: peer_addr
|
order_by: peer_addr
|
||||||
cisco-pw:
|
cisco-pw:
|
||||||
pseudowires:
|
pseudowires:
|
||||||
|
Reference in New Issue
Block a user