Skip to main content

NetBox Stratagram

Network diagrams of NetBox sites, drawn from their devices and cables and edited in the browser on each site's Diagram tab, with the Stratagram editor (the same as the desktop app, compiled to WebAssembly).

  • The first time, the tab draws the site as NetBox has it: devices with their cabled interfaces as ports, cables as lines, laid out top down (internet and firewalls above, servers below). Device types come from the device roles, line types from the interfaces (802.1Q trunk, layer 3 when routed on both ends, layer 2 for access ports). Provider circuits become clouds. Patch panels (by role, or devices with front ports and no other role) are drawn with numbered sockets, one per front port, of the front ports' type (RJ45, LC or SC), and as wide as they need. Cables to front ports plug into their sockets, cables to rear ports come out behind the socket of the front port they map to. Switches show their front too: their physical interfaces as ports, odd ones on top and even ones below, copper ones first and the others as SFP uplinks, each cable in its port.
  • Each of the site's locations gets a sheet of its own after the site's: the devices in the location (and in the locations inside it), plus the devices elsewhere they are cabled to, on the layer "Other locations" (marked with its name). A location's own Diagram tab shows the site's diagram open on that sheet.
  • Each type of device is on a layer of its own (Internet, Firewalls, Routers, Switches, Patch panels, Servers...) and the cables on the layer Cables, to show or hide them by type; each device has a sub-layer of its own under its type's, named after it (renamed with it), to show or hide devices one by one (unfold the type's layer with ▸). The cabling stays end to end: with the patch panels hidden, a server's line goes straight to the switch port it is patched through to (NetBox's cable path), and hidden cables take their end-to-end lines with them. A diagram saved before this gets the layers at its next Refresh from NetBox (what you drew yourself stays where it is; a device you later move to another layer stays there).
  • Each location is a layer of its own too, with the locations inside it and its devices' layers by type under it, and a background in a color of its own with a dotted border: on the drawing, every location is a tinted area holding its devices, the ones inside it nested in it. Auto layout keeps each location's devices together. A device moved to another location in NetBox moves to that location's layer at the next refresh.
  • Arrange it, add notes, a frame, layers..., then Save: the diagram is kept in NetBox (one per site, in the change log).
  • Refresh from NetBox opens a dialog with what NetBox has, as a tree like the layer list: locations, device types, devices and their interfaces. Nothing is selected at first; checking an entry selects everything under it, and unfolding a device lets you pick single interfaces (cables come along where both ends are chosen). Then choose Update this sheet or Add as a new sheet; a new sheet is laid out and shown at once. Updating adds the chosen devices and cables and renames what was renamed, leaving the rest alone. With everything (the site) selected, it is the full refresh: what is gone is set aside on the layer "Gone from NetBox", on every sheet, renamed locations rename their sheets and new locations get new sheets. Nothing you placed moves, and Ctrl+Z undoes it.
  • Export SVG, PNG or draw.io from the editor's Export menu.
  • Light, Dark and Neon themes (the selector in the editor's toolbar): the editor follows NetBox's own light/dark switch until you pick one, which is then remembered in your browser. SVG and PNG exports come out in the theme; the saved diagram keeps its colors.

Requires NetBox 4.5, 4.6 or 4.7.

Install

Install it from PyPI into NetBox's virtual environment:

sudo /opt/netbox/venv/bin/pip install netbox-stratagram

With netbox-docker, add netbox-stratagram to plugin_requirements.txt and build the image (see netbox-docker's guide to plugins; collectstatic is part of it).

To build the package yourself (needs Rust with the wasm32-unknown-unknown target and wasm-bindgen-cli 0.2.129, see Building from source, pip install build, and cargo install cargo-about for the licenses of the libraries built into the editor, which go into the package as THIRD-PARTY-LICENSES.txt):

netbox-plugin/build.sh          # makes netbox-plugin/dist/netbox_stratagram-*.whl

and install that wheel instead. Then enable the plugin in configuration.py:

PLUGINS = ["netbox_stratagram"]
PLUGINS_CONFIG = {
    "netbox_stratagram": {
        # Device type by device role (slug or name), before the built-in guesses.
        "kinds": {"patch-panel": "switch", "dmz-host": "server"},
        # Also draw devices without a cable to another device.
        "all_devices": False,
        # Each type of device on a layer of its own, the cables on one.
        "type_layers": True,
        # Each location on a layer of its own (its locations and its
        # devices' layers under it), with a background in its own color.
        "location_layers": True,
        # How the cables run, and new lines drawn by hand: "orthogonal",
        # "straight" or "around" (orthogonal, around devices in between).
        "routing": "orthogonal",
        # Device types drawn with their ports as a front, like a switch's:
        # any of "switch", "router", "firewall", "server".
        "fronts": ["switch"],
    },
}

Then, as for any plugin:

python3 manage.py migrate
python3 manage.py collectstatic --no-input

Your web server should serve .wasm files as application/wasm (nginx does by default; elsewhere the editor still loads, a little slower).

Permissions

The Diagram tab (of sites and locations) shows to those who may view the site and site diagrams (netbox_stratagram.view_sitediagram); grant it to everyone who should see the diagrams (superusers have it). A saved diagram outside the constraints of their view permission is not shown (nor can it be saved over). Drawn afresh or refreshed, the drawing only has the devices and cables they may view.

Saving needs the permission to add (the first time) or change site diagrams (netbox_stratagram.add_sitediagram, netbox_stratagram.change_sitediagram), with their constraints: a diagram saved outside them (constraints on site__region, say) is undone and the save refused, as in NetBox's own edit views.

License

Copyright 2026 Shin Sterneck. Licensed under the Apache License, Version 2.0; the package includes the license and the NOTICE file.

Metadata

Release files for netbox-stratagram 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-stratagram 1.2.1
File Size Uploaded Provenance Actions
netbox_stratagram-1.2.1.tar.gz 583.3 kB With provenance Details for netbox_stratagram-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netbox-stratagram 1.2.1
File Interpreter ABI Platform Actions
netbox_stratagram-1.2.1-py3-none-any.whl Python 3 none any Details for netbox_stratagram-1.2.1-py3-none-any.whl

Total release size: 1.2 MB

Release files / netbox_stratagram-1.2.1.tar.gz

Download URL netbox_stratagram-1.2.1.tar.gz
Size 583.3 kB
Tags Source
SHA-256 checksum
How to use checksums
de09902869f4d131e4985672f12bbfb639a45acfb00a0a55341dc943aa2e7272
BLAKE2b-256 checksum
How to use checksums
b3034a3e8f422036265bab0c99b8283a514870a23ff35684f67d3ccfc6e5518f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / netbox_stratagram-1.2.1-py3-none-any.whl

Download URL netbox_stratagram-1.2.1-py3-none-any.whl
Size 588.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1516f89e7849d4e30693ecbe7c8a06a15625e3deb648517f252293c09400ba8
BLAKE2b-256 checksum
How to use checksums
b467189216594d83d9e2d95c19c81b0ee92596df1011dfe2867f8952bd5d9e5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for netbox-stratagram 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for netbox_stratagram-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page