https://github.com/librenms/plugin-interfaces
Interfaces for LibreNMS plugins
https://github.com/librenms/plugin-interfaces
Last synced: 4 months ago
JSON representation
Interfaces for LibreNMS plugins
- Host: GitHub
- URL: https://github.com/librenms/plugin-interfaces
- Owner: librenms
- License: 0bsd
- Created: 2024-08-15T14:31:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T15:26:39.000Z (almost 2 years ago)
- Last Synced: 2025-10-28T19:39:40.468Z (8 months ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LibreNMS Plugin Interfaces
Plugins for [LibreNMS](https://librenms.org) 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:
```php
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.
}
```