Jasper-Claus/netbox-service-canvas
关于
Interactive service map for NetBox: which services run where, how they talk, and what breaks if a host fails.
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文🗺️ NetBox Service Canvas
A NetBox plugin that shows on an interactive canvas which services run where, how they talk to each other and what breaks if a host fails.
Installation · How it works · Features · Permissions · Wiki · Deutsch
Drag a host in, let Add missing pull in its services, draw a connection, then check what breaks if it fails.
Installation
Requirements: NetBox 4.5, 4.6 or 4.7 and Python 3.12 or newer.
[!WARNING] The plugin declares support for NetBox 4.5 to 4.7. On a newer minor version (for example 4.8) the whole of NetBox refuses to start while the plugin is enabled. Before upgrading NetBox, check the releases for a matching plugin version, or remove
netbox_service_canvasfromPLUGINSfirst.
netbox-docker
All files below are in your netbox-docker folder, next to docker-compose.yml. If you have never installed a plugin
there, read No plugins installed yet? first.
Open
plugin_requirements.txt(for example withnano plugin_requirements.txt) and add this line. It goes into the file, not into the terminal:netbox-service-canvasOpen
Dockerfile-Pluginsand make sure it ends with these three lines. They copy the editor's JavaScript and CSS into NetBox while the image is built. The twoCOPYlines are needed because NetBox only collects the files of plugins listed inplugins.py, and netbox-docker mounts that file only when the container starts:COPY configuration/configuration.py /etc/netbox/config/configuration.py COPY configuration/plugins.py /etc/netbox/config/plugins.py RUN DEBUG="true" SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-inputOpen
configuration/plugins.pyand add"netbox_service_canvas"to the existingPLUGINSlist. Add it to the list, do not replace the list. If you use netbox-branching,netbox_branchingmust stay the last entry:PLUGINS = [ # ... your other plugins ... "netbox_service_canvas", ]Rebuild the image and restart. Database migrations run automatically when the container starts:
docker compose build --no-cache docker compose up -dCheck: the menu shows Plugins → Service Canvas. Create a canvas and open its Editor tab. If the editor stays at "Loading canvas…", see Troubleshooting.
No plugins installed yet?
netbox-docker needs three files to install plugins. The official guide is Using NetBox Plugins. For this plugin alone, the files look like this:
plugin_requirements.txt
netbox-service-canvas
Dockerfile-Plugins (use the same image tag as in your docker-compose.yml)
FROM netboxcommunity/netbox:v4.7
COPY ./plugin_requirements.txt /opt/netbox/
RUN /usr/local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt
COPY configuration/configuration.py /etc/netbox/config/configuration.py
COPY configuration/plugins.py /etc/netbox/config/plugins.py
RUN DEBUG="true" SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
docker-compose.override.yml (if the file already exists, add the image, pull_policy and build lines and keep
your other settings, for example ports)
services:
netbox:
image: netbox:latest-plugins
pull_policy: never
build:
context: .
dockerfile: Dockerfile-Plugins
netbox-worker:
image: netbox:latest-plugins
pull_policy: never
Then continue with step 3 above.
Plain install (without Docker)
Run these commands as the user that owns the NetBox installation (usually with sudo):
source /opt/netbox/venv/bin/activate
pip install netbox-service-canvas
echo netbox-service-canvas >> /opt/netbox/local_requirements.txt # keeps the plugin across NetBox upgrades
Open /opt/netbox/netbox/netbox/configuration.py and add "netbox_service_canvas" to the existing PLUGINS list.
Then:
cd /opt/netbox/netbox
python manage.py migrate
python manage.py collectstatic --no-input
sudo systemctl restart netbox netbox-rq
Check as in step 5 above.
Configuration (optional)
The plugin works without any settings. To change them, add this to PLUGINS_CONFIG (next to your existing
entries) and keep only what you need:
PLUGINS_CONFIG = {
"netbox_service_canvas": {
"grid_size": 10, # grid in pixels, default 10
"edge_line_style": "curved", # default line shape: "curved", "straight" or "step"
"top_level_menu": True, # False: list the items under NetBox's shared "Plugins" menu
"role_icons": {}, # icons for device roles, e.g. {"core-switch": "mdi-switch"}
},
}
More connection protocols can be added with NetBox's FIELD_CHOICES
(netbox_service_canvas.ServiceConnection.protocol+); they also show up in the editor.
Update
Make a database backup first. With netbox-docker, run docker compose build --no-cache and docker compose up -d
again; this installs the newest release (or the version you pinned in plugin_requirements.txt). With a plain
install, run pip install --upgrade netbox-service-canvas and repeat migrate, collectstatic and the restart.
Then reload the editor once with Ctrl+F5.
Uninstall
[!CAUTION] The first step deletes all canvases, connections, hops and applications of this plugin. Make a database backup first. Devices, VMs and services in NetBox are not touched.
- Remove the plugin's tables while the plugin is still installed:
docker compose exec netbox /opt/netbox/netbox/manage.py migrate netbox_service_canvas zero(plain install:python manage.py migrate netbox_service_canvas zero). - Remove
netbox_service_canvasfromPLUGINSandPLUGINS_CONFIG, and the line fromplugin_requirements.txtorlocal_requirements.txt. - Rebuild and restart (netbox-docker) or
pip uninstall netbox-service-canvasand restart (plain install). - Optional: delete the leftover static files. In netbox-docker this needs root:
docker compose exec -u root netbox rm -rf /opt/netbox/netbox/static/netbox_service_canvas
A German step-by-step guide with backup and restore is in docs/install-netbox-docker.md.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
The editor stays at "Loading canvas…". The browser console shows a 404 for canvas.js or "MIME type ("") blocked". |
The static files were not collected. Add the two COPY lines and the collectstatic line to Dockerfile-Plugins (step 2) and rebuild. Running collectstatic by hand (docker compose exec -u root netbox /opt/netbox/netbox/manage.py collectstatic --no-input) only helps until the container is recreated, and fails if files such as a logo are mounted into the static folder. Then reload with Ctrl+F5. |
NetBox does not start: ImproperlyConfigured … requires NetBox … |
The NetBox version is older than 4.5 or newer than 4.7. See the warning above. |
ModuleNotFoundError: No module named 'netbox_service_canvas' |
The image was not rebuilt, or the package line is missing from plugin_requirements.txt. |
| 403 when saving | The user lacks a permission. The editor names the missing one. See Permissions. |
How it works
- Go to Plugins → Service Canvas → Canvases → Add and give the canvas a name, for example Homelab.
- Open the Editor tab.
- Drag devices and VMs from the sidebar onto the canvas, then click Add missing to pull in their services.
- Drag from the dot on the right of a node to another node to create a connection.
- Click a node or a connection to edit it. Set the connection's kind to Proxy if the target is only reachable through the source, for example a service behind Traefik.
- Click Impact analysis in the node panel to see what breaks if the node fails.
- Find anything with the search field in the toolbar. The File menu exports the canvas (PNG, SVG, A4 PDF, draw.io, Excalidraw, YAML) and imports YAML.
Relationships are stored as normal NetBox data, the canvas only stores the layout. The same object can appear on several canvases. If an object is deleted in NetBox, it disappears from every canvas.
Features
Model your services
- Applications: a new NetBox object for software made of one or more services, for example Grafana, with status, version, URL and one of 24 icons (database, web, DNS, backup, media, …).
- Connections between services, devices, VMs and applications, with direction, protocol, port, a description of the data and status (active, planned, …).
- Proxy connections: mark a connection as Proxy when the target is only reachable through the source, for example Traefik → Paperless. Proxy chains such as Traefik → Authelia → Grafana work too.
- Hops: intermediate stations of a connection, such as a router, firewall, VLAN or tunnel, in a fixed order.
- Networks, VIPs and circuits: prefixes and VLANs can be placed on the canvas. Their "member of" lines come from NetBox (IP addresses in the prefix, interfaces in the VLAN), so a network works like a shared bus. IP addresses (for example a load balancer VIP) and circuits are connection endpoints like hosts and services.
- DNS records and endpoints (badges, phones, PCs) as nodes, with sieteunoseis' plugins netbox-vitalqip and netbox-endpoints installed.
- Redundancy groups: connections in the same group are alternatives, for example a primary and a backup server. The impact analysis marks the source only when all of them are broken.
- Protocols include SIP and MGCP, and the list can be extended with NetBox's
FIELD_CHOICES. - "Runs on" from NetBox: services sit on their device or VM, and a VM pinned to a device runs on it. Nothing has to be entered twice.
- Service templates: the New service dialog offers about 60 common services (Traefik, nginx, PostgreSQL, Grafana, Home Assistant, WireGuard, …). One click fills name, protocol, ports and an application with a matching icon.
- Smart connections: a new connection takes the port of the target service, and suggests Proxy when the source is a reverse proxy or tunnel (Traefik, nginx, Caddy, HAProxy, Pangolin, …). It warns about a connection that already exists. The proxy assistant puts several applications behind one proxy at once, each with its own port, and can copy the hops (for example tunnel and VM) of an existing proxy connection to all of them.
Draw the canvas
- Canvas assistant: pick a site, cluster or tag and the canvas is built from NetBox: hosts, VMs, services and applications in columns (host → VM → service → application), one group per site, with room for the lines. Ideal for a first drawing; it only adds what is not on the canvas yet.
- Editor: drag and drop from a searchable sidebar. Add missing pulls in the services and the cabled switches and routers of what is already on the canvas. Groups, sticky notes, automatic layout, minimap and autosave.
- Bendable, colourable lines: drag the + points of a selected line to route it around other nodes, and pick a colour per line and canvas. Every box has six attachment points; click one to fix a line end there. Lines can be curved, straight or drawn as steps, start and end at a chosen side, be animated, and be numbered as a message path that a dot plays through in order.
- Arranging: resizable nodes, alignment guides while dragging, align and distribute for a selection, and undo/redo (Ctrl+Z, Ctrl+Shift+Z).
- Canvas links: place one canvas on another. Connections to objects that are only on the linked canvas are drawn to the link node, so large maps can be split without losing the lines between them.
- Replace an object, for example after a server upgrade: the node keeps its place, and its connections and hops can move to the new object on every canvas.
- Physical layer: the cables documented in NetBox are drawn between devices, with the interface names as label. Paths through patch panels count as one link. Toggle it in the toolbar.
- Search in the toolbar: find an object by name, host, IP or port and jump to it.
- Node panel: details, connections and cables of the selected object, quick edit for services and applications, links to the NetBox pages.
Ask "what if this fails?"
- Impact analysis for any node, colour-coded on the canvas:
- fails with it (red): services and VMs running on the failed host, IP addresses configured on it, prefixes of a failed VLAN,
- affected (orange): everything that depends on one of them, or whose connection runs through a failed hop,
- unreachable (yellow): everything behind a failed proxy, behind a switch that was its only cable, or whose networks have all failed.
- It follows links to other canvases and respects redundancy groups.
- Several failures at once: add more objects to a running analysis ("Add to failure"), for example both nodes of a cluster or a switch and its uplink.
- Failure report: the Analysis panel lists everything affected, grouped by colour, with the web addresses of the affected applications. Copy it as Markdown or download it as Markdown or CSV for an incident or maintenance note.
- Single points of failure: a ranking of the objects whose failure on its own affects the most others.
- Data check: hints on typical modelling mistakes, most with a one-click fix: a connection between a service and its own host, duplicates, two one-way connections that should be one, a proxy marked as uses, a connection to a host instead of its service, a missing port, applications without services.
- Everything comes from the documentation in NetBox. Nothing is pinged or measured, see What this is not.
Share it and stay in NetBox
- Export as PNG, SVG, a printable A4 PDF with title, date and legend, a draw.io file or an Excalidraw scene.
- YAML export and import: edit a canvas as text, check the changes first, or copy a canvas.
- Revisions: save numbered versions of a canvas with a note, download or restore them. An optional footer (title block) shows title, site, address and the latest revision.
- Preview and tiles: the canvas page shows the drawing read-only, the canvas list shows tiles with a picture, and a dashboard widget puts a live canvas on the NetBox home page.
- Share image link: a public, revocable SVG link of the current canvas to embed in a wiki or Jira page.
- Integrated into NetBox: lists, filters, CSV import, global search, REST API, GraphQL and change log for all objects. Device, VM, service and application pages get a Connections tab and a Show on canvas button.
- Follows NetBox: permissions, light and dark theme, English or German depending on the NetBox language.
- Works offline: no CDNs, no external requests. The frontend is bundled with the plugin.
More details and screenshots are in the wiki.
![]() |
![]() |
Impact analysis: what breaks if truenas goes down? |
New service with an optional application, in one dialog |
Screenshots show a demo homelab.
Service vs. Application (in one sentence each)
- Service (NetBox core) = where something listens: one port on one host, for example
grafana · TCP 3000 · nas. - Application (this plugin) = what it is: the software, optionally spanning several services and hosts, for
example
Grafana.
For a simple one-port app a service is enough. When you create a service in the editor, you can create or link the application in the same dialog.
Permissions
| Action | Required permission |
|---|---|
| View a canvas | view on canvas (objects and connections only as far as you may view them) |
| Move, add, remove nodes | change on the canvas + add/change/delete on canvas node |
| Groups / notes | additionally add/change/delete on canvas group / canvas note |
| Create / edit / delete connections | add/change/delete on service connection |
| Hops | add/change/delete on connection hop |
| New service, "runs on", quick edit | add / change on ipam › service |
| Applications | add / change on application |
| Revisions | add / delete on canvas revision + change on the canvas |
| Share image link | change on the canvas |
Users without change permission see the canvas in view-only mode.
More
- Wiki: getting started, editor guide, impact analysis, export, FAQ
- REST API under
/api/plugins/service-canvas/and GraphQL: see API in the wiki - Bug reports, development setup and tests: CONTRIBUTING.md
- Changes per version: CHANGELOG.md
Why this exists
NetBox documents my homelab down to every cable and IP, but it did not show which service runs on which host and who talks to whom. This plugin adds that service layer.
What this is not
- Not a monitoring tool. Nothing is pinged, polled or measured. The canvas shows what is documented in NetBox, and the impact analysis answers "what if this fails?" from that documentation. Live state belongs in your monitoring (Uptime Kuma, Zabbix, Prometheus, …).
- Not a discovery tool. It does not scan your network or import anything automatically. Discovery and imports are better done by the tools made for that (Diode, Orb, NAPALM, …) feeding NetBox.
- Not another network diagram. Topology plugins draw cables and devices. This plugin adds the service layer on top: which service runs where, who talks to whom, through which proxy, and what breaks. The cables are only an optional layer for the impact analysis.
Built with AI
The code, tests and documentation of this plugin were written by AI (Claude via Claude Code). I contributed the idea and requirements, tested it in my homelab and gave feedback. Issues and pull requests are welcome.
How it is kept maintainable: every change runs the Django tests against NetBox 4.5, 4.6 and 4.7 and the frontend tests in CI, dependencies are updated through Dependabot, security reports go through SECURITY.md, and every release is listed in the changelog. The plugin only uses NetBox's own models, permissions and change log, so it does not touch NetBox core.
Thanks
Many of the features above, from line shapes, networks, VIPs and circuits to revisions, YAML, draw.io and Excalidraw export, undo/redo and the dashboard widget, were built by sieteunoseis in the fork NetBox Canvas and came back into this plugin with versions 0.6.0, 0.7.0 and 0.8.0 (see #14). Thank you for building it and sharing it.
License
Apache-2.0. Not affiliated with NetBox Labs. NetBox is a trademark of NetBox Labs, Inc.
探索相关项目
加载中…

