A simple device map with filter criteria
Project description
NetBox device map
A simple device map plugin with filtering criteria for NetBox
Installation
Requirements
The plugin has been tested and confirmed works on NetBox versions from 3.2 to 3.5 and Python versions from 3.10 to 3.11.
Steps
- If your NetBox installation uses virtualenv, activate it like this:
source /opt/netbox/venv/bin/activate
- Install the plugin.
To ensure plugin is automatically re-installed during future NetBox upgrades, create a file named local_requirements.txt
(if not already existing) in the NetBox root directory
and list the nextbox-plugin-device-map
package:
- Option A: if you want to install it from PyPI:
echo netbox-plugin-device-map | sudo tee -a /opt/netbox/local_requirements.txt
- Option B: if you manually downloaded the plugin distribution from releases:
echo "/path/to/netbox-plugin-device-map.tar.gz" | sudo tee -a /opt/netbox/local_requirements.txt
Then run:
sudo pip install -U -r /opt/netbox/local_requirements.txt
to install the plugin.
- Collect static files:
sudo python /opt/netbox/netbox/manage.py collectstatic
- To enable plugin, add the plugin's name to the PLUGINS list in
configuration.py
(it's usually located in/opt/netbox/netbox/netbox/
) like so:
PLUGINS = [
'netbox_device_map'
]
- Restart NetBox WSGI service to apply changes:
sudo systemctl restart netbox
Configuration
You can customize plugin behavior according to your needs. For example, change the custom field that contains device coordinates or install custom map tiles.
Update PLUGINS_CONFIG parameter in the configuration.py
like this:
PLUGINS_CONFIG = {
'netbox_device_map': {
'device_geolocation_cf': 'coordinates',
'cpe_device_role': 'CPE',
'geomap_settings': {
'attribution': '<a href="https://osm.yourdomain.net">Your company</a> | © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
'tiles': {
'url_template': 'https://osm.yourdomain.net/hot/{z}/{x}/{y}.png',
'options': {
'maxZoom': 19
}
}
}
}
}
Settings
Setting | Default value | Description |
---|---|---|
device_geolocation_cf | geolocation |
NetBox custom field for storing geographical location of devices (in the "<latitude>,<longitude>" format) |
cpe_device_role | CPE |
Name of the NetBox device role that contains CPE devices |
geomap_settings | … | Geographical map settings |
Geographical map settings
Setting | Default value | Description |
---|---|---|
attribution | Data by © <a href="https://openstreetmap.org">OpenStreetMap</a> |
Attribution text in the lower right corner of the map |
crs | EPSG3857 |
Coordinate reference system |
tiles | … | Tiles layer settings |
Custom tiles layer settings:
Setting | Example value | Description |
---|---|---|
url_template | https://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png |
{s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates. {r} can be used to add "@2x" to the URL to load retina tiles. |
options | {'subdomains' : ['a', 'b', 'c'], 'minZoom': 0, 'maxZoom': 18} |
Leaflet TileLayer options |
Acknowledgements
Leaflet plugins
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
Built Distribution
File details
Details for the file netbox-plugin-device-map-0.1.3.tar.gz
.
File metadata
- Download URL: netbox-plugin-device-map-0.1.3.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6315c92378bbcc0b93e99e5e8dda7ff222bd7046782ff02800f20a292448089d |
|
MD5 | bc8520584e67b286190c13989ff5ca57 |
|
BLAKE2b-256 | 1830dbc3d5f40e93db192e4699ac8cf8bc79360b2564cd22db855739d559071f |
File details
Details for the file netbox_plugin_device_map-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: netbox_plugin_device_map-0.1.3-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9250fcaaeb329f346584e6a82303e62bc7dbdb760c58b36fbe2136cae151864 |
|
MD5 | 57d663b5500c0d7a6b027d24c999688e |
|
BLAKE2b-256 | 60f546a723b6527fd642b92287470c09472ed62614054a4d13853a7bd9a37b7b |