mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
35 lines
689 B
PHP
35 lines
689 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use LibreNMS\Interfaces\SnmptrapHandler;
|
|
use LibreNMS\Snmptrap\Handlers\Fallback;
|
|
|
|
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);
|
|
|
|
return $app->make(config('snmptraps.trap_handlers')[$oid] ?? Fallback::class);
|
|
});
|
|
}
|
|
}
|