Skip to main content

Manage site, location, circuit and device diagrams and documents in Netbox

Project description

Netbox Documents Plugin

A plugin designed to faciliate the storage of site, circuit, device type and device specific documents within NetBox

Features

  • Store documents against the following NetBox models:

    • Circuits
    • Devices
    • Device Types
    • Module Types
    • Sites
    • Locations
    • Virtual Machines
    • Circuit Providers
  • Upload documents to your NetBox media/ folder or other Django supported storage method e.g. S3

  • Supports a wide array of common file types (bmp, gif, jpeg, jpg, png, pdf, txt, doc, docx, xls, xlsx, xlsm)

  • Store links to external URL's to save duplication of remote documents

Compatibility

NetBox Version Plugin Version
4.3+ 0.7.4
4.2+ 0.7.2
4.0 - 4.1 0.7.0
3.6+ 0.6.4
3.5.x 0.6.0
3.3.x - 3.4.x 0.5.1

Installation

A working installation of Netbox 4.0+ is required. NOTE: Netbox 3.5, 4.0 & 4.2 introduced breaking changes for plugins, please use the correct plugin version for your netbox install.

Package Installation from PyPi

Activate your virtual env and install via pip:

$ source /opt/netbox/venv/bin/activate
(venv) $ pip install netbox-documents

To ensure the Netbox Documents plugin is automatically re-installed during future upgrades, add the package to your local_requirements.txt :

# echo netbox-documents >> local_requirements.txt

Enable the Plugin

In the Netbox configuration.py configuration file add or update the PLUGINS parameter, adding netbox_documents:

PLUGINS = [
    'netbox_documents',
]

(Optional) Add or update a PLUGINS_CONFIG parameter in configuration.py to configure plugin settings. Options shown below are the configured defaults:

PLUGINS_CONFIG = {
     'netbox_documents': {
         # Enable the management of site specific documents (True/False)
         'enable_site_documents': True,
         # Enable the management of location specific documents (True/False)
         'enable_location_documents': True,
         # Enable the management of circuit specific documents (True/False)
         'enable_circuit_documents': True,
         # Enable the management of device specific documents (True/False)
         'enable_device_documents': True,
         # Enable the management of device type specific documents (True/False)
         'enable_device_type_documents': True,
         # Enable the management of module type specific documents (True/False)
         'enable_module_type_documents': True,
         # Enable the global menu options (True/False)   
         'enable_navigation_menu': True,
         # Location to inject the document widget in the site view (left/right)
         'site_documents_location': 'left',
         # Location to inject the document widget in the location view (left/right)
         'location_documents_location': 'left',
         # Location to inject the document widget in the device view (left/right
         'device_documents_location': 'left',
         # Location to inject the document type widget in the device type view (left/right
         'device_type_documents_location': 'left',
         # Location to inject the document widget in the device view (left/right
         'circuit_documents_location': 'left'
     }
}

(Optional) Add or replace the built-in Document Type choices via Netbox's FIELD_CHOICES configuration parameter:

The colours that can be used are listed in the Netbox CSS netbox-light.css:

(https://github.com/netbox-community/netbox/blob/develop/netbox/project-static/dist/netbox-light.css)

The bg- must not be specified in the configuration. Here are a few examples from the CSS:

  • bg-indigo = #6610f2 --> 'indigo'
  • bg-blue = #0d6efd --> 'blue'
  • bg-purple = #6f42c1 --> 'purple'
  • bg-pink = #d63384 --> 'pink'
  • bg-red = #dc3545 --> 'red'
  • bg-orange = #fd7e14 --> 'orange'
  • bg-yellow = #ffc107 --> 'yellow'
  • bg-green = #198754 --> 'green'
  • bg-teal = #20c997 --> 'teal'
  • bg-cyan = #0dcaf0 --> 'cyan'
  • bg-gray = #adb5bd --> 'gray'
  • bg-black = #000 --> 'black'
  • bg-white --> 'white'
FIELD_CHOICES = {
    'netbox_documents.DocTypeChoices.site+': (
        ('mydocument', 'My Custom Site Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.location+': (
        ('mydocument', 'My Custom Location Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.device+': (
        ('mydocument', 'My Custom Device Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.devicetype+': (
        ('mydocument', 'My Custom Device Type Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.moduletype+': (
        ('mydocument', 'My Custom Module Type Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.circuit+': (
        ('mydocument', 'My Custom Circuit Document Type', 'green'),
    )
}

Apply Database Migrations

Apply database migrations with Netbox manage.py:

(venv) $ python manage.py migrate

Restart Netbox

Restart the Netbox service to apply changes:

sudo systemctl restart netbox

Re-index Netbox search index (Upgrade to 3.4 only)

If you are upgrading from Netbox 3.3 or above to Netbox 3.4, any previously inserted documents may not show up in the new search feature. To resolve this, re-index the plugin:

(venv) $ python manage.py reindex netbox_documents

Screenshots

Site Document View Add Circuit Document Site Document List Device Document List Device Type Document Device Type Document List

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

netbox_documents-0.7.4.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_documents-0.7.4-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

Details for the file netbox_documents-0.7.4.tar.gz.

File metadata

  • Download URL: netbox_documents-0.7.4.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for netbox_documents-0.7.4.tar.gz
Algorithm Hash digest
SHA256 6f9f8228934c599ef89b2ebe5c8980b0f57f668e4efadd6ca9271222823c3adb
MD5 1c0219d2942b99ada5bea020f3b2f9a6
BLAKE2b-256 770caab15aaf83252f38c8122f0b0589a1031cf7a2d8226a141f4f5dc09ef7a0

See more details on using hashes here.

File details

Details for the file netbox_documents-0.7.4-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_documents-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fb66b6475c2c6525a5772b7dedb63e9a96fd98501c83164f49168660805fe03c
MD5 a77460c068bb28803ea6f6a7876867ca
BLAKE2b-256 09a0d5f7e375d2d60786301a46f5b30eca2cef84d1723a5d7108943ef258c33b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page