# Netbox Topology Views Plugin
![Version](https://img.shields.io/pypi/v/netbox-topology-views) ![Downloads](https://img.shields.io/pypi/dm/netbox-topology-views)
Create topology views/maps from your devices in NetBox.
The connections are based on the cables you created in NetBox.
Support to filter on name, site, tag and device role.
Options to export to xml (for draw.io/diagrams.net) or png.
## Preview
![Topology with light mode](doc/img/topology_light.png)
![Topology with dark mode](doc/img/topology_dark.png)
## Install
**_NOTE:_** For docker please see: [Docker install](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins)
**_NOTE:_** Add `RUN mkdir -p /opt/netbox/netbox/static/netbox_topology_views/img` to the Dockerfile-Plugins file to create the image folder
The plugin is available as a Python package and can be installed with pip.
Run `pip install netbox-topology-views` in your virtual env.
To ensure NetBox Topology Views plugin is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the NetBox root directory (alongside `requirements.txt`) and list the `netbox-topology-views` package:
```no-highlight
# echo netbox-topology-views >> local_requirements.txt
```
Once installed, the plugin needs to be enabled in your `configuration.py`
```python
# In your configuration.py
PLUGINS = ["netbox_topology_views"]
```
First run `source /opt/netbox/venv/bin/activate` to enter the Python virtual environment.
Then run
```bash
cd /opt/netbox/netbox
pip3 install netbox-topology-views
python3 manage.py migrate netbox_topology_views
python3 manage.py collectstatic --no-input
```
### Versions
| netbox version | netbox-topology-views version |
| -------------- | ----------------------------- |
| >= 4.1.0 | >= v4.1.0 |
| >= 4.0.0 | >= v4.0.0 |
| >= 3.7.0 | >= v3.9.0 |
| >= 3.6.4 | >= v3.8.1 |
| >= 3.6.0 | >= v3.7.X |
| >= 3.5.0 | >= v3.4.X |
| >= 3.4.0 | >= v3.X.X |
| >= 3.3.0 | >= v3.0.0 |
| >= 3.2.0 | >= v1.1.0 |
| >= 3.1.8 | >= v1.0.0 |
| >= 2.11.1 | >= v0.5.3 |
| >= 2.10.0 | >= v0.5.0 |
| < 2.10.0 | =< v0.4.10 |
### Update
Run `pip install netbox-topology-views --upgrade` in your venv.
Run `python3 manage.py migrate netbox_topology_views`
Run `python3 manage.py collectstatic --no-input`
Clear you browser cache.
## Configure
### Individual Options
All individual options can be assigned a default value per user directly in the plugin. The default value can be overridden on the filter page.
![Individual Options](doc/img/topology_individual_options.png)
The remaining options must be configured in the `PLUGINS_CONFIG` section of your `netbox/configuration.py`.
Example:
```
PLUGINS_CONFIG = {
'netbox_topology_views': {
'static_image_directory': 'netbox_topology_views/img',
'allow_coordinates_saving': True,
'always_save_coordinates': True
}
}
```
| Setting | Default value | Description |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| static_image_directory | netbox_topology_views/img | (str or pathlib.Path) Specifies the location that images will be loaded from by default. Must be within `STATIC_ROOT` |
| allow_coordinates_saving | False | (bool) Set to true if you want to enable the ability to save the coordinates. |
| always_save_coordinates | False | (bool) Set if you want to enable the option to save coordinates by default. Setting allow_coordinates_saving to true is mandatory. |
### Custom field: coordinates
There is also support for custom fields.
>**_Note:_** The custom field "coordinates" is deprecated and will be removed in the future. Please use Coordinate Groups instead.
If you create a custom field "coordinates" for "dcim > device" and "Circuits > circuit" with type "text" and name "coordinates" you will see the same layout every time. It is recommended to set this field to "UI visibility" "Hidden" and let the plugin manage it in the background.
The coordinates are stored as: "X;Y".
> Please read the "Configure" chapter to set the `allow_coordinates_saving` option to True.
You might also set the `always_save_coordinates` option to True.
### Convert custom field to Coordinate Groups
Please note that values stored in the custom field "coordinates" are not being converted to Coordinate Groups automatically. A pragmatic way to do this conversion yourself is as follows:
+ Navigate to "Topology" > "Filters".
+ Select "Show Unconnected" and "Show Cables".
+ Leave all other filter settings alone. We want all entries to be displayed!
+ Click "Search" and wait for the results to be displayed
+ Select all nodes. This can be done by holding down the Shift key and dragging a frame around all icons with the left mouse button.
+ Drag the selection a tiny bit to the side. This causes all coordinates for all devices to be stored in the "default" group.
> **_Hint_**: Don't wait too long after clicking an icon in order to drag. If you hold the mouse button for too long before dragging starts, the selection is reset._
+ Storing the values might take some time, depending on the number of devices. Please be patient and check "Coordinates" in order to make sure that everthing has been stored.
+ It is save to delete the custom field now.
### Custom Images
To change image with associated device use the `Images` page - it allows to map a device role with an image found in the NetBox static directory (defined by the plugin config `static_image_directory` which defaults to `netbox_topology_views/img`). You can also upload you own custom images to there - these images will automatically be used for a device (if it does not already have a specified image in the settings) if their name is the device role slug.
![Images](doc/img/topology_images.png)
## Use
Go to the plugins tab in the navbar and click topology or go to `$NETBOX_URL/plugins/netbox_topology_views/` to view your topologies
Select your options for the topology view:
![Filter Options](doc/img/topology_filter_options.png)
<dl>
<dt>Coordinate Group</dt>
<dd>Select Coordinate Group. These groups allow devices to be displayed in different positions depending on the group, thus providing different representations for the same topology. If nothing is selected, the group "default" is set automatically.</dd>
<dt>Save Coordinates</dt>
<dd>Save the coordinates of devices in the topology view.</dd>
<dt>Show Unconnected</dt>
<dd>Show devices that have no connections or for which no connection is displayed. This option depends on other parameters like 'Show Cables' and 'Show Logical Connections'.</dd>
<dt>Show Cables</dt>
<dd>Show connections between interfaces, front / rear ports, etc., that are connected with one or more cables. These connections are displayed as solid lines in the color of the cable.</dd>
<dt>Show Logical Connections</dt>
<dd>Show logical connections between interfaces (referred to as Interface Connections in NetBox) in the topology view. Where the path between
interfaces includes multiple cables (e.g., via patch panels), only the end interface connections are shown, not the
intermediate front / rear port connections, etc. This is similar to what was referred to as 'end-to-end' connections in previous versions. These connections are displayed as yellow dotted lines.</dd>
<dt>Show redundant Cable and Logical Connection</dt>
<dd>Shows a logical connection (in addition to a cable), even if a cable is directly connected. Leaving this option disabled prevents that redundant display. This option only has an effect if 'Show Logical Connections' is activated.</dd>
<dt>Show Neighbors</dt>
<dd>Adds neighbors to the filter result set automatically. Link peers will be added if 'Show Cables' is ticked, far-end terminations will be added if 'Show Logical Connections' is ticked.</dd>
<dt>Show Circuit Terminations</dt>
<dd>Show connections which end at a circuit termination in the topology view. These connections are displayed as blue dashed lines.</dd>
<dt>Show Power Feeds</dt>
<dd>Displays connections between power outlets and power ports. These connections are displayed as solid lines in the color of the cable. This option depends on 'Show Cables'.</dd>
<dt>Show Wireless Links</dt>
<dd>Displays wireless connections. These connections are displayed as blue dotted lines.</dd>
</dl>
### Coordinates and Coordinate Groups
Netbox Topology Views stores the position of the devices. In order to allow different representations for the topology, Coordinate Groups are supported.
> Please read the "Configure" chapter to set the `allow_coordinates_saving` option to True.
You might also set the `always_save_coordinates` option to True.
Navigate to "Coordinate Groups" in the menu and create as many groups as you like. You can select a group later in the filter pane in order to show icon positions according to this group (see chapter "Use"). You can also omit creating a group if you don't need this feature. Netbox Topology Views automatically creates a group named "default" for you and stores all coordinates in this group, even if you do not select a group in the filter.
By default, the position of the devices are calculated with a physics engine. As soon as a device icon is dragged to another location, its position is saved and excluded from the calculation by the physics engine. All saved coordinates can be viewed and edited under the menu item "Coordinates".
> **_Note:_** At the time of writing, it is not possible to store the positions of circuit terminations, power panels and power feeds, as these are not devices.
### Permissions
To view `/plugins/netbox_topology-views/topology` you need the following permissions:
+ dcim | device | can view device
+ dcim | site | can view site
+ extras | tag | can view tag
+ dcim | device role | can view device role
To save `Coordinates` when moving icons:
+ netbox_topology_views | coordinate | change
To view `/plugins/netbox_topology-views/images`:
+ dcim | site | view
+ dcim | device role | view
+ dcim | device role | add
+ dcim | device role | change
To view `/plugins/netbox_topology-views/individualoptions`:
+ netbox_topology_views | individual options | change
Set `Coordinate Groups` according to your needs:
+ netbox_topology_views | coordinate groups | view/add/change/delete
Set `Coordinates` according to your needs:
+ netbox_topology_views | coordinate | view/add/change/delete
Set `Power Feed Coordinates` according to your needs:
+ netbox_topology_views | power feed coordinate | view/add/change/delete
Set `Power Panel Coordinates` according to your needs:
+ netbox_topology_views | power panel coordinate | view/add/change/delete
Set `Circuit Coordinates` according to your needs:
+ netbox_topology_views | circuit coordinate | view/add/change/delete
Raw data
{
"_id": null,
"home_page": "https://github.com/mattieserver/netbox-topology-views",
"name": "netbox-topology-views",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "netbox-plugin",
"author": "Mattijs Vanhaverbeke",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/90/e5/4be1cbeaa5c72b6d8711c6da2fa0c97c099d84edbb583558896a9a74934d/netbox_topology_views-4.1.0.tar.gz",
"platform": null,
"description": "# Netbox Topology Views Plugin\n\n![Version](https://img.shields.io/pypi/v/netbox-topology-views) ![Downloads](https://img.shields.io/pypi/dm/netbox-topology-views)\n\nCreate topology views/maps from your devices in NetBox.\nThe connections are based on the cables you created in NetBox.\nSupport to filter on name, site, tag and device role. \nOptions to export to xml (for draw.io/diagrams.net) or png.\n\n## Preview\n\n![Topology with light mode](doc/img/topology_light.png)\n![Topology with dark mode](doc/img/topology_dark.png)\n\n## Install\n\n**_NOTE:_** For docker please see: [Docker install](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins)\n\n**_NOTE:_** Add `RUN mkdir -p /opt/netbox/netbox/static/netbox_topology_views/img` to the Dockerfile-Plugins file to create the image folder\n\nThe plugin is available as a Python package and can be installed with pip.\n\nRun `pip install netbox-topology-views` in your virtual env.\n\nTo ensure NetBox Topology Views plugin is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the NetBox root directory (alongside `requirements.txt`) and list the `netbox-topology-views` package:\n\n```no-highlight\n# echo netbox-topology-views >> local_requirements.txt\n```\n\nOnce installed, the plugin needs to be enabled in your `configuration.py`\n\n```python\n# In your configuration.py\nPLUGINS = [\"netbox_topology_views\"]\n```\n\nFirst run `source /opt/netbox/venv/bin/activate` to enter the Python virtual environment.\n\n\nThen run \n```bash\ncd /opt/netbox/netbox\npip3 install netbox-topology-views\npython3 manage.py migrate netbox_topology_views\npython3 manage.py collectstatic --no-input\n```\n\n### Versions\n\n| netbox version | netbox-topology-views version |\n| -------------- | ----------------------------- |\n| >= 4.1.0 | >= v4.1.0 |\n| >= 4.0.0 | >= v4.0.0 |\n| >= 3.7.0 | >= v3.9.0 |\n| >= 3.6.4 | >= v3.8.1 |\n| >= 3.6.0 | >= v3.7.X |\n| >= 3.5.0 | >= v3.4.X |\n| >= 3.4.0 | >= v3.X.X |\n| >= 3.3.0 | >= v3.0.0 |\n| >= 3.2.0 | >= v1.1.0 |\n| >= 3.1.8 | >= v1.0.0 |\n| >= 2.11.1 | >= v0.5.3 |\n| >= 2.10.0 | >= v0.5.0 |\n| < 2.10.0 | =< v0.4.10 |\n\n### Update\n\nRun `pip install netbox-topology-views --upgrade` in your venv.\n\nRun `python3 manage.py migrate netbox_topology_views`\n\nRun `python3 manage.py collectstatic --no-input`\n\nClear you browser cache.\n\n## Configure\n\n### Individual Options\n\nAll individual options can be assigned a default value per user directly in the plugin. The default value can be overridden on the filter page.\n\n![Individual Options](doc/img/topology_individual_options.png)\n\nThe remaining options must be configured in the `PLUGINS_CONFIG` section of your `netbox/configuration.py`.\n\nExample:\n```\nPLUGINS_CONFIG = {\n 'netbox_topology_views': {\n 'static_image_directory': 'netbox_topology_views/img',\n 'allow_coordinates_saving': True,\n 'always_save_coordinates': True\n }\n}\n```\n\n| Setting | Default value | Description |\n| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |\n| static_image_directory | netbox_topology_views/img | (str or pathlib.Path) Specifies the location that images will be loaded from by default. Must be within `STATIC_ROOT` |\n| allow_coordinates_saving | False | (bool) Set to true if you want to enable the ability to save the coordinates. |\n| always_save_coordinates | False | (bool) Set if you want to enable the option to save coordinates by default. Setting allow_coordinates_saving to true is mandatory. |\n\n### Custom field: coordinates\n\nThere is also support for custom fields.\n\n>**_Note:_** The custom field \"coordinates\" is deprecated and will be removed in the future. Please use Coordinate Groups instead.\n\nIf you create a custom field \"coordinates\" for \"dcim > device\" and \"Circuits > circuit\" with type \"text\" and name \"coordinates\" you will see the same layout every time. It is recommended to set this field to \"UI visibility\" \"Hidden\" and let the plugin manage it in the background.\n\nThe coordinates are stored as: \"X;Y\".\n\n> Please read the \"Configure\" chapter to set the `allow_coordinates_saving` option to True.\nYou might also set the `always_save_coordinates` option to True.\n\n### Convert custom field to Coordinate Groups\n\nPlease note that values stored in the custom field \"coordinates\" are not being converted to Coordinate Groups automatically. A pragmatic way to do this conversion yourself is as follows:\n+ Navigate to \"Topology\" > \"Filters\".\n+ Select \"Show Unconnected\" and \"Show Cables\". \n+ Leave all other filter settings alone. We want all entries to be displayed!\n+ Click \"Search\" and wait for the results to be displayed\n+ Select all nodes. This can be done by holding down the Shift key and dragging a frame around all icons with the left mouse button.\n+ Drag the selection a tiny bit to the side. This causes all coordinates for all devices to be stored in the \"default\" group.\n> **_Hint_**: Don't wait too long after clicking an icon in order to drag. If you hold the mouse button for too long before dragging starts, the selection is reset._\n+ Storing the values might take some time, depending on the number of devices. Please be patient and check \"Coordinates\" in order to make sure that everthing has been stored.\n+ It is save to delete the custom field now.\n\n### Custom Images\n\nTo change image with associated device use the `Images` page - it allows to map a device role with an image found in the NetBox static directory (defined by the plugin config `static_image_directory` which defaults to `netbox_topology_views/img`). You can also upload you own custom images to there - these images will automatically be used for a device (if it does not already have a specified image in the settings) if their name is the device role slug.\n\n![Images](doc/img/topology_images.png)\n\n## Use\n\nGo to the plugins tab in the navbar and click topology or go to `$NETBOX_URL/plugins/netbox_topology_views/` to view your topologies\n\nSelect your options for the topology view:\n\n![Filter Options](doc/img/topology_filter_options.png)\n\n<dl>\n <dt>Coordinate Group</dt>\n <dd>Select Coordinate Group. These groups allow devices to be displayed in different positions depending on the group, thus providing different representations for the same topology. If nothing is selected, the group \"default\" is set automatically.</dd>\n <dt>Save Coordinates</dt>\n <dd>Save the coordinates of devices in the topology view.</dd>\n <dt>Show Unconnected</dt>\n <dd>Show devices that have no connections or for which no connection is displayed. This option depends on other parameters like 'Show Cables' and 'Show Logical Connections'.</dd>\n <dt>Show Cables</dt>\n <dd>Show connections between interfaces, front / rear ports, etc., that are connected with one or more cables. These connections are displayed as solid lines in the color of the cable.</dd> \n <dt>Show Logical Connections</dt>\n <dd>Show logical connections between interfaces (referred to as Interface Connections in NetBox) in the topology view. Where the path between\n interfaces includes multiple cables (e.g., via patch panels), only the end interface connections are shown, not the \n intermediate front / rear port connections, etc. This is similar to what was referred to as 'end-to-end' connections in previous versions. These connections are displayed as yellow dotted lines.</dd>\n <dt>Show redundant Cable and Logical Connection</dt>\n <dd>Shows a logical connection (in addition to a cable), even if a cable is directly connected. Leaving this option disabled prevents that redundant display. This option only has an effect if 'Show Logical Connections' is activated.</dd>\n <dt>Show Neighbors</dt>\n <dd>Adds neighbors to the filter result set automatically. Link peers will be added if 'Show Cables' is ticked, far-end terminations will be added if 'Show Logical Connections' is ticked.</dd>\n <dt>Show Circuit Terminations</dt>\n <dd>Show connections which end at a circuit termination in the topology view. These connections are displayed as blue dashed lines.</dd>\n <dt>Show Power Feeds</dt>\n <dd>Displays connections between power outlets and power ports. These connections are displayed as solid lines in the color of the cable. This option depends on 'Show Cables'.</dd>\n <dt>Show Wireless Links</dt>\n <dd>Displays wireless connections. These connections are displayed as blue dotted lines.</dd>\n</dl>\n \n### Coordinates and Coordinate Groups\n\nNetbox Topology Views stores the position of the devices. In order to allow different representations for the topology, Coordinate Groups are supported.\n\n> Please read the \"Configure\" chapter to set the `allow_coordinates_saving` option to True.\nYou might also set the `always_save_coordinates` option to True.\n\nNavigate to \"Coordinate Groups\" in the menu and create as many groups as you like. You can select a group later in the filter pane in order to show icon positions according to this group (see chapter \"Use\"). You can also omit creating a group if you don't need this feature. Netbox Topology Views automatically creates a group named \"default\" for you and stores all coordinates in this group, even if you do not select a group in the filter.\n\nBy default, the position of the devices are calculated with a physics engine. As soon as a device icon is dragged to another location, its position is saved and excluded from the calculation by the physics engine. All saved coordinates can be viewed and edited under the menu item \"Coordinates\".\n\n> **_Note:_** At the time of writing, it is not possible to store the positions of circuit terminations, power panels and power feeds, as these are not devices.\n\n### Permissions\n\nTo view `/plugins/netbox_topology-views/topology` you need the following permissions:\n + dcim | device | can view device\n + dcim | site | can view site\n + extras | tag | can view tag\n + dcim | device role | can view device role\n\nTo save `Coordinates` when moving icons:\n + netbox_topology_views | coordinate | change\n\nTo view `/plugins/netbox_topology-views/images`:\n + dcim | site | view\n + dcim | device role | view\n + dcim | device role | add\n + dcim | device role | change\n\nTo view `/plugins/netbox_topology-views/individualoptions`:\n + netbox_topology_views | individual options | change\n\nSet `Coordinate Groups` according to your needs:\n + netbox_topology_views | coordinate groups | view/add/change/delete\n\nSet `Coordinates` according to your needs:\n + netbox_topology_views | coordinate | view/add/change/delete\n\nSet `Power Feed Coordinates` according to your needs:\n + netbox_topology_views | power feed coordinate | view/add/change/delete\n\nSet `Power Panel Coordinates` according to your needs:\n + netbox_topology_views | power panel coordinate | view/add/change/delete\n\nSet `Circuit Coordinates` according to your needs:\n + netbox_topology_views | circuit coordinate | view/add/change/delete\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "An NetBox plugin to create Topology maps",
"version": "4.1.0",
"project_urls": {
"Homepage": "https://github.com/mattieserver/netbox-topology-views",
"Source": "https://github.com/mattieserver/netbox-topology-views"
},
"split_keywords": [
"netbox-plugin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5c8400accb82c3e92300f7e4b78c63285a8e34f53134ecb33ba36287475aab71",
"md5": "a21bca4d64fa04c2132015c687f65b5c",
"sha256": "1be96de27fe63aa6ce3025ab636c6f593699c7bcd9efa9ecaf15db3694e44f7e"
},
"downloads": -1,
"filename": "netbox_topology_views-4.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a21bca4d64fa04c2132015c687f65b5c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 276467,
"upload_time": "2024-09-11T15:01:45",
"upload_time_iso_8601": "2024-09-11T15:01:45.870024Z",
"url": "https://files.pythonhosted.org/packages/5c/84/00accb82c3e92300f7e4b78c63285a8e34f53134ecb33ba36287475aab71/netbox_topology_views-4.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "90e54be1cbeaa5c72b6d8711c6da2fa0c97c099d84edbb583558896a9a74934d",
"md5": "433abc2658babf7d92a7f12c7787d3aa",
"sha256": "cd1618dc3b0e1d52386be37731d6f16c16f4403a7c21cdeb701c6d977d86623c"
},
"downloads": -1,
"filename": "netbox_topology_views-4.1.0.tar.gz",
"has_sig": false,
"md5_digest": "433abc2658babf7d92a7f12c7787d3aa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 206816,
"upload_time": "2024-09-11T15:01:47",
"upload_time_iso_8601": "2024-09-11T15:01:47.561603Z",
"url": "https://files.pythonhosted.org/packages/90/e5/4be1cbeaa5c72b6d8711c6da2fa0c97c099d84edbb583558896a9a74934d/netbox_topology_views-4.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-11 15:01:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mattieserver",
"github_project": "netbox-topology-views",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "djangorestframework",
"specs": []
},
{
"name": "django-filter",
"specs": []
},
{
"name": "black",
"specs": []
}
],
"lcname": "netbox-topology-views"
}