Inventory License management in NetBox
Project description
NetBox License Plugin Documentation
This documentation is divided into two parts:
- User Guide – for administrators or users who interact with the plugin through the NetBox web interface.
- Developer Documentation – for developers maintaining, extending, or integrating the plugin.
Part 1: User Guide
Introduction
The NetBox License Plugin adds license management capabilities to NetBox. It allows users to track software and hardware licenses, define license types, assign licenses to devices or virtual machines, and monitor expiration dates and volume usage.
This guide explains how to use the plugin within the NetBox user interface.
Accessing the Plugin
Once installed, the plugin adds new sections to the NetBox navigation menu:
- Licenses
- License Types
- License Assignments
These can be found in the main menu or under the “Plugins” section, depending on your NetBox configuration.
License Types
What Are License Types?
License types define general properties shared by multiple licenses, such as:
- Name (e.g., Windows Server Standard, VMware vSphere)
- Volume type (e.g., per device, per core)
- Purchase model (e.g., perpetual, subscription)
- Optional: link to a base license (for expansion licenses)
Creating a License Type
-
Navigate to License Types.
-
Click Add.
-
Fill in the form:
- Name: descriptive name of the license type.
- Volume type: defines how the license should be counted.
- Purchase model: indicates whether it's a subscription, perpetual license, etc.
- License model: choose between "Base" or "Expansion".
- If "Expansion" is selected: choose the base license this one expands.
-
Click Create to save.
Licenses
Creating a License
-
Go to Licenses.
-
Click Add.
-
Complete the form:
- License key: the actual license code or key.
- License type: select from existing types.
- Volume: total quantity available (e.g., number of devices it can be used for).
- Start and expiration dates: for tracking duration.
- Optional: serial number, tags, comments.
-
Click Create.
Viewing a License
On the license detail page, you will see:
- General information (key, type, volume, etc.)
- Current assignments to devices or VMs
- Any linked child licenses (if expansion licenses exist)
- A progress bar showing how much of the license volume is currently in use
- Expiration status (active, expired, or expiring soon)
Assigning Licenses
To a Device or Virtual Machine
-
Navigate to License Assignments.
-
Click Add.
-
Fill in:
- License: select a license with available volume.
- Device or Virtual Machine: select one (not both).
- Assignment date (optional): set when the license was assigned.
- Volume used: number of units used in this assignment (e.g., 1 device = 1 unit).
-
Click Create.
Note: The form automatically prevents over-assignment of licenses beyond their total volume.
Editing or Removing Assignments
- Use the list view to edit or delete existing assignments.
- You can also navigate to a license’s detail page to manage assignments directly from there.
Tracking License Expiration
- Expiration dates are shown on each license’s detail page.
- Licenses are automatically marked as expired once the expiration date has passed.
- A built-in job (
check_expiring_licenses.py) is available to detect expiring licenses. This can be extended to send alerts or generate reports.
Bulk Operations
The plugin supports bulk editing and importing for:
- License Types
- Licenses
- Assignments
You can:
- Use checkboxes in list views and select Bulk Edit or Bulk Delete
- Import records via CSV using the Import button in each section
Best Practices
- Use License Types to avoid duplication and simplify license management.
- Keep expiration dates and volume limits up to date.
- Regularly review the license usage to avoid overuse or expiration.
- Use tags to organize licenses by department, function, or purpose.
Troubleshooting
| Problem | Solution |
|---|---|
| License cannot be assigned | Make sure there is available volume and a valid expiration date. |
| Form doesn't show the expected device/VM | Check if it's already assigned, or if filters are hiding it. |
| License is shown as expired | Verify the expiration date on the license detail page. |
FAQ
Can I assign one license to multiple devices?
Yes, as long as the license volume allows it. Each assignment consumes part of the license volume.
What happens when a license expires?
The license is marked as expired in the UI. Assignments remain, but the status reflects its expiration.
Can I track licenses per CPU core or VM instead of per device?
Yes. Use the volume type in the License Type to define how volume is counted.
How do I handle expansion licenses?
Create a License Type with model "Expansion" and link it to a base license type.
Need Help?
If you experience issues or need support, contact your NetBox administrator or plugin maintainer.
Part 2: Developer Documentation
Overview
The netbox_license plugin extends NetBox with a full-featured license management system. It allows users to create, edit, assign, and manage software and hardware licenses, including license types, volume tracking, expiration handling, and assignments to devices or virtual machines.
This documentation is intended for developers who want to understand, maintain, or extend the plugin.
Plugin Structure
Top-Level Files
| File | Purpose |
|---|---|
__init__.py |
Marks the directory as a Python package. |
choices.py |
Contains enums and choice fields for models and forms. |
jobs.py |
Defines scheduled or background jobs, such as license expiration checks. |
navigation.py |
Integrates the plugin into the NetBox UI menu. |
tables.py |
Defines table layouts and columns for object list views. |
template_content.py |
Adds additional context to templates via context processors. |
urls.py |
Routes URLs to views for licenses, license types, and assignments. |
version.py |
Stores the plugin version for compatibility purposes. |
Key Subfolders
models/
license.py: Defines theLicensemodel with key, volume, dates, relationships.licensetype.py: Defines types of licenses (base or expansion).licenseassignment.py: Assigns licenses to devices or virtual machines.
views/
license.py,licenseassignment.py,licensetype.py: CRUD views for all major models.
forms/
bulk_edit.py,bulk_import.py,filtersets.py,models.py: Forms for input, import, and filtering.
filtersets/
- Filter classes for each model used in views and APIs.
tables/
- Table definitions for list views in the UI.
api/
- REST API serializers, viewsets, and routing.
graphql/
- GraphQL types, filters, and schema configuration.
migrations/
- Database migrations for schema creation and updates.
management/commands/
- Includes
check_expiring_licenses.pyto identify upcoming expirations.
templates/netbox_license/
- Jinja2 templates for forms, detail views, and list pages.
utils/
- Utility functions shared across the plugin.
Component Overview
| Component | Responsibility |
|---|---|
| Models | Define the structure for License, LicenseType, and LicenseAssignment. |
| Migrations | Create and update the database schema. |
| Forms and Filtersets | Provide input validation and filtering for the UI and API. |
| Views | Handle HTTP requests and render templates. |
| Templates | Display content in the NetBox web interface. |
| Tables | Format object list views. |
| API and GraphQL | Expose data for integration and automation. |
| Management Commands | Automate scheduled and background tasks. |
| Navigation and Templates | Integrate the plugin into the NetBox UI. |
Development and Maintenance Tips
- To add new fields: update the model, create a migration, and update all related forms, templates, serializers, and filters.
- When changing relationships: check all affected components.
- To extend the API: modify or create new serializers and viewsets in
api/. - To update the UI: modify templates and tables as needed.
- To add features: follow the plugin structure from model to view.
- Always test changes with
python manage.py testand apply migrations withpython manage.py migrate.
Installation (Developer Setup)
# In NetBox configuration:
PLUGINS = ['netbox_license']
PLUGINS_CONFIG = {
'netbox_license': {
# Optional plugin settings
}
}
# Installation:
$ git clone <plugin-url> netbox/netbox_license
$ pip install -e .
$ python manage.py migrate
$ systemctl restart netbox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netbox_license-2.5.4.tar.gz.
File metadata
- Download URL: netbox_license-2.5.4.tar.gz
- Upload date:
- Size: 35.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3737a3d2f63bbd77228b2250c2bb734f34333edf82d8028a994a9bb5f131ffcd
|
|
| MD5 |
64c16819eef55c5e22d9e4bbc5e7ffc0
|
|
| BLAKE2b-256 |
dfcb132255d986117c200d9632807c73c3f8ada8736b18e3ec69f257344f7408
|
Provenance
The following attestation bundles were made for netbox_license-2.5.4.tar.gz:
Publisher:
publish.yml on BartZimmo/netbox_license
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_license-2.5.4.tar.gz -
Subject digest:
3737a3d2f63bbd77228b2250c2bb734f34333edf82d8028a994a9bb5f131ffcd - Sigstore transparency entry: 1764824205
- Sigstore integration time:
-
Permalink:
BartZimmo/netbox_license@40722064d03fe9c6b76ae30c0962be9694a2ddc7 -
Branch / Tag:
refs/tags/v2.5.4 - Owner: https://github.com/BartZimmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40722064d03fe9c6b76ae30c0962be9694a2ddc7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file netbox_license-2.5.4-py3-none-any.whl.
File metadata
- Download URL: netbox_license-2.5.4-py3-none-any.whl
- Upload date:
- Size: 51.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a92d28fd4752edda297394c5d82e613daadcdf0cfbaa5ff0eaa224354e7a7bea
|
|
| MD5 |
24bb46b336b27a9e260b6b77325696d9
|
|
| BLAKE2b-256 |
e0325a7ff1f315c5b2ed614df636135d074f870ee3995bab1d661da2f157288a
|
Provenance
The following attestation bundles were made for netbox_license-2.5.4-py3-none-any.whl:
Publisher:
publish.yml on BartZimmo/netbox_license
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_license-2.5.4-py3-none-any.whl -
Subject digest:
a92d28fd4752edda297394c5d82e613daadcdf0cfbaa5ff0eaa224354e7a7bea - Sigstore transparency entry: 1764824415
- Sigstore integration time:
-
Permalink:
BartZimmo/netbox_license@40722064d03fe9c6b76ae30c0962be9694a2ddc7 -
Branch / Tag:
refs/tags/v2.5.4 - Owner: https://github.com/BartZimmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40722064d03fe9c6b76ae30c0962be9694a2ddc7 -
Trigger Event:
release
-
Statement type: