Skip to main content

Dynamically reload NetBox plugins without server restart

Project description

NetBox Plugin Reloader

A NetBox plugin that dynamically reloads plugins without requiring a server restart. This plugin ensures that NetBox properly registers all plugin models and form fields that might have been missed during the initial application startup.

Features

  • Dynamically registers plugin models that were missed during server startup
  • Refreshes custom field form definitions to include newly registered models
  • Helps solve integration issues between NetBox and other plugins
  • No configuration required - works out of the box

Compatibility Matrix

NetBox Version Plugin Version
4.2.x 0.0.2

Installation

The plugin is available as a Python package on PyPI and can be installed with pip:

pip install netbox-plugin-reloader

To enable the plugin, add it to the PLUGINS list in your configuration.py:

PLUGINS = [
    'other_plugin',
    'another_plugin',
    'netbox-plugin-reloader',  # Always add netbox_plugin_reloader last!
]

After installing the plugin:

  1. Restart NetBox:

    sudo systemctl restart netbox
    
  2. Ensure that netbox-plugin-reloader is included in your local_requirements.txt if you're using the official NetBox installation method.

For more details, see the NetBox Documentation.

Important Note

netbox_plugin_reloader must be the last item in your PLUGINS list! This ensures that it can properly detect and register all models from other plugins that may have been missed during the initial startup process.

How It Works

When NetBox starts, Plugin Reloader:

  1. Scans all enabled plugins for models that aren't properly registered in NetBox's feature registry
  2. Registers any missed models with NetBox's registration system
  3. Refreshes form field definitions to ensure they include all registered models

This helps resolve issues where plugins might not fully integrate with NetBox due to load order problems without requiring a server restart.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Jan Krupa jan.krupa@cesnet.cz

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_plugin_reloader-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file netbox_plugin_reloader-0.0.2.tar.gz.

File metadata

  • Download URL: netbox_plugin_reloader-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.28.2 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.14 CPython/3.10.12

File hashes

Hashes for netbox_plugin_reloader-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5cf0f8d16f0e5b8ee22eaa06d007a3e7474fb207fce46e09f9b3c9b138224211
MD5 106ed9a8b2cdaacac2d6c4bbf122596a
BLAKE2b-256 cb02383a5ba2ad9a9782202e5cf824dff1f5aaf8dc60f71147118782641f54e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page