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).
  • 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 adds new devices and cables, renames what was renamed and sets aside what is gone on the layer "Gone from NetBox"; nothing you placed moves, and Ctrl+Z undoes it. It does so on every sheet: renamed locations rename their sheets, and new locations get new sheets (a diagram saved before locations had sheets gets them too).
  • 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 the main README, 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,
        # 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.0.3

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.0.3
File Size Uploaded Provenance Actions
netbox_stratagram-1.0.3.tar.gz 557.8 kB With provenance Details for netbox_stratagram-1.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / netbox_stratagram-1.0.3.tar.gz

Download URL netbox_stratagram-1.0.3.tar.gz
Size 557.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f1972cb73296103389d18bebe68119ecf4706d8c717cb63422501c3abc40c9c9
BLAKE2b-256 checksum
How to use checksums
403e34925d20a6b23e2bf43426e093c58296df3917da776dfdff1571ddc57f22
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 8, 2026.

Transparency log

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

Download URL netbox_stratagram-1.0.3-py3-none-any.whl
Size 563.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92958cdf12b3a548dd5c8c737f4a6b1b71b4a8f3ae21a1bf74f24291138db7bd
BLAKE2b-256 checksum
How to use checksums
9aa96471152ced87dd7bd0190a2e0449879179db1eb5774a232d431cfa0bd4c8
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 8, 2026.

Transparency log

Security for netbox-stratagram 1.0.3

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.0.3.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 8, 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