Configure¶
All settings live under PLUGINS_CONFIG["netbox_osp"] in your NetBox
configuration/plugins.py (or equivalent).
Settings¶
| Key | Default | Purpose |
|---|---|---|
default_attenuation_db_per_km |
0.22 |
Fallback attenuation when an OspCable has no explicit attenuation_db_per_km set. Used in fibre-link loss-budget calculation. |
default_splice_loss_db |
0.10 |
Fallback per-splice loss when a Splice row has no explicit loss_db. |
default_connector_loss_db |
0.30 |
Per-connector loss applied at each end of every FibreLink. |
map_default_center |
[0.0, 0.0] |
[lat, lon] for the default map view. Set this to the lat/lon of your area of interest. |
map_default_zoom |
2 |
Default Leaflet zoom level. 13–16 is appropriate for site-scale viewing. |
plant_boundary |
None |
Optional closed polygon (list of [lon, lat] vertices, GeoJSON order). If set, OspCable.clean() rejects any cable whose route vertices fall outside this polygon. See Plant boundary below. |
Plant boundary¶
If you configure plant_boundary, every OspCable.clean() validates that the
cable's route (a GeoJSON LineString) lies entirely inside the polygon —
catches operator slips when re-routing cables on the map. The ring is closed
implicitly; the last vertex does not need to repeat the first.
"netbox_osp": {
# ... other settings ...
"plant_boundary": [
# [lon, lat] — GeoJSON order, NOT Leaflet's [lat, lon].
# Example placeholder — replace with the vertices of your own plant.
[10.000, 50.000],
[10.010, 50.000],
[10.010, 50.010],
[10.000, 50.010],
],
}
Tip: use the Trace tool on the network map (/plugins/osp/map/) to draw
the boundary visually and copy the resulting coordinate list into your
plugins.py.
If plant_boundary is unset or None, no validation occurs and cables can
route anywhere on the globe.
Per-Location GPS markers¶
NetBox core gives Sites lat/lon but not Locations. The LocationGeo side-table
fills that gap so you can pin individual rooms, manholes, jetty poles, or any
other dcim.Location on the network map alongside Site markers.
It's a 1:1 row per dcim.Location:
plugins:netbox_osp:locationgeo_add → pick Location, enter lat/lon, save
plugins:netbox_osp:locationgeo_list → manage existing rows
/api/plugins/osp/location-geos/ → REST CRUD
latitude + longitude are stored as Decimal(max_digits=10, decimal_places=6)
matching NetBox's native Site.latitude/Site.longitude precision. Both are
optional but must be set together — a LocationGeo row with both null acts as
a placeholder while the operator waits on a survey.
A marker_color field selects from a short hue-separated palette so different
Location classes (admin, server room, field cabinet, manhole) stay visually
distinct at default zoom.
The map auto-includes every LocationGeo with both coords set, filtered by
site when ?site= is in the URL. Toggle the Location markers overlay in
the top-right layer control to hide them.
On a dcim.Location detail page, the plugin injects a GPS position panel
into the right-hand column with the current value (or a one-click "Set GPS
position" CTA if none exists).
GraphQL¶
netbox-osp registers its types with NetBox's GraphQL endpoint at /graphql/.
Authenticate with an API token (Authorization: Token <key>).
Filter fibre links by status:
The schema is read-only (no mutations auto-generated by strawberry-django) —
use the REST API at /api/plugins/osp/... for writes.
Base map tiles¶
The map ships with eight base layers. Seven are public online tile servers
(OpenStreetMap, Humanitarian OSM, CartoDB Positron / Dark Matter, OpenTopoMap,
CyclOSM, Esri World Imagery). The eighth is the bundled offline MBTiles served
by the plugin's tile proxy at /plugins/osp/tiles/<z>/<x>/<y>.<ext>.
If three tile-load failures occur within five seconds on an online layer, the
map auto-falls-back to the offline layer and shows a toast with a Retry
online button. The user's explicit choice persists across reloads via
localStorage.
To replace the bundled offline tiles with your own area's imagery, drop one
or more .mbtiles files at <MEDIA_ROOT>/osp_tiles/ — they take precedence
over the bundled stub. See tile bundling for the build
workflow.