The NetBox LibreNMS Plugin enables integration between NetBox and LibreNMS, allowing you to leverage data from both systems. NetBox remains the Source of Truth (SoT) for you network, but this plugin allows you to easily onboard device objects from existing data in LibreNMS. The plugin does not automatically create objects in NetBox to ensure only verified data is used to populate NetBox.
This is in early development.
The plugin offers the following key features:
Pull interface data from Devices and Virtual Machines from LibreNMS into NetBox. The following interface attributes are synchronized:
- Name
- Description
- Status (Enabled/Disabled)
- Type (with custom mapping support)
- Speed
- MTU
- MAC Address
Set custom mappings for interface types to ensure that the correct interface type is used when syncing from LibreNMS to NetBox.
Create cable connection in NetBox from LibreNMS links data.
- Add device to LibreNMS from Netbox device page. Only SNMP v2c available.
The plugin also supports synchronizing NetBox Sites with LibreNMS locations:
- Compare NetBox sites to LibreNMS location data
- Create LibreNMS locations to match NetBox sites
- Update existing LibreNMS locations langitude and longitude values based on NetBox data
- Sync device site to LibreNMS location
There's more to do! Coding is not my day job. Bugs will exist and imporvements will be needed. So contributions are very welcome! I've got more ideas for new features and imporvements but please contribute if you can!
Or just share your ideas for the plugin over in discussions.
NetBox Version | Plugin Version |
---|---|
4.1 | 0.2.x - 0.3.x |
Netbox 4.1+ is required.
Activate your virtual environment and install the plugin:
source /opt/netbox/venv/bin/activate
Install with pip:
(venv) $ pip install netbox-librenms-plugin
Add to your local_requirements.txt
to ensure it is automatically reinstalled during future upgrades.
"netbox-librenms-plugin" >> /opt/netbox/local_requirements.txt
For adding to a NetBox Docker setup see how to create a custom Docker image. the general instructions for using netbox-docker with plugins.
Add the plugin to plugin_requirements.txt
(netbox-docker):
# plugin_requirements.txt
netbox-librenms-plugin
Enable the plugin in /opt/netbox/netbox/netbox/configuration.py
,
or if you use netbox-docker, your /configuration/plugins.py
file :
PLUGINS = [
'netbox_librenms_plugin'
]
PLUGINS_CONFIG = {
'netbox_librenms_plugin': {
'librenms_url': 'https://your-librenms-instance.com',
'api_token': 'your_librenms_api_token',
'cache_timeout': 300,
'verify_ssl': True, # Optional: Change to False if needed,
'interface_name_field': 'ifDescr', # Optional: LibreNMS field used for interface name. ifName used as default
}
}
Apply database migrations with Netbox manage.py
:
(venv) $ python manage.py migrate
The plugin includes static files that need to be collected by NetBox. Run the following command to collect static files:
(venv) $ python manage.py collectstatic --no-input
Restart the Netbox service to apply changes:
sudo systemctl restart netbox
It is recommended (but not essential) to add a custom field librenms_id
to the Device, Virtual Machine and Interface models in NetBox. Use the following settings:
- Object Types:
- Check dcim > device
- Check virtualization > virtual machine
- Check dcim > interface
- Name:
librenms_id
- Label:
LibreNMS ID
- Description: (Optional) Add a description like "LibreNMS ID for LibreNMS Plugin".
- Type: Integer
- Required: Leave unchecked.
- Default Value: Leave blank.
For more info check out custom field docs
See the instructions for uninstalling plugins.
Based on the NetBox plugin tutorial and docs:
This package was created with Cookiecutter. Thanks to the netbox-community/cookiecutter-netbox-plugin
for the project template.