Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
689 B
PHP
Raw Permalink Normal View History

2018-08-11 23:37:45 +02:00
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use LibreNMS\Interfaces\SnmptrapHandler;
2018-08-14 01:56:16 -05:00
use LibreNMS\Snmptrap\Handlers\Fallback;
2018-08-11 23:37:45 +02:00
class SnmptrapProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->bind(SnmptrapHandler::class, function ($app, $options) {
$oid = reset($options);
2020-09-21 14:54:51 +02:00
return $app->make(config('snmptraps.trap_handlers')[$oid] ?? Fallback::class);
2018-08-11 23:37:45 +02:00
});
}
}