# Netbox Device View Plugin
![Version](https://img.shields.io/pypi/v/netbox-device-view) ![Downloads](https://img.shields.io/pypi/dm/netbox-device-view)
## Install
The plugin is available as a Python package and can be installed with pip.
Run `pip install netbox-device-view` in your virtual env.
To ensure NetBox Device View 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-device-view` package:
```no-highlight
# echo netbox-device-view >> local_requirements.txt
```
Once installed, the plugin needs to be enabled in your `configuration.py` and optionally the `show_on_device_tab` setting enabled.
```python
# In your configuration.py
PLUGINS = ["netbox_device_view"]
PLUGINS_CONFIG = {
'netbox_device_view': {
'show_on_device_tab': True,
},
}
```
First run `source /opt/netbox/venv/bin/activate` to enter the Python virtual environment.
Then run
```bash
cd /opt/netbox/netbox
pip3 install netbox-device-view
python3 manage.py migrate netbox_device_view
python3 manage.py collectstatic --no-input
```
## How To Use
For each Device Type you need to add a DeviceView.
It is based on a CSS grid view with 32 columns and 2 rows.
You need to specify the grid-template-areas.
- Interface positions will use the following format: {interfacename}{module}-{port}
- leading "empties" can be specified as x
- trailing "empties" can be specified as z
- between "empties" can be named s{0-99}
Example for Cisco C9300-24T with 8x 10G module ( more in [examples](https://github.com/peterbaumert/netbox-device-view/blob/main/examples/) folder )
```
/* C9300-24T */
.deviceview.area {
grid-template-areas:
"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 z z z z z"
"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 z z z z z";
}
/* C9300-24T with C9300-NM-8X */
.deviceview.moduleC9300-NM-8X.area {
grid-template-areas:
"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 s1 tengigabitethernet1-1 tengigabitethernet1-3 tengigabitethernet1-5 tengigabitethernet1-7"
"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 s1 tengigabitethernet1-2 tengigabitethernet1-4 tengigabitethernet1-6 tengigabitethernet1-8";
}
```
It will look like
![example](https://github.com/peterbaumert/netbox-device-view/blob/main/docs/example_view.png?raw=true)
Raw data
{
"_id": null,
"home_page": "https://github.com/peterbaumert/netbox-device-view",
"name": "netbox-device-view",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "netbox,netbox-plugin",
"author": "Peter Baumert",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/2c/2f/afaa8d21f4972666811dc4e6e83327060e605afeb17f3c2ac4585be91629/netbox-device-view-0.1.2.tar.gz",
"platform": null,
"description": "# Netbox Device View Plugin\n![Version](https://img.shields.io/pypi/v/netbox-device-view) ![Downloads](https://img.shields.io/pypi/dm/netbox-device-view)\n\n## Install\n\nThe plugin is available as a Python package and can be installed with pip.\n\nRun `pip install netbox-device-view` in your virtual env.\n\nTo ensure NetBox Device View 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-device-view` package:\n\n```no-highlight\n# echo netbox-device-view >> local_requirements.txt\n```\n\nOnce installed, the plugin needs to be enabled in your `configuration.py` and optionally the `show_on_device_tab` setting enabled.\n\n```python\n# In your configuration.py\nPLUGINS = [\"netbox_device_view\"]\n\nPLUGINS_CONFIG = {\n 'netbox_device_view': {\n 'show_on_device_tab': True,\n },\n}\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-device-view\npython3 manage.py migrate netbox_device_view\npython3 manage.py collectstatic --no-input\n```\n\n## How To Use\n\nFor each Device Type you need to add a DeviceView.\n\nIt is based on a CSS grid view with 32 columns and 2 rows.\nYou need to specify the grid-template-areas. \n- Interface positions will use the following format: {interfacename}{module}-{port}\n- leading \"empties\" can be specified as x\n- trailing \"empties\" can be specified as z\n- between \"empties\" can be named s{0-99}\n\nExample for Cisco C9300-24T with 8x 10G module ( more in [examples](https://github.com/peterbaumert/netbox-device-view/blob/main/examples/) folder )\n\n```\n/* C9300-24T */\n.deviceview.area {\n\tgrid-template-areas:\n\t\"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 z z z z z\"\n\t\"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 z z z z z\";\n}\n\n/* C9300-24T with C9300-NM-8X */\n.deviceview.moduleC9300-NM-8X.area {\n\tgrid-template-areas:\n\t\"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 s1 tengigabitethernet1-1 tengigabitethernet1-3 tengigabitethernet1-5 tengigabitethernet1-7\"\n\t\"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 s1 tengigabitethernet1-2 tengigabitethernet1-4 tengigabitethernet1-6 tengigabitethernet1-8\";\n}\n```\n\nIt will look like\n\n![example](https://github.com/peterbaumert/netbox-device-view/blob/main/docs/example_view.png?raw=true)\n",
"bugtrack_url": null,
"license": "",
"summary": "NetBox Device View plugin",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/peterbaumert/netbox-device-view"
},
"split_keywords": [
"netbox",
"netbox-plugin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a3f4cdc092879490bd590704ce172992d19b81ae9a4c3940cd3ac0793545d79d",
"md5": "8f9107d60efddd3b2a1ec82a98c3e1d6",
"sha256": "564075afce049f771afd0e72be42089350575f53d0d5f1882135dfd8902a5d40"
},
"downloads": -1,
"filename": "netbox_device_view-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8f9107d60efddd3b2a1ec82a98c3e1d6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12574,
"upload_time": "2023-07-10T17:30:24",
"upload_time_iso_8601": "2023-07-10T17:30:24.999287Z",
"url": "https://files.pythonhosted.org/packages/a3/f4/cdc092879490bd590704ce172992d19b81ae9a4c3940cd3ac0793545d79d/netbox_device_view-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c2fafaa8d21f4972666811dc4e6e83327060e605afeb17f3c2ac4585be91629",
"md5": "0701048f0964bd5ff2b8893d85cc0a26",
"sha256": "10989c62ac443f9163739a5b3276184f8d155da84d853e3a5820972045fac100"
},
"downloads": -1,
"filename": "netbox-device-view-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "0701048f0964bd5ff2b8893d85cc0a26",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9179,
"upload_time": "2023-07-10T17:30:26",
"upload_time_iso_8601": "2023-07-10T17:30:26.131532Z",
"url": "https://files.pythonhosted.org/packages/2c/2f/afaa8d21f4972666811dc4e6e83327060e605afeb17f3c2ac4585be91629/netbox-device-view-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-10 17:30:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "peterbaumert",
"github_project": "netbox-device-view",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "netbox-device-view"
}