MPLS Services (#10421)

* initial database migrations

* first part, discovery

* second part, polling

* add SAP polling and discovery

* style checks

* rename variables in more generic way

* html global pages for sdp and sdp binds

* add Services and SAPs

* port links, database, etc.

* html device routing pages

* add tests

* checks

* rework database id relationship

* scruntinizer inspection

* fix unit test for new mpls tables
This commit is contained in:
Vitali Kari
2019-07-28 06:11:04 +02:00
committed by Tony Murray
parent 60c538ad8c
commit 1de640c3aa
20 changed files with 6774 additions and 43 deletions

View File

@@ -41,14 +41,14 @@ trait SyncsModels
$models = $models->keyBy->getCompositeKey();
$existing = $device->$relationship->keyBy->getCompositeKey();
foreach ($existing as $key => $existing_lsp) {
if ($models->offsetExists($key)) {
foreach ($existing as $exist_key => $exist_value) {
if ($models->offsetExists($exist_key)) {
// update
$existing_lsp->fill($models->get($key)->getAttributes())->save();
$exist_value->fill($models->get($exist_key)->getAttributes())->save();
} else {
// delete
$existing_lsp->delete();
$existing->forget($key);
$exist_value->delete();
$existing->forget($exist_key);
}
}

View File

@@ -1,6 +1,6 @@
<?php
/**
* MplisDiscovery.php
* MplsDiscovery.php
*
* -Description-
*
@@ -39,4 +39,27 @@ interface MplsDiscovery
* @return Collection MplsLspPath objects
*/
public function discoverMplsPaths($lsps);
/**
* @return Collection MplsSdp objects
*/
public function discoverMplsSdps();
/**
* @return Collection MplsService objects
*/
public function discoverMplsServices();
/**
* @param Collection $svcs collecton of synchronized lsp objects from discoverMplsServices()
* @return Collection MplsSap objects
*/
public function discoverMplsSaps($svcs);
/**
* @param Collection $sdps collecton of synchronized sdp objects from discoverMplsSdps()
* @param Collection $svcs collecton of synchronized service objects from discoverMplsServices()
* @return Collection MplsSdpBind objects
*/
public function discoverMplsSdpBinds($sdps, $svcs);
}

View File

@@ -39,4 +39,27 @@ interface MplsPolling
* @return Collection MplsLspPath objects
*/
public function pollMplsPaths($lsps);
/**
* @return Collection MplsSdp objects
*/
public function pollMplsSdps();
/**
* @return Collection MplsService objects
*/
public function pollMplsServices();
/**
* @param Collection $svcs collecton of synchronized service objects from pollMplsServices()
* @return Collection MplsSap objects
*/
public function pollMplsSaps($svcs);
/**
* @param Collection $sdps collecton of synchronized sdp objects from pollMplsSdps()
* @param Collection $svcs collecton of synchronized service objects from pollMplsServices()
* @return Collection MplsSdpBind objects
*/
public function pollMplsSdpBinds($sdps, $svcs);
}

View File

@@ -55,6 +55,22 @@ class Mpls implements Module
ModuleModelObserver::observe('\App\Models\MplsLspPath');
$this->syncModels($os->getDeviceModel(), 'mplsLspPaths', $os->discoverMplsPaths($lsps));
echo "\nMPLS SDPs: ";
ModuleModelObserver::observe('\App\Models\MplsSdp');
$sdps = $this->syncModels($os->getDeviceModel(), 'mplsSdps', $os->discoverMplsSdps());
echo "\nMPLS Services: ";
ModuleModelObserver::observe('\App\Models\MplsService');
$svcs = $this->syncModels($os->getDeviceModel(), 'mplsServices', $os->discoverMplsServices());
echo "\nMPLS SAPs: ";
ModuleModelObserver::observe('\App\Models\MplsSap');
$this->syncModels($os->getDeviceModel(), 'mplsSaps', $os->discoverMplsSaps($svcs));
echo "\nMPLS SDP Bindings: ";
ModuleModelObserver::observe('\App\Models\MplsSdpBind');
$this->syncModels($os->getDeviceModel(), 'mplsSdpBinds', $os->discoverMplsSdpBinds($sdps, $svcs));
echo PHP_EOL;
}
}
@@ -77,6 +93,22 @@ class Mpls implements Module
ModuleModelObserver::observe('\App\Models\MplsLspPath');
$this->syncModels($os->getDeviceModel(), 'mplsLspPaths', $os->pollMplsPaths($lsps));
echo "\nMPLS SDPs: ";
ModuleModelObserver::observe('\App\Models\MplsSdp');
$sdps = $this->syncModels($os->getDeviceModel(), 'mplsSdps', $os->pollMplsSdps());
echo "\nMPLS Services: ";
ModuleModelObserver::observe('\App\Models\MplsService');
$svcs = $this->syncModels($os->getDeviceModel(), 'mplsServices', $os->pollMplsServices());
echo "\nMPLS SAPs: ";
ModuleModelObserver::observe('\App\Models\MplsSap');
$this->syncModels($os->getDeviceModel(), 'mplsSaps', $os->pollMplsSaps($svcs));
echo "\nMPLS SDP Bindings: ";
ModuleModelObserver::observe('\App\Models\MplsSdpBind');
$this->syncModels($os->getDeviceModel(), 'mplsSdpBinds', $os->pollMplsSdpBinds($sdps, $svcs));
echo PHP_EOL;
}
}
@@ -91,5 +123,9 @@ class Mpls implements Module
{
$os->getDeviceModel()->mplsLsps()->delete();
$os->getDeviceModel()->mplsLspPaths()->delete();
$os->getDeviceModel()->mplsSdps()->delete();
$os->getDeviceModel()->mplsServices()->delete();
$os->getDeviceModel()->mplsSaps()->delete();
$os->getDeviceModel()->mplsSdpBinds()->delete();
}
}

View File

@@ -29,6 +29,10 @@ namespace LibreNMS\OS;
use App\Models\MplsLsp;
use App\Models\MplsLspPath;
use App\Models\MplsSdp;
use App\Models\MplsService;
use App\Models\MplsSap;
use App\Models\MplsSdpBind;
use Illuminate\Support\Collection;
use LibreNMS\Interfaces\Discovery\MplsDiscovery;
use LibreNMS\Interfaces\Polling\MplsPolling;
@@ -36,6 +40,50 @@ use LibreNMS\OS;
class Timos extends OS implements MplsDiscovery, MplsPolling
{
/**
* @param tmnxEnacpVal
* @return encapsulation string
* see TIMETRA-TC-MIB::TmnxEncapVal
*/
private function nokiaEncap($tmnxEncapVal)
{
// implement other encapsulation values
$map = sprintf("%032b", $tmnxEncapVal);
if (substr($map, -32, 20) == '00000000000000000000') { // 12-bit IEEE 802.1Q VLAN ID
if ($tmnxEncapVal == 4095) {
return '*';
}
}
return $tmnxEncapVal;
}
/**
* @param tmnxPortID a 32bit encoded value
* @param scheme
* @return converted ifName
* see TIMETRA-TC-MIB::TmnxPortID
*/
private function nokiaIfName($tmnxPortId, $scheme)
{
// Fixme implement other schemes and channels
if ($scheme == 'schemeA') {
$map = sprintf("%032b", $tmnxPortId);
if (substr($map, -32, 4) == '0101') { // LAG Port
if (substr($map, -28, 4) == '1011') { // Pseudowire Port
return "pw-" . bindec(substr($map, -10, 10));
}
return "lag-" . bindec(substr($map, -10, 10));
}
$slot = bindec(substr($map, -29, 4));
$mda = bindec(substr($map, -25, 4));
$port = bindec(substr($map, -21, 6));
return $slot . "/" . $mda . "/" . $port;
}
}
/**
* @return Collection MplsLsp objects
*/
@@ -105,6 +153,166 @@ class Timos extends OS implements MplsDiscovery, MplsPolling
return $paths;
}
/**
* @return Collection MplsSdp objects
*/
public function discoverMplsSdps()
{
$mplsSdpCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sdpInfoTable', [], 'TIMETRA-SDP-MIB', 'nokia', '-OQUst');
$sdps = collect();
foreach ($mplsSdpCache as $value) {
if ((!empty($value['sdpFarEndInetAddress'])) && ($value['sdpFarEndInetAddressType'] == 'ipv4')) {
$ip = long2ip(hexdec(str_replace(' ', '', $value['sdpFarEndInetAddress'])));
} else {
#Fixme implement ipv6 conversion
$ip = $value['sdpFarEndInetAddress'];
}
$sdps->push(new MplsSdp([
'sdp_oid' => $value['sdpId'],
'device_id' => $this->getDeviceId(),
'sdpRowStatus' => $value['sdpRowStatus'],
'sdpDelivery' => $value['sdpDelivery'],
'sdpDescription' => $value['sdpDescription'],
'sdpAdminStatus' => $value['sdpAdminStatus'],
'sdpOperStatus' => $value['sdpOperStatus'],
'sdpAdminPathMtu' => $value['sdpAdminPathMtu'],
'sdpOperPathMtu' => $value['sdpOperPathMtu'],
'sdpLastMgmtChange' => round($value['sdpLastMgmtChange'] / 100),
'sdpLastStatusChange' => round($value['sdpLastStatusChange'] / 100),
'sdpActiveLspType' => $value['sdpActiveLspType'],
'sdpFarEndInetAddressType' => $value['sdpFarEndInetAddressType'],
'sdpFarEndInetAddress' => $ip,
]));
}
return $sdps;
}
/**
* @return Collection MplsService objects
*/
public function discoverMplsServices()
{
$mplsSvcCache = snmpwalk_cache_multi_oid($this->getDevice(), 'svcBaseInfoTable', [], 'TIMETRA-SERV-MIB', 'nokia', '-OQUst');
$mplsSvcCache = snmpwalk_cache_multi_oid($this->getDevice(), 'svcTlsInfoTable', $mplsSvcCache, 'TIMETRA-SERV-MIB', 'nokia', '-OQUst');
$svcs = collect();
// Workaround, remove some defalt entries we do not want to see
$filter = '/^\w* Service for internal purposes only/';
foreach ($mplsSvcCache as $key => $value) {
$garbage = preg_match($filter, $value['svcDescription']);
if ($garbage) {
unset($key);
continue;
}
$svcs->push(new MplsService([
'svc_oid' => $value['svcId'],
'device_id' => $this->getDeviceId(),
'svcRowStatus' => $value['svcRowStatus'],
'svcType' => $value['svcType'],
'svcCustId' => $value['svcCustId'],
'svcAdminStatus' => $value['svcAdminStatus'],
'svcOperStatus' => $value['svcOperStatus'],
'svcDescription' => $value['svcDescription'],
'svcMtu' => $value['svcMtu'],
'svcNumSaps' => $value['svcNumSaps'],
'svcNumSdps' => $value['svcNumSdps'],
'svcLastMgmtChange' => round($value['svcLastMgmtChange'] / 100),
'svcLastStatusChange' => round($value['svcLastStatusChange'] / 100),
'svcVRouterId' => $value['svcVRouterId'],
'svcTlsMacLearning' => $value['svcTlsMacLearning'],
'svcTlsStpAdminStatus' => $value['svcTlsStpAdminStatus'],
'svcTlsStpOperStatus' => $value['svcTlsStpOperStatus'],
'svcTlsFdbTableSize' => $value['svcTlsFdbTableSize'],
'svcTlsFdbNumEntries' => $value['svcTlsFdbNumEntries'],
]));
}
return $svcs;
}
/**
* @return Collection MplsSap objects
*/
public function discoverMplsSaps($svcs)
{
$mplsSapCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sapBaseInfoTable', [], 'TIMETRA-SAP-MIB', 'nokia', '-OQUst');
$portScheme = snmp_get($this->getDevice(), 'tmnxChassisPortIdScheme.1', '-Oqv', 'TIMETRA-CHASSIS-MIB', 'nokia');
$saps = collect();
// Workaround, there are some oids not covered by actual MIB, try to filter them
// i.e. sapBaseInfoEntry.300.118208001.1342177283.10
$filter_key = '/300\.[0-9]+\.[0-9]+\.[0-9]+/';
// remove some defalt entries we do not want to see
$filter_value = '/^Internal SAP/';
foreach ($mplsSapCache as $key => $value) {
if (preg_match($filter_key, $key) || preg_match($filter_value, $value['sapDescription'])) {
unset($key);
continue;
}
list($svcId, $sapPortId, $sapEncapValue) = explode('.', $key);
$svc_id = $svcs->firstWhere('svc_oid', $svcId)->svc_id;
$saps->push(new MplsSap([
'svc_id' => $svc_id,
'svc_oid' => $svcId,
'sapPortId' => $sapPortId,
'ifName' => $this->nokiaIfName($sapPortId, $portScheme),
'device_id' => $this->getDeviceId(),
'sapEncapValue' => $this->nokiaEncap($sapEncapValue),
'sapRowStatus' => $value['sapRowStatus'],
'sapType' => $value['sapType'],
'sapDescription' => $value['sapDescription'],
'sapAdminStatus' => $value['sapAdminStatus'],
'sapOperStatus' => $value['sapOperStatus'],
'sapLastMgmtChange' => round($value['sapLastMgmtChange'] / 100),
'sapLastStatusChange' => round($value['sapLastStatusChange'] /100),
]));
}
return $saps;
}
/**
* @return Collection MplsSdpBind objects
*/
public function discoverMplsSdpBinds($sdps, $svcs)
{
$mplsBindCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sdpBindTable', [], 'TIMETRA-SDP-MIB', 'nokia', '-OQUsbt');
$mplsBindCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sdpBindBaseStatsTable', $mplsBindCache, 'TIMETRA-SDP-MIB', 'nokia', '-OQUsb');
$binds = collect();
foreach ($mplsBindCache as $value) {
$bind_id = str_replace(' ', '', $value['sdpBindId']);
$sdp_oid = hexdec(substr($bind_id, 0, 8));
$svc_oid = hexdec(substr($bind_id, 9, 16));
$sdp_id = $sdps->firstWhere('sdp_oid', $sdp_oid)->sdp_id;
$svc_id = $svcs->firstWhere('svc_oid', $svc_oid)->svc_id;
$binds->push(new MplsSdpBind([
'sdp_id' => $sdp_id,
'svc_id' => $svc_id,
'sdp_oid' => $sdp_oid,
'svc_oid' => $svc_oid,
'device_id' => $this->getDeviceId(),
'sdpBindRowStatus' => $value['sdpBindRowStatus'],
'sdpBindAdminStatus' => $value['sdpBindAdminStatus'],
'sdpBindOperStatus' => $value['sdpBindOperStatus'],
'sdpBindLastMgmtChange' => round($value['sdpBindLastMgmtChange'] / 100),
'sdpBindLastStatusChange' => round($value['sdpBindLastStatusChange'] / 100),
'sdpBindType' => $value['sdpBindType'],
'sdpBindVcType' => $value['sdpBindVcType'],
'sdpBindBaseStatsIngFwdPackets' => $value['sdpBindBaseStatsIngressForwardedPackets'],
'sdpBindBaseStatsIngFwdOctets' => $value['sdpBindBaseStatsIngFwdOctets'],
'sdpBindBaseStatsEgrFwdPackets' => $value['sdpBindBaseStatsEgressForwardedPackets'],
'sdpBindBaseStatsEgrFwdOctets' => $value['sdpBindBaseStatsEgressForwardedOctets'],
]));
}
return $binds;
}
/**
* @return Collection MplsLsp objects
@@ -188,4 +396,165 @@ class Timos extends OS implements MplsDiscovery, MplsPolling
return $paths;
}
/**
* @return Collection MplsSdp objects
*/
public function pollMplsSdps()
{
$mplsSdpCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sdpInfoTable', [], 'TIMETRA-SDP-MIB', 'nokia', '-OQUst');
$sdps = collect();
foreach ($mplsSdpCache as $value) {
if ((!empty($value['sdpFarEndInetAddress'])) && ($value['sdpFarEndInetAddressType'] == 'ipv4')) {
$ip = long2ip(hexdec(str_replace(' ', '', $value['sdpFarEndInetAddress'])));
} else {
#Fixme implement ipv6 conversion
$ip = $value['sdpFarEndInetAddress'];
}
$sdps->push(new MplsSdp([
'sdp_oid' => $value['sdpId'],
'device_id' => $this->getDeviceId(),
'sdpRowStatus' => $value['sdpRowStatus'],
'sdpDelivery' => $value['sdpDelivery'],
'sdpDescription' => $value['sdpDescription'],
'sdpAdminStatus' => $value['sdpAdminStatus'],
'sdpOperStatus' => $value['sdpOperStatus'],
'sdpAdminPathMtu' => $value['sdpAdminPathMtu'],
'sdpOperPathMtu' => $value['sdpOperPathMtu'],
'sdpLastMgmtChange' => round($value['sdpLastMgmtChange'] / 100),
'sdpLastStatusChange' => round($value['sdpLastStatusChange'] / 100),
'sdpActiveLspType' => $value['sdpActiveLspType'],
'sdpFarEndInetAddressType' => $value['sdpFarEndInetAddressType'],
'sdpFarEndInetAddress' => $ip,
]));
}
return $sdps;
}
/**
* @return Collection MplsService objects
*/
public function pollMplsServices()
{
$mplsSvcCache = snmpwalk_cache_multi_oid($this->getDevice(), 'svcBaseInfoTable', [], 'TIMETRA-SERV-MIB', 'nokia', '-OQUst');
$mplsSvcCache = snmpwalk_cache_multi_oid($this->getDevice(), 'svcTlsInfoTable', $mplsSvcCache, 'TIMETRA-SERV-MIB', 'nokia', '-OQUst');
$svcs = collect();
// Workaround, remove some default entries we do not want to see
$filter = '/^\w* Service for internal purposes only/';
foreach ($mplsSvcCache as $key => $value) {
$garbage = preg_match($filter, $value['svcDescription']);
if ($garbage) {
unset($key);
continue;
}
$svcs->push(new MplsService([
'svc_oid' => $value['svcId'],
'device_id' => $this->getDeviceId(),
'svcRowStatus' => $value['svcRowStatus'],
'svcType' => $value['svcType'],
'svcCustId' => $value['svcCustId'],
'svcAdminStatus' => $value['svcAdminStatus'],
'svcOperStatus' => $value['svcOperStatus'],
'svcDescription' => $value['svcDescription'],
'svcMtu' => $value['svcMtu'],
'svcNumSaps' => $value['svcNumSaps'],
'svcNumSdps' => $value['svcNumSdps'],
'svcLastMgmtChange' => round($value['svcLastMgmtChange'] / 100),
'svcLastStatusChange' => round($value['svcLastStatusChange'] / 100),
'svcVRouterId' => $value['svcVRouterId'],
'svcTlsMacLearning' => $value['svcTlsMacLearning'],
'svcTlsStpAdminStatus' => $value['svcTlsStpAdminStatus'],
'svcTlsStpOperStatus' => $value['svcTlsStpOperStatus'],
'svcTlsFdbTableSize' => $value['svcTlsFdbTableSize'],
'svcTlsFdbNumEntries' => $value['svcTlsFdbNumEntries'],
]));
}
return $svcs;
}
/**
* @return Collection MplsSap objects
*/
public function pollMplsSaps($svcs)
{
$mplsSapCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sapBaseInfoTable', [], 'TIMETRA-SAP-MIB', 'nokia', '-OQUst');
$portScheme = snmp_get($this->getDevice(), 'tmnxChassisPortIdScheme.1', '-Oqv', 'TIMETRA-CHASSIS-MIB', 'nokia');
$saps = collect();
// Workaround, there are some oids not covered by actual MIB, try to filter them
// i.e. sapBaseInfoEntry.300.118208001.1342177283.10
$filter_key = '/300\.[0-9]+\.[0-9]+\.[0-9]+/';
// remove some default entries we do not want to see
$filter_value = '/^Internal SAP/';
foreach ($mplsSapCache as $key => $value) {
if (preg_match($filter_key, $key) || preg_match($filter_value, $value['sapDescription'])) {
unset($key);
continue;
}
list($svcId, $sapPortId, $sapEncapValue) = explode('.', $key);
$svc_id = $svcs->firstWhere('svc_oid', $svcId)->svc_id;
$saps->push(new MplsSap([
'svc_id' => $svc_id,
'svc_oid' => $svcId,
'sapPortId' => $sapPortId,
'ifName' => $this->nokiaIfName($sapPortId, $portScheme),
'device_id' => $this->getDeviceId(),
'sapEncapValue' => $this->nokiaEncap($sapEncapValue),
'sapRowStatus' => $value['sapRowStatus'],
'sapType' => $value['sapType'],
'sapDescription' => $value['sapDescription'],
'sapAdminStatus' => $value['sapAdminStatus'],
'sapOperStatus' => $value['sapOperStatus'],
'sapLastMgmtChange' => round($value['sapLastMgmtChange'] / 100),
'sapLastStatusChange' => round($value['sapLastStatusChange'] /100),
]));
}
return $saps;
}
/**
* @return Collection MplsSDpBind objects
*/
public function pollMplsSdpBinds($sdps, $svcs)
{
$mplsBindCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sdpBindTable', [], 'TIMETRA-SDP-MIB', 'nokia', '-OQUsbt');
$mplsBindCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sdpBindBaseStatsTable', $mplsBindCache, 'TIMETRA-SDP-MIB', 'nokia', '-OQUsb');
$binds = collect();
foreach ($mplsBindCache as $value) {
$bind_id = str_replace(' ', '', $value['sdpBindId']);
$sdp_oid = hexdec(substr($bind_id, 0, 8));
$svc_oid = hexdec(substr($bind_id, 9, 16));
$sdp_id = $sdps->firstWhere('sdp_oid', $sdp_oid)->sdp_id;
$svc_id = $svcs->firstWhere('svc_oid', $svc_oid)->svc_id;
$binds->push(new MplsSdpBind([
'sdp_id' => $sdp_id,
'svc_id' => $svc_id,
'sdp_oid' => $sdp_oid,
'svc_oid' => $svc_oid,
'device_id' => $this->getDeviceId(),
'sdpBindRowStatus' => $value['sdpBindRowStatus'],
'sdpBindAdminStatus' => $value['sdpBindAdminStatus'],
'sdpBindOperStatus' => $value['sdpBindOperStatus'],
'sdpBindLastMgmtChange' => round($value['sdpBindLastMgmtChange'] / 100),
'sdpBindLastStatusChange' => round($value['sdpBindLastStatusChange'] / 100),
'sdpBindType' => $value['sdpBindType'],
'sdpBindVcType' => $value['sdpBindVcType'],
'sdpBindBaseStatsIngFwdPackets' => $value['sdpBindBaseStatsIngressForwardedPackets'],
'sdpBindBaseStatsIngFwdOctets' => $value['sdpBindBaseStatsIngFwdOctets'],
'sdpBindBaseStatsEgrFwdPackets' => $value['sdpBindBaseStatsEgressForwardedPackets'],
'sdpBindBaseStatsEgrFwdOctets' => $value['sdpBindBaseStatsEgressForwardedOctets'],
]));
}
return $binds;
}
}

View File

@@ -566,6 +566,26 @@ class Device extends BaseModel
return $this->hasMany('App\Models\MplsLspPath', 'device_id');
}
public function mplsSdps()
{
return $this->hasMany('App\Models\MplsSdp', 'device_id');
}
public function mplsServices()
{
return $this->hasMany('App\Models\MplsService', 'device_id');
}
public function mplsSaps()
{
return $this->hasMany('App\Models\MplsSap', 'device_id');
}
public function mplsSdpBinds()
{
return $this->hasMany('App\Models\MplsSdpBind', 'device_id');
}
public function syslogs()
{
return $this->hasMany('App\Models\Syslog', 'device_id', 'device_id');

50
app/Models/MplsSap.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use LibreNMS\Interfaces\Models\Keyable;
class MplsSap extends Model implements Keyable
{
protected $primaryKey = 'sap_id';
public $timestamps = false;
protected $fillable = [
'svc_id',
'svc_oid',
'sapPortId',
'ifName',
'sapEncapValue',
'device_id',
'sapRowStatus',
'sapType',
'sapDescription',
'sapAdminStatus',
'sapOperStatus',
'sapLastMgmtChange',
'sapLastStatusChange',
];
// ---- Helper Functions ----
/**
* Get a string that can identify a unique instance of this model
* @return string
*/
public function getCompositeKey()
{
return $this->svc_oid . '-' . $this->sapPortId . '-' . $this->sapEncapValue;
}
// ---- Define Relationships ----
public function binds()
{
return $this->hasMany('App\Models\MplsSdpBind', 'svc_id');
}
public function services()
{
return $this->hasMany('App\Models\MplsService', 'svc_id');
}
}

46
app/Models/MplsSdp.php Normal file
View File

@@ -0,0 +1,46 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use LibreNMS\Interfaces\Models\Keyable;
class MplsSdp extends Model implements Keyable
{
protected $primaryKey = 'sdp_id';
public $timestamps = false;
protected $fillable = [
'sdp_oid',
'device_id',
'sdpRowStatus',
'sdpDelivery',
'sdpDescription',
'sdpAdminStatus',
'sdpOperStatus',
'sdpAdminPathMtu',
'sdpOperPathMtu',
'sdpLastMgmtChange',
'sdpLastStatusChange',
'sdpActiveLspType',
'sdpFarEndInetAddressType',
'sdpFarEndInetAddress',
];
// ---- Helper Functions ----
/**
* Get a string that can identify a unique instance of this model
* @return string
*/
public function getCompositeKey()
{
return $this->sdp_oid;
}
// ---- Define Relationships ----
public function binds()
{
return $this->hasMany('App\Models\MplsSdpBind', 'sdp_id');
}
}

View File

@@ -0,0 +1,53 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use LibreNMS\Interfaces\Models\Keyable;
class MplsSdpBind extends Model implements Keyable
{
protected $primaryKey = 'bind_id';
public $timestamps = false;
protected $fillable = [
'sdp_id',
'svc_id',
'sdp_oid',
'svc_oid',
'device_id',
'sdpBindRowStatus',
'sdpBindAdminStatus',
'sdpBindOperStatus',
'sdpBindLastMgmtChange',
'sdpBindLastStatusChange',
'sdpBindType',
'sdpBindVcType',
'sdpBindBaseStatsIngFwdPackets',
'sdpBindBaseStatsIngFwdOctets',
'sdpBindBaseStatsEgrFwdPackets',
'sdpBindBaseStatsEgrFwdOctets',
];
// ---- Helper Functions ----
/**
* Get a string that can identify a unique instance of this model
* @return string
*/
public function getCompositeKey()
{
return $this->sdp_oid . '-' . $this->svc_oid;
}
// ---- Define Relationships ----
public function sdp()
{
return $this->belongsTo('App\Models\MplsSdp', 'sdp_id');
}
public function service()
{
return $this->belongsTo('App\Models\MplsService', 'svc_id');
}
}

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use LibreNMS\Interfaces\Models\Keyable;
class MplsService extends Model implements Keyable
{
protected $primaryKey = 'svc_id';
public $timestamps = false;
protected $fillable = [
'svc_oid',
'device_id',
'svcRowStatus',
'svcType',
'svcCustId',
'svcAdminStatus',
'svcOperStatus',
'svcDescription',
'svcMtu',
'svcNumSaps',
'svcNumSdps',
'svcLastMgmtChange',
'svcLastStatusChange',
'svcVRouterId',
'svcTlsMacLearning',
'svcTlsStpAdminStatus',
'svcTlsStpOperStatus',
'svcTlsFdbTableSize',
'svcTlsFdbNumEntries',
];
// ---- Helper Functions ----
/**
* Get a string that can identify a unique instance of this model
* @return string
*/
public function getCompositeKey()
{
return $this->svc_oid;
}
// ---- Define Relationships ----
public function binds()
{
return $this->hasMany('App\Models\MplsSdpBind', 'svc_id');
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMplsSdpsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mpls_sdps', function (Blueprint $table) {
$table->increments('sdp_id');
$table->unsignedInteger('sdp_oid');
$table->unsignedInteger('device_id')->index('device_id');
$table->enum('sdpRowStatus', array('active','notInService','notReady','createAndGo','createAndWait','destroy'))->nullable();
$table->enum('sdpDelivery', array('gre','mpls','l2tpv3','greethbridged'))->nullable();
$table->string('sdpDescription', 80)->nullable();
$table->enum('sdpAdminStatus', array('up','down'))->nullable();
$table->enum('sdpOperStatus', array('up','notAlive','notReady','invalidEgressInterface','transportTunnelDown','down'))->nullable();
$table->integer('sdpAdminPathMtu')->nullable();
$table->integer('sdpOperPathMtu')->nullable();
$table->bigInteger('sdpLastMgmtChange')->nullable();
$table->bigInteger('sdpLastStatusChange')->nullable();
$table->enum('sdpActiveLspType', array('not-applicable','rsvp','ldp','bgp','none','mplsTp','srIsis','srOspf','srTeLsp','fpe'))->nullable();
$table->enum('sdpFarEndInetAddressType', array('ipv4','ipv6'))->nullable();
$table->string('sdpFarEndInetAddress', 46)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mpls_sdps');
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMplsSdpBindsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mpls_sdp_binds', function (Blueprint $table) {
$table->increments('bind_id');
$table->unsignedInteger('sdp_id');
$table->unsignedInteger('svc_id');
$table->unsignedInteger('sdp_oid');
$table->unsignedInteger('svc_oid');
$table->unsignedInteger('device_id')->index('device_id');
$table->enum('sdpBindRowStatus', array('active','notInService','notReady','createAndGo','createAndWait','destroy'))->nullable();
$table->enum('sdpBindAdminStatus', array('up','down'))->nullable();
$table->enum('sdpBindOperStatus', array('up','down'))->nullable();
$table->bigInteger('sdpBindLastMgmtChange')->nullable();
$table->bigInteger('sdpBindLastStatusChange')->nullable();
$table->enum('sdpBindType', array('spoke','mesh'))->nullable();
$table->enum('sdpBindVcType', array('undef','ether','vlan','mirrior','atmSdu'.'atmCell','atmVcc','atmVpc','frDlci','ipipe','satopE1','satopT1','satopE3','satopT3','cesopsn','cesopsnCas'))->nullable();
$table->bigInteger('sdpBindBaseStatsIngFwdPackets')->nullable();
$table->bigInteger('sdpBindBaseStatsIngFwdOctets')->nullable();
$table->bigInteger('sdpBindBaseStatsEgrFwdPackets')->nullable();
$table->bigInteger('sdpBindBaseStatsEgrFwdOctets')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mpls_sdp_binds');
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMplsServicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mpls_services', function (Blueprint $table) {
$table->increments('svc_id');
$table->unsignedInteger('svc_oid');
$table->unsignedInteger('device_id')->index('device_id');
$table->enum('svcRowStatus', array('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy'))->nullable();
$table->enum('svcType', array('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls'))->nullable();
$table->unsignedInteger('svcCustId')->nullable();
$table->enum('svcAdminStatus', array('up', 'down'))->nullable();
$table->enum('svcOperStatus', array('up', 'down'))->nullable();
$table->string('svcDescription', 80)->nullable();
$table->integer('svcMtu')->nullable();
$table->integer('svcNumSaps')->nullable();
$table->integer('svcNumSdps')->nullable();
$table->bigInteger('svcLastMgmtChange')->nullable();
$table->bigInteger('svcLastStatusChange')->nullable();
$table->integer('svcVRouterId')->nullable();
$table->enum('svcTlsMacLearning', array('enabled', 'disabled'))->nullable();
$table->enum('svcTlsStpAdminStatus', array('enabled', 'disabled'))->nullable();
$table->enum('svcTlsStpOperStatus', array('up', 'down'))->nullable();
$table->integer('svcTlsFdbTableSize')->nullable();
$table->integer('svcTlsFdbNumEntries')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mpls_services');
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMplsSapsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mpls_saps', function (Blueprint $table) {
$table->increments('sap_id');
$table->unsignedInteger('svc_id');
$table->unsignedInteger('svc_oid');
$table->unsignedInteger('sapPortId');
$table->string('ifName', 255)->nullable();
$table->unsignedInteger('device_id')->index('device_id');
$table->string('sapEncapValue', 255)->nullable();
$table->enum('sapRowStatus', array('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy'))->nullable();
$table->enum('sapType', array('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls'))->nullable();
$table->string('sapDescription', 80)->nullable();
$table->enum('sapAdminStatus', array('up', 'down'))->nullable();
$table->enum('sapOperStatus', array('up', 'down'))->nullable();
$table->bigInteger('sapLastMgmtChange')->nullable();
$table->bigInteger('sapLastStatusChange')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mpls_saps');
}
}

View File

@@ -19,7 +19,7 @@ if ($vars['view'] == 'lsp') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('LSP', $link_array, array('view' => 'lsp'));
echo generate_link('LSPs', $link_array, array('view' => 'lsp'));
if ($vars['view'] == 'lsp') {
echo '</span>';
}
@@ -35,6 +35,50 @@ if ($vars['view'] == 'paths') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'sdps') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('SDPs', $link_array, array('view' => 'sdps'));
if ($vars['view'] == 'sdps') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'sdpbinds') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('SDP binds', $link_array, array('view' => 'sdpbinds'));
if ($vars['view'] == 'sdpbinds') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'services') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('Services', $link_array, array('view' => 'services'));
if ($vars['view'] == 'services') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'saps') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('SAPs', $link_array, array('view' => 'saps'));
if ($vars['view'] == 'saps') {
echo '</span>';
}
print_optionbar_end();
echo '<div id="content">
@@ -86,7 +130,7 @@ if ($vars['view'] == 'lsp') {
$host = @dbFetchRow('SELECT * FROM `ipv4_addresses` AS A, `ports` AS I, `devices` AS D WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id', [$lsp['mplsLspToAddr']]);
$destination = $lsp['mplsLspToAddr'];
if (is_array($host)) {
$destination = generate_device_link($host, 0, array('tab' => 'routing', 'proto' => 'mpls'));
$destination = generate_device_link($host, 0, array('tab' => 'routing', 'proto' => 'mpls', 'view' => 'lsp'));
}
echo "<tr bgcolor=$bg_colour>
@@ -175,4 +219,249 @@ if ($vars['view'] == 'paths') {
$i++;
}
echo '</table></div>';
} // end lsp path view
} // end paths view
if ($vars['view'] == 'sdps') {
echo '<th><a title="Service Distribution Point identifier">SDP Id</a></th>
<th><a title="The value of destination object specifies the device name of the remote end of the tunnel defined by this SDP">Destination</a></th>
<th><a title="This object specifies the type of delivery used by this SDP">Type</a></th>
<th><a title="The value of sdpActiveLspType indicates the type of LSP that is currently active on this SDP. For sdpDelivery gre, the value is always not-applicable. For sdpDelivery mpls, the values can be rsvp, ldp, mplsTp, srIsis, srOspf, srTeLsp, fpe, bgp or none.">LSP Type</a></th>
<th><a title="Generic information about this SDP">Description</a></th>
<th><a title="The desired administrative state for this SDP">Admin State</a></th>
<th><a title="The current operational state of this SDP">Oper State</a></th>
<th><a title="This object specifies the desired largest service frame size (in octets) that can be transmitted through this SDP to the far-end ESR, without requiring the packet to be fragmented. The default value of zero indicates that the path MTU should be computed dynamically from the corresponding MTU of the tunnel.">Admin MTU</a></th>
<th><a title="This object indicates the actual largest service frame size (in octets) that can be transmitted through this SDP to the far-end ESR, without requiring the packet to be fragmented. In order to be able to bind this SDP to a given service, the value of this object minus the control word size (if applicable) must be equal to or larger than the MTU of the service, as defined by its svcMtu.">Oper MTU</a></th>
<th><a title="The value of sysUpTime at the time of the most recent management-initiated change to this SDP.">Last Mgmt Change at</a></th>
<th><a title="The value of sysUpTime at the time of the most recent operating status change to this SDP.">Last Status Change at</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT * FROM `mpls_sdps` WHERE `device_id` = ? ORDER BY `sdp_oid`', array($device['device_id'])) as $sdp) {
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($sdp['sdpAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($sdp['sdpOperStatus'] == 'up') {
$operstate_status_color = 'success';
} elseif ($sdp['sdpAdminStatus'] == 'up' && $sdp['sdpOperStatus'] == 'down') {
$operstate_status_color = 'danger';
}
$host = @dbFetchRow('SELECT * FROM `ipv4_addresses` AS A, `ports` AS I, `devices` AS D WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id', [$sdp['sdpFarEndInetAddress']]);
$destination = $sdp['sdpFarEndInetAddress'];
if (is_array($host)) {
$destination = generate_device_link($host, 0, array('tab' => 'routing', 'proto' => 'mpls', 'view' => 'sdps'));
}
echo "<tr bgcolor=$bg_colour>
<td>" . $sdp['sdp_oid'] . '</td>
<td>' . $destination . '</td>
<td>' . $sdp['sdpDelivery'] . '</td>
<td>' . $sdp['sdpActiveLspType'] . '</td>
<td>' . $sdp['sdpDescription'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $sdp['sdpAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $sdp['sdpOperStatus'] . '</td>
<td>' . $sdp['sdpAdminPathMtu'] . '</td>
<td>' . $sdp['sdpOperPathMtu'] . '</td>
<td>' . formatUptime($sdp['sdpLastMgmtChange']) . '</td>
<td>' . formatUptime($sdp['sdpLastStatusChange']) . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end sdps view
if ($vars['view'] == 'sdpbinds') {
echo '<th><a title="SDP Binding identifier. SDP identifier : Service identifier">SDP Bind Id</a></th>
<th><a title="This object specifies whether this Service SDP binding is a spoke or a mesh.">Bind Type</a></th>
<th><a title="The value of VC Type is an enumerated integer that specifies the type of virtual circuit (VC) associated with the SDP binding">VC Type</a></th>
<th><a title="The desired state of this Service-SDP binding.">Admin State</a></th>
<th><a title="The value of sdpBindOperStatus indicates the operating status of this Service-SDP binding.
up: The Service-SDP binding is operational.
noEgressLabel: The ingress label is available but the egress one is missing.
noIngressLabel:The egress label is available but the ingress one is not.
noLabels: Both the ingress and the egress labels are missing.
down: The binding is administratively down.
svcMtuMismatch: Both labels are available, but a service MTU mismatch was detected between the local and the far-end devices.
sdpPathMtuTooSmall: The operating path MTU of the corresponding SDP minus the size of the SDP Bind control word (if applicable) is smaller than the service MTU.
sdpNotReady: The SDPs signaling session is down.
sdpDown: The SDP is not operationally up.
sapDown: The SAP associated with the service is down.">Oper State</a></th>
<th><a title="The value of sysUpTime at the time of the most recent management-initiated change to this Service-SDP binding.">Last Mgmt Change at</a></th>
<th><a title="The value of the object sdpBindLastStatusChange indicates the value of sysUpTime at the time of the most recent operating status change to this SDP Bind.">Last Status Change at</a></th>
<th><a title="SDP Bind ingress forwarded packets">Ing Fwd Packets</a></th>
<th><a title="SDP Bind ingress forwarded octets">Ing Fwd Octets</a></th>
<th><a title="SDP Bind egress forwarded packets">Egr Fwd Packets</a></th>
<th><a title="SDP Bind egress forwarded octets">Egr Fwd Octets</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT * FROM `mpls_sdp_binds` WHERE `device_id` = ? ORDER BY `sdp_oid`, `svc_oid`', array($device['device_id'])) as $sdpbind) {
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($sdpbind['sdpBindAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($sdpbind['sdpBindOperStatus'] == 'up') {
$operstate_status_color = 'success';
} else {
$operstate_status_color = 'danger';
}
echo "<tr bgcolor=$bg_colour>
<td>" . $sdpbind['sdp_oid'] . ':' . $sdpbind['svc_oid'] . '</td>
<td>' . $sdpbind['sdpBindType'] . '</td>
<td>' . $sdpbind['sdpBindVcType'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $sdpbind['sdpBindAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $sdpbind['sdpBindOperStatus'] . '</td>
<td>' . formatUptime($sdpbind['sdpBindLastMgmtChange']) . '</td>
<td>' . formatUptime($sdpbind['sdpBindLastStatusChange']) . '</td>
<td>' . $sdpbind['sdpBindBaseStatsIngFwdPackets'] . '</td>
<td>' . $sdpbind['sdpBindBaseStatsIngFwdOctets'] . '</td>
<td>' . $sdpbind['sdpBindBaseStatsEgrFwdPackets'] . '</td>
<td>' . $sdpbind['sdpBindBaseStatsEgrFwdOctets'] . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end sdpbinds view
if ($vars['view'] == 'services') {
echo '<th><a title="The value of this object specifies the Service identifier. This value should be unique within the service domain.">Service Id</a></th>
<th><a title="The value of this object specifies the service type: e.g. epipe, tls, etc.">Type</a></th>
<th><a title="The value of this object specifies the ID of the customer who owns this service.">Customer</a></th>
<th><a title="The value of this object specifies the desired state of this service.">Admin Status</a></th>
<th><a title="The value of this object indicates the operating state of this service. The requirements for a service to be operationally up depend on the service type:
epipe, apipe, fpipe, ipipe and cpipe services are up when the service is administratively up and either both SAPs or a SAP and a spoke SDP Bind are operationally up.
tls services are up when the service is administratively up and either at least one SAP or spoke SDP Bind or one mesh SDP Bind is operationally up.
tls service that has vxlan configuration is up when the service is administratively up.
ies services are up when the service is administratively up and at least one interface is operationally up.
vprn services are up when the service is administratively up however routing functionality is available only when TIMETRA-VRTR-MIB::vRtrOperState is up.">Oper Status</a></th>
<th><a title="The value of the object svcDescription specifiers an optional, generic information about this service.">Description</a></th>
<th><a title="The value of the object svcMtu specifies the largest frame size (in octets) that this service can handle. Setting svcMtu to a value of zero (0), causes the agent to recalculate the default MTU size. The default value of this object depends on the service type: 1514 octets for epipe and tls, 1508 for apipe and fpipe, and 1500 octets for vprn, ipipe and ies, 1514 octets for cpipe.">Service MTU</a></th>
<th><a title="The value of the object svcNumSaps indicates the number of SAPs defined on this service.">Num SAPs</a></th>
<th><a title="The value of of the object svcLastMgmtChange indicates the value of sysUpTime at the time of the most recent management-initiated change to this service.">Last Mgmt Change at</a></th>
<th><a title="The value of the object svcLastStatusChange indicates the value of sysUpTime at the time of the most recent operating status change to his service.">Last Status Change at</a></th>
<th><a title="The value of this object specifies, for a IES or VPRN service the associated virtual router instance where its interfaces are defined. This object has a special significance for the VPRN service as it can be used to associate the service to a specific virtual router instance. If no routing instance is specified or a value of zero (0) is specified, the agent will assign the vRtrID index value that would have been returned by the vRtrNextVRtrID object in the TIMETRA-VRTR-MIB">VRF</a></th>
<th><a title="The value specifies whether the MAC learning process is enabled in this TLS.">MAC Learning</a></th>
<th><a title="The value of the object svcTlsFdbTableSize specifies the maximum number of learned and static entries allowed in the FDB of this service. The maximum value of svcTlsFdbTableSize depends on the platform/chassis mode.">FDB Table Size</a></th>
<th><a title="The value of the object svcTlsFdbNumEntries indicates the current number of entries allocated in the FDB of this service.">FDB Entries</a></th>
<th><a title="The value of the object svcTlsStpAdminStatus specifies the administrative state of the Spanning Tree Protocol instance associated with this service.">STP Admin Status</a></th>
<th><a title="The value of the object svcTlsStpOperStatus indicates the operating status of the Spanning Tree Protocol instance associated with this service.">STP Oper Status</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT s.*, v.vrf_name FROM `mpls_services` AS s LEFT JOIN `vrfs` AS v ON `s`.`svcVRouterId` = `v`.`vrf_oid` AND `s`.`device_id` = `v`.`device_id` WHERE `s`.`device_id` = ? ORDER BY `svc_oid`', array($device['device_id'])) as $svc) {
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($svc['svcAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($svc['svcOperStatus'] == 'up') {
$operstate_status_color = 'success';
} else {
$operstate_status_color = 'danger';
}
echo "<tr bgcolor=$bg_colour>
<td>" . $svc['svc_oid'] . '</td>
<td>' . $svc['svcType'] . '</td>
<td>' . $svc['svcCustId'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $svc['svcAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $svc['svcOperStatus'] . '</td>
<td>' . $svc['svcDescription'] . '</td>
<td>' . $svc['svcMtu'] . '</td>
<td>' . $svc['svcNumSaps'] . '</td>
<td>' . formatUptime($svc['svcLastMgmtChange']) . '</td>
<td>' . formatUptime($svc['svcLastStatusChange']) . '</td>
<td>' . $svc['vrf_name'] . '</td>
<td>' . $svc['svcTlsMacLearning'] . '</td>
<td>' . $svc['svcTlsFdbTableSize'] . '</td>
<td>' . $svc['svcTlsFdbNumEntries'] . '</td>
<td>' . $svc['svcTlsStpAdminStatus'] . '</td>
<td>' . $svc['svcTlsStpOperStatus'] . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end services view
if ($vars['view'] == 'saps') {
echo '<th><a title="The value of this object specifies the Service identifier.">Service Id</a></th>
<th><a title="The ID of the access port where this SAP is defined.">SAP Port</a></th>
<th><a title="The value of the label used to identify this SAP on the access port specified by sapPortId.">Encapsulation</a></th>
<th><a title="This object indicates the type of service where this SAP is defined.">Type</a></th>
<th><a title="Generic information about this SAP.">Description</a></th>
<th><a title="The desired state of this SAP.">Admin Status</a></th>
<th><a title="The value of the object sapOperStatus indicates the operating state of this SAP.">Oper Satatus</a></th>
<th><a title="The value of sysUpTime at the time of the most recent management-initiated change to this SAP.">Last Mgmt Change at</a></th>
<th><a title="The value of sysUpTime at the time of the most recent operating status change to this SAP.">Last Oper Change at</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT * FROM `mpls_saps` WHERE `device_id` = ? ORDER BY `device_id`, `svc_oid`, `sapPortId`, `sapEncapValue`', array($device['device_id'])) as $sap) {
$port = dbFetchRow('SELECT * FROM `ports` WHERE `device_id` = ? AND `ifName` = ?', [$sap['device_id'], $sap['ifName']]);
$port = cleanPort($port);
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($sap['sapAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($sap['sapOperStatus'] == 'up') {
$operstate_status_color = 'success';
} else {
$operstate_status_color = 'danger';
}
echo "<tr bgcolor=$bg_colour>
<td>" . $sap['svc_oid'] . '</td>
<td>' . generate_port_link($port) . '</td>
<td>' . $sap['sapEncapValue'] . '</td>
<td>' . $sap['sapType'] . '</td>
<td>' . $sap['sapDescription'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $sap['sapAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $sap['sapOperStatus'] . '</td>
<td>' . formatUptime($sap['sapLastMgmtChange']) . '</td>
<td>' . formatUptime($sap['sapLastStatusChange']) . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end sap view

View File

@@ -17,7 +17,7 @@ if ($vars['view'] == 'lsp') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('LSP', $link_array, array('view' => 'lsp'));
echo generate_link('LSPs', $link_array, array('view' => 'lsp'));
if ($vars['view'] == 'lsp') {
echo '</span>';
}
@@ -33,6 +33,50 @@ if ($vars['view'] == 'paths') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'sdps') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('SDPs', $link_array, array('view' => 'sdps'));
if ($vars['view'] == 'sdps') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'sdpbinds') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('SDP binds', $link_array, array('view' => 'sdpbinds'));
if ($vars['view'] == 'sdpbinds') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'services') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('Services', $link_array, array('view' => 'services'));
if ($vars['view'] == 'services') {
echo '</span>';
}
echo ' | ';
if ($vars['view'] == 'saps') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link('SAPs', $link_array, array('view' => 'saps'));
if ($vars['view'] == 'saps') {
echo '</span>';
}
print_optionbar_end();
echo '<div id="content">
@@ -180,4 +224,261 @@ if ($vars['view'] == 'paths') {
$i++;
}
echo '</table></div>';
}
} // end paths view
if ($vars['view'] == 'sdps') {
echo '<tr><th><a title="Device">Device</a></th>
<th><a title="Service Distribution Point identifier">SDP Id</a></th>
<th><a title="The value of destination object specifies the device name of the remote end of the tunnel defined by this SDP">Destination</a></th>
<th><a title="This object specifies the type of delivery used by this SDP">Type</a></th>
<th><a title="The value of sdpActiveLspType indicates the type of LSP that is currently active on this SDP. For sdpDelivery gre, the value is always not-applicable. For sdpDelivery mpls, the values can be rsvp, ldp, mplsTp, srIsis, srOspf, srTeLsp, fpe, bgp or none.">LSP Type</a></th>
<th><a title="Generic information about this SDP">Description</a></th>
<th><a title="The desired administrative state for this SDP">Admin State</a></th>
<th><a title="The current operational state of this SDP">Oper State</a></th>
<th><a title="This object specifies the desired largest service frame size (in octets) that can be transmitted through this SDP to the far-end ESR, without requiring the packet to be fragmented. The default value of zero indicates that the path MTU should be computed dynamically from the corresponding MTU of the tunnel.">Admin MTU</a></th>
<th><a title="This object indicates the actual largest service frame size (in octets) that can be transmitted through this SDP to the far-end ESR, without requiring the packet to be fragmented. In order to be able to bind this SDP to a given service, the value of this object minus the control word size (if applicable) must be equal to or larger than the MTU of the service, as defined by its svcMtu.">Oper MTU</a></th>
<th><a title="The value of sysUpTime at the time of the most recent management-initiated change to this SDP.">Last Mgmt Change at</a></th>
<th><a title="The value of sysUpTime at the time of the most recent operating status change to this SDP.">Last Status Change at</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT * FROM `mpls_sdps` ORDER BY `sdp_oid`') as $sdp) {
$device = device_by_id_cache($sdp['device_id']);
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($sdp['sdpAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($sdp['sdpOperStatus'] == 'up') {
$operstate_status_color = 'success';
} elseif ($sdp['sdpAdminStatus'] == 'up' && $sdp['sdpOperStatus'] == 'down') {
$operstate_status_color = 'danger';
}
$host = @dbFetchRow('SELECT * FROM `ipv4_addresses` AS A, `ports` AS I, `devices` AS D WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id', [$sdp['sdpFarEndInetAddress']]);
$destination = $sdp['sdpFarEndInetAddress'];
if (is_array($host)) {
$destination = generate_device_link($host, 0, array('tab' => 'routing', 'proto' => 'mpls'));
}
echo "<tr bgcolor=$bg_colour>
<td>" . generate_device_link($device, 0, array('tab' => 'routing', 'proto' => 'mpls')) . '</td>
<td>' . $sdp['sdp_oid'] . '</td>
<td>' . $destination . '</td>
<td>' . $sdp['sdpDelivery'] . '</td>
<td>' . $sdp['sdpActiveLspType'] . '</td>
<td>' . $sdp['sdpDescription'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $sdp['sdpAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $sdp['sdpOperStatus'] . '</td>
<td>' . $sdp['sdpAdminPathMtu'] . '</td>
<td>' . $sdp['sdpOperPathMtu'] . '</td>
<td>' . formatUptime($sdp['sdpLastMgmtChange']) . '</td>
<td>' . formatUptime($sdp['sdpLastStatusChange']) . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end sdps view
if ($vars['view'] == 'sdpbinds') {
echo '<tr><th><a title="Device">Device</a></th>
<th><a title="SDP Binding identifier. SDP identifier : Service identifier">SDP Bind Id</a></th>
<th><a title="This object specifies whether this Service SDP binding is a spoke or a mesh.">Bind Type</a></th>
<th><a title="The value of VC Type is an enumerated integer that specifies the type of virtual circuit (VC) associated with the SDP binding">VC Type</a></th>
<th><a title="The desired state of this Service-SDP binding.">Admin State</a></th>
<th><a title="The value of sdpBindOperStatus indicates the operating status of this Service-SDP binding.
up: The Service-SDP binding is operational.
noEgressLabel: The ingress label is available but the egress one is missing.
noIngressLabel:The egress label is available but the ingress one is not.
noLabels: Both the ingress and the egress labels are missing.
down: The binding is administratively down.
svcMtuMismatch: Both labels are available, but a service MTU mismatch was detected between the local and the far-end devices.
sdpPathMtuTooSmall: The operating path MTU of the corresponding SDP minus the size of the SDP Bind control word (if applicable) is smaller than the service MTU.
sdpNotReady: The SDPs signaling session is down.
sdpDown: The SDP is not operationally up.
sapDown: The SAP associated with the service is down.">Oper State</a></th>
<th><a title="The value of sysUpTime at the time of the most recent management-initiated change to this Service-SDP binding.">Last Mgmt Change at</a></th>
<th><a title="The value of the object sdpBindLastStatusChange indicates the value of sysUpTime at the time of the most recent operating status change to this SDP Bind.">Last Status Change at</a></th>
<th><a title="SDP Bind ingress forwarded packets">Ing Fwd Packets</a></th>
<th><a title="SDP Bind ingress forwarded octets">Ing Fwd Octets</a></th>
<th><a title="SDP Bind egress forwarded packets">Egr Fwd Packets</a></th>
<th><a title="SDP Bind egress forwarded octets">Egr Fwd Octets</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT * FROM `mpls_sdp_binds` ORDER BY `sdp_oid`, `svc_oid`') as $sdpbind) {
$device = device_by_id_cache($sdpbind['device_id']);
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($sdpbind['sdpBindAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($sdpbind['sdpBindOperStatus'] == 'up') {
$operstate_status_color = 'success';
} else {
$operstate_status_color = 'danger';
}
echo "<tr bgcolor=$bg_colour>
<td>" . generate_device_link($device, 0, array('tab' => 'routing', 'proto' => 'mpls')) . '</td>
<td>' . $sdpbind['sdp_oid'] . ':' . $sdpbind['svc_oid'] . '</td>
<td>' . $sdpbind['sdpBindType'] . '</td>
<td>' . $sdpbind['sdpBindVcType'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $sdpbind['sdpBindAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $sdpbind['sdpBindOperStatus'] . '</td>
<td>' . formatUptime($sdpbind['sdpBindLastMgmtChange']) . '</td>
<td>' . formatUptime($sdpbind['sdpBindLastStatusChange']) . '</td>
<td>' . $sdpbind['sdpBindBaseStatsIngFwdPackets'] . '</td>
<td>' . $sdpbind['sdpBindBaseStatsIngFwdOctets'] . '</td>
<td>' . $sdpbind['sdpBindBaseStatsEgrFwdPackets'] . '</td>
<td>' . $sdpbind['sdpBindBaseStatsEgrFwdOctets'] . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end sdpbinds view
if ($vars['view'] == 'services') {
echo '<tr><th><a title="Device">Device</a></th>
<th><a title="The value of this object specifies the Service identifier. This value should be unique within the service domain.">Service Id</a></th>
<th><a title="The value of this object specifies the service type: e.g. epipe, tls, etc.">Type</a></th>
<th><a title="The value of this object specifies the ID of the customer who owns this service.">Customer</a></th>
<th><a title="The value of this object specifies the desired state of this service.">Admin Status</a></th>
<th><a title="The value of this object indicates the operating state of this service. The requirements for a service to be operationally up depend on the service type:
epipe, apipe, fpipe, ipipe and cpipe services are up when the service is administratively up and either both SAPs or a SAP and a spoke SDP Bind are operationally up.
tls services are up when the service is administratively up and either at least one SAP or spoke SDP Bind or one mesh SDP Bind is operationally up.
tls service that has vxlan configuration is up when the service is administratively up.
ies services are up when the service is administratively up and at least one interface is operationally up.
vprn services are up when the service is administratively up however routing functionality is available only when TIMETRA-VRTR-MIB::vRtrOperState is up.">Oper Status</a></th>
<th><a title="The value of the object svcDescription specifiers an optional, generic information about this service.">Description</a></th>
<th><a title="The value of the object svcMtu specifies the largest frame size (in octets) that this service can handle. Setting svcMtu to a value of zero (0), causes the agent to recalculate the default MTU size. The default value of this object depends on the service type: 1514 octets for epipe and tls, 1508 for apipe and fpipe, and 1500 octets for vprn, ipipe and ies, 1514 octets for cpipe.">Service MTU</a></th>
<th><a title="The value of the object svcNumSaps indicates the number of SAPs defined on this service.">Num SAPs</a></th>
<th><a title="The value of of the object svcLastMgmtChange indicates the value of sysUpTime at the time of the most recent management-initiated change to this service.">Last Mgmt Change at</a></th>
<th><a title="The value of the object svcLastStatusChange indicates the value of sysUpTime at the time of the most recent operating status change to his service.">Last Status Change at</a></th>
<th><a title="The value of this object specifies, for a IES or VPRN service the associated virtual router instance where its interfaces are defined. This object has a special significance for the VPRN service as it can be used to associate the service to a specific virtual router instance. If no routing instance is specified or a value of zero (0) is specified, the agent will assign the vRtrID index value that would have been returned by the vRtrNextVRtrID object in the TIMETRA-VRTR-MIB">VRF</a></th>
<th><a title="The value specifies whether the MAC learning process is enabled in this TLS.">MAC Learning</a></th>
<th><a title="The value of the object svcTlsFdbTableSize specifies the maximum number of learned and static entries allowed in the FDB of this service. The maximum value of svcTlsFdbTableSize depends on the platform/chassis mode.">FDB Table Size</a></th>
<th><a title="The value of the object svcTlsFdbNumEntries indicates the current number of entries allocated in the FDB of this service.">FDB Entries</a></th>
<th><a title="The value of the object svcTlsStpAdminStatus specifies the administrative state of the Spanning Tree Protocol instance associated with this service.">STP Admin Status</a></th>
<th><a title="The value of the object svcTlsStpOperStatus indicates the operating status of the Spanning Tree Protocol instance associated with this service.">STP Oper Status</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT s.*, v.vrf_name FROM `mpls_services` AS s LEFT JOIN `vrfs` AS v ON `s`.`svcVRouterId` = `v`.`vrf_oid` AND `s`.`device_id` = `v`.`device_id` ORDER BY `svc_oid`') as $svc) {
$device = device_by_id_cache($svc['device_id']);
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($svc['svcAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($svc['svcOperStatus'] == 'up') {
$operstate_status_color = 'success';
} else {
$operstate_status_color = 'danger';
}
echo "<tr bgcolor=$bg_colour>
<td>" . generate_device_link($device, 0, array('tab' => 'routing', 'proto' => 'mpls')) . '</td>
<td>' . $svc['svc_oid'] . '</td>
<td>' . $svc['svcType'] . '</td>
<td>' . $svc['svcCustId'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $svc['svcAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $svc['svcOperStatus'] . '</td>
<td>' . $svc['svcDescription'] . '</td>
<td>' . $svc['svcMtu'] . '</td>
<td>' . $svc['svcNumSaps'] . '</td>
<td>' . formatUptime($svc['svcLastMgmtChange']) . '</td>
<td>' . formatUptime($svc['svcLastStatusChange']) . '</td>
<td>' . $svc['vrf_name'] . '</td>
<td>' . $svc['svcTlsMacLearning'] . '</td>
<td>' . $svc['svcTlsFdbTableSize'] . '</td>
<td>' . $svc['svcTlsFdbNumEntries'] . '</td>
<td>' . $svc['svcTlsStpAdminStatus'] . '</td>
<td>' . $svc['svcTlsStpOperStatus'] . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end services view
if ($vars['view'] == 'saps') {
echo '<tr><th><a title="Device">Device</a></th>
<th><a title="The value of this object specifies the Service identifier.">Service Id</a></th>
<th><a title="The ID of the access port where this SAP is defined.">SAP Port</a></th>
<th><a title="The value of the label used to identify this SAP on the access port specified by sapPortId.">Encapsulation</a></th>
<th><a title="This object indicates the type of service where this SAP is defined.">Type</a></th>
<th><a title="Generic information about this SAP.">Description</a></th>
<th><a title="The desired state of this SAP.">Admin Status</a></th>
<th><a title="The value of the object sapOperStatus indicates the operating state of this SAP.">Oper Satatus</a></th>
<th><a title="The value of sysUpTime at the time of the most recent management-initiated change to this SAP.">Last Mgmt Change at</a></th>
<th><a title="The value of sysUpTime at the time of the most recent operating status change to this SAP.">Last Oper Change at</a></th>
</tr>';
$i = 0;
foreach (dbFetchRows('SELECT * FROM `mpls_saps` ORDER BY `device_id`, `svc_oid`, `sapPortId`, `sapEncapValue`') as $sap) {
$port = dbFetchRow('SELECT * FROM `ports` WHERE `device_id` = ? AND `ifName` = ?', [$sap['device_id'], $sap['ifName']]);
$port = cleanPort($port);
$device = device_by_id_cache($sap['device_id']);
if (!is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
$adminstate_status_color = $operstate_status_color = 'default';
$failcode_status_color = 'warning';
if ($sap['sapAdminStatus'] == 'up') {
$adminstate_status_color = 'success';
}
if ($sap['sapOperStatus'] == 'up') {
$operstate_status_color = 'success';
} else {
$operstate_status_color = 'danger';
}
echo "<tr bgcolor=$bg_colour>
<td>" . generate_device_link($device, 0, array('tab' => 'routing', 'proto' => 'mpls')) . '</td>
<td>' . $sap['svc_oid'] . '</td>
<td>' . generate_port_link($port) . '</td>
<td>' . $sap['sapEncapValue'] . '</td>
<td>' . $sap['sapType'] . '</td>
<td>' . $sap['sapDescription'] . '</td>
<td><span class="label label-' . $adminstate_status_color . '">' . $sap['sapAdminStatus'] . '</td>
<td><span class="label label-' . $operstate_status_color . '">' . $sap['sapOperStatus'] . '</td>
<td>' . formatUptime($sap['sapLastMgmtChange']) . '</td>
<td>' . formatUptime($sap['sapLastStatusChange']) . '</td>';
echo '</tr>';
$i++;
}
echo '</table></div>';
} // end sap view

View File

@@ -919,6 +919,92 @@ mpls_lsp_paths:
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [lsp_path_id], Unique: true, Type: BTREE }
device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE }
mpls_saps:
Columns:
- { Field: sap_id, Type: 'int(10) unsigned', 'Null': false, Extra: auto_increment }
- { Field: svc_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: svc_oid, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: sapPortId, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: ifName, Type: varchar(255), 'Null': true, Extra: '' }
- { Field: device_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: sapEncapValue, Type: varchar(255), 'Null': true, Extra: '' }
- { Field: sapRowStatus, Type: 'enum(''active'',''notInService'',''notReady'',''createAndGo'',''createAndWait'',''destroy'')', 'Null': true, Extra: '' }
- { Field: sapType, Type: 'enum(''unknown'',''epipe'',''tls'',''vprn'',''ies'',''mirror'',''apipe'',''fpipe'',''ipipe'',''cpipe'',''intTls'',''evpnIsaTls'')', 'Null': true, Extra: '' }
- { Field: sapDescription, Type: varchar(80), 'Null': true, Extra: '' }
- { Field: sapAdminStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: sapOperStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: sapLastMgmtChange, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sapLastStatusChange, Type: bigint(20), 'Null': true, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [sap_id], Unique: true, Type: BTREE }
device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE }
mpls_sdps:
Columns:
- { Field: sdp_id, Type: 'int(10) unsigned', 'Null': false, Extra: auto_increment }
- { Field: sdp_oid, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: device_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: sdpRowStatus, Type: 'enum(''active'',''notInService'',''notReady'',''createAndGo'',''createAndWait'',''destroy'')', 'Null': true, Extra: '' }
- { Field: sdpDelivery, Type: 'enum(''gre'',''mpls'',''l2tpv3'',''greethbridged'')', 'Null': true, Extra: '' }
- { Field: sdpDescription, Type: varchar(80), 'Null': true, Extra: '' }
- { Field: sdpAdminStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: sdpOperStatus, Type: 'enum(''up'',''notAlive'',''notReady'',''invalidEgressInterface'',''transportTunnelDown'',''down'')', 'Null': true, Extra: '' }
- { Field: sdpAdminPathMtu, Type: int(11), 'Null': true, Extra: '' }
- { Field: sdpOperPathMtu, Type: int(11), 'Null': true, Extra: '' }
- { Field: sdpLastMgmtChange, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sdpLastStatusChange, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sdpActiveLspType, Type: 'enum(''not-applicable'',''rsvp'',''ldp'',''bgp'',''none'',''mplsTp'',''srIsis'',''srOspf'',''srTeLsp'',''fpe'')', 'Null': true, Extra: '' }
- { Field: sdpFarEndInetAddressType, Type: 'enum(''ipv4'',''ipv6'')', 'Null': true, Extra: '' }
- { Field: sdpFarEndInetAddress, Type: varchar(46), 'Null': true, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [sdp_id], Unique: true, Type: BTREE }
device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE }
mpls_sdp_binds:
Columns:
- { Field: bind_id, Type: 'int(10) unsigned', 'Null': false, Extra: auto_increment }
- { Field: sdp_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: svc_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: sdp_oid, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: svc_oid, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: device_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: sdpBindRowStatus, Type: 'enum(''active'',''notInService'',''notReady'',''createAndGo'',''createAndWait'',''destroy'')', 'Null': true, Extra: '' }
- { Field: sdpBindAdminStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: sdpBindOperStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: sdpBindLastMgmtChange, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sdpBindLastStatusChange, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sdpBindType, Type: 'enum(''spoke'',''mesh'')', 'Null': true, Extra: '' }
- { Field: sdpBindVcType, Type: 'enum(''undef'',''ether'',''vlan'',''mirrior'',''atmSduatmCell'',''atmVcc'',''atmVpc'',''frDlci'',''ipipe'',''satopE1'',''satopT1'',''satopE3'',''satopT3'',''cesopsn'',''cesopsnCas'')', 'Null': true, Extra: '' }
- { Field: sdpBindBaseStatsIngFwdPackets, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sdpBindBaseStatsIngFwdOctets, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sdpBindBaseStatsEgrFwdPackets, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: sdpBindBaseStatsEgrFwdOctets, Type: bigint(20), 'Null': true, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [bind_id], Unique: true, Type: BTREE }
device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE }
mpls_services:
Columns:
- { Field: svc_id, Type: 'int(10) unsigned', 'Null': false, Extra: auto_increment }
- { Field: svc_oid, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: device_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
- { Field: svcRowStatus, Type: 'enum(''active'',''notInService'',''notReady'',''createAndGo'',''createAndWait'',''destroy'')', 'Null': true, Extra: '' }
- { Field: svcType, Type: 'enum(''unknown'',''epipe'',''tls'',''vprn'',''ies'',''mirror'',''apipe'',''fpipe'',''ipipe'',''cpipe'',''intTls'',''evpnIsaTls'')', 'Null': true, Extra: '' }
- { Field: svcCustId, Type: 'int(10) unsigned', 'Null': true, Extra: '' }
- { Field: svcAdminStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: svcOperStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: svcDescription, Type: varchar(80), 'Null': true, Extra: '' }
- { Field: svcMtu, Type: int(11), 'Null': true, Extra: '' }
- { Field: svcNumSaps, Type: int(11), 'Null': true, Extra: '' }
- { Field: svcNumSdps, Type: int(11), 'Null': true, Extra: '' }
- { Field: svcLastMgmtChange, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: svcLastStatusChange, Type: bigint(20), 'Null': true, Extra: '' }
- { Field: svcVRouterId, Type: int(11), 'Null': true, Extra: '' }
- { Field: svcTlsMacLearning, Type: 'enum(''enabled'',''disabled'')', 'Null': true, Extra: '' }
- { Field: svcTlsStpAdminStatus, Type: 'enum(''enabled'',''disabled'')', 'Null': true, Extra: '' }
- { Field: svcTlsStpOperStatus, Type: 'enum(''up'',''down'')', 'Null': true, Extra: '' }
- { Field: svcTlsFdbTableSize, Type: int(11), 'Null': true, Extra: '' }
- { Field: svcTlsFdbNumEntries, Type: int(11), 'Null': true, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [svc_id], Unique: true, Type: BTREE }
device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE }
munin_plugins:
Columns:
- { Field: mplug_id, Type: 'int(10) unsigned', 'Null': false, Extra: auto_increment }

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,23 @@ mpls:
joins:
- { left: mpls_lsp_paths.lsp_id, right: mpls_lsps.lsp_id, select: [vrf_oid, lsp_oid] }
order_by: vrf_oid, lsp_oid, path_oid
mpls_sdps:
excluded_fields: [sdp_id, device_id]
order_by: sdp_oid
mpls_sdp_binds:
excluded_fields: [bind_id, sdp_id, svc_id, device_id]
joins:
- { left: mpls_sdp_binds.sdp_id, right: mpls_sdps.sdp_id, select: [mpls_sdps.sdp_oid] }
- { left: mpls_sdp_binds.svc_id, right: mpls_services.svc_id, select: [mpls_services.svc_oid] }
order_by: mpls_sdps.sdp_oid, mpls_services.svc_oid
mpls_services:
excluded_fields: [svc_id, device_id]
order_by: svc_oid
mpls_saps:
excluded_fields: [sap_id, svc_id, device_id]
joins:
- { left: mpls_saps.svc_id, right: mpls_services.svc_id, select: [mpls_services.svc_oid] }
order_by: mpls_services.svc_oid, mpls_saps.sapPortId, mpls_saps.sapEncapValue
ports:
ports:
excluded_fields: [device_id, port_id, poll_time, poll_period, ifVrf]
@@ -100,4 +117,4 @@ cisco-mac-accounting:
joins:
- { left: mac_accounting.port_id, right: ports.port_id, select: [ifIndex] }
custom_where: WHERE ports.device_id=?
order_by: ports.ifIndex, mac
order_by: ports.ifIndex, mac

File diff suppressed because it is too large Load Diff