librenms/plugin-interfaces

Interfaces required to create a LibreNMS Plugin

Installs: 133 625

Dependents: 6

Suggesters: 0

Security: 0

Stars: 0

Watchers: 4

Forks: 1

Open Issues: 0

pkg:composer/librenms/plugin-interfaces

1.0 2024-08-15 15:23 UTC

This package is auto-updated.

Last update: 2025-09-15 17:59:56 UTC


README

Plugins for LibreNMS https://github.com/librenms/librenms

Create a new Laravel Package as described: https://laravel.com/docs/packages

Require this package

composer require librenms/plugin-interfaces

Register your plugin with LibreNMS in your provider boot method and check to see if it is enabled:

    public function boot(): void
    {
        $pluginName = 'example-plugin';
        $pluginManager = $this->app->make(\LibreNMS\Interfaces\Plugins\PluginManagerInterface::class);

        $pluginManager->publishHook($pluginName, \LibreNMS\Interfaces\Plugins\MenuEntryHook::class, MenuEntryHook::class);

        if (! $pluginManager->pluginEnabled($pluginName)) {
            return; // if plugin is disabled, don't boot
        }

        // Do regular Laravel Package actions here, such as register routes and views or publish files.
    }