3.0 KiB
Plugins
Plugins are packaged Django apps that can be installed alongside NetBox to provide custom functionality not present in the core application. Plugins can introduce their own models and views, but cannot interfere with existing components. A NetBox user may opt to install plugins provided by the community or build his or her own.
Plugins are supported on NetBox v2.8 and later.
Capabilities
The NetBox plugin architecture allows for the following:
- Add new data models. A plugin can introduce one or more models to hold data. (A model is essentially a SQL table.)
- Add new URLs and views. Plugins can register URLS under the
/plugins
root path to provide browsable views for users. - Add content to existing model templates. A template content class can be used to inject custom HTML content within the view of a core NetBox model. This content can appear in the left side, right side, or bottom of the page.
- Add navigation menu items. Each plugin can register new links in the navigation menu. Each link may have a set of buttons for specific actions, similar to the built-in navigation items.
- Add custom middleware. Custom Django middleware can be registered by each plugin.
- Declare configuration parameters. Each plugin can define required, optional, and default configuration parameters within its unique namespace.
- Limit installation by NetBox version. A plugin can specify a minimum and/or maximum NetBox version with which it is compatible.
Limitations
Either by policy or by technical limitation, the interaction of plugins with NetBox core is restricted in certain ways. These include:
- Modify core models. Plugins may not alter, remove, or override core NetBox models in any way. This rule is in place to ensure the integrity of the core data model.
- Register URLs outside the
/plugins
root.` All plugin URLs are restricted to this path to prevent name/path collisions. - Override core templates. The only avenue available for injecting content into core templates is the provided
- Modify core settings. A configuration registry is provided for plugins, however they cannot alter or delete the core configuration.
- Disable core components. Plugins are not permitted to disable or hide core NetBox components.
Installing Plugins
The instructions below detail the process for installing and enabling a NetBox plugin.
Install Package
TODO
Enable Plugins
In configuration.py
, set the PLUGINS_ENABLED
parameter to True (if not already set):
PLUGINS_ENABLED = True
Configure Plugin
If the plugin requires any configuration, define it in configuration.py
under the PLUGINS_CONFIG
parameter. The available configuration parameters should be detailed in the plugin's README file.
PLUGINS_CONFIG = {
'plugin_name': {
'foo': 'bar',
'buzz': 'bazz'
}
}
Restart WSGI Service
Restart the WSGI service to detect the new plugin:
# sudo systemctl restart netbox