Add MPLS Support (#10263)

* WIP - Add MPLS Support
This introduce the generic MPLS support
- New database tables for MPLS LSPs
- actually discovery and polling on NOKIA SR OS (Timetra) devices
- new routing->MPLS HTML pages

- ToDo MPLS LSP paths table and views
Suggestions and improvements are welcome

* add db schema

* some fixes

* add path table, discovery and polling

* add path views

* add test data

* Convert MPLS module to new style
Implement a SyncsModels trait to simplify code a lot

* abs() for negative value from snmp (bug?), test data

* fix db schema

* Fix up test data, remove uneeded data in json

* fix whitespace
This commit is contained in:
Vitali Kari
2019-06-06 23:12:13 +02:00
committed by Tony Murray
parent 2f96570c3f
commit 00b148dbd3
29 changed files with 17012 additions and 3899 deletions

View File

@@ -26,9 +26,24 @@
namespace LibreNMS\Util;
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Support\Str;
class ModuleModelObserver
{
/**
* Install observers to output +, -, U for models being created, deleted, and updated
*
* @param string $model The model name including namespace
*/
public static function observe($model)
{
$model = Str::start($model, '\\');
// discovery output (but don't install it twice (testing can can do this)
if (!$model::getEventDispatcher()->hasListeners('eloquent.created: ' . ltrim('\\', $model))) {
$model::observe(new ModuleModelObserver());
}
}
public function saving(Eloquent $model)
{
if (!$model->isDirty()) {