Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
784072f
refactor: split import_utils.py into a package
marcinpsk Feb 26, 2026
c603a29
fix: update mock.patch paths for import_utils package refactor
marcinpsk Feb 26, 2026
8e65b6d
refactor: move Cluster to module-level import in device_operations
marcinpsk Feb 26, 2026
e92eef6
fix: remove stale virtualization.models.Cluster patch in VM import test
marcinpsk Feb 26, 2026
d25344b
feat: honour use_sysname and strip_domain in validation path (port fr…
marcinpsk Feb 27, 2026
e47bf19
Merge branch 'develop' into refactor/utils-package-split
marcinpsk Feb 27, 2026
d977fe3
feat: port serial-matching and conflict-resolution fixes to split imp…
marcinpsk Mar 1, 2026
46d6b08
fix: add librenms_id collision mock to force-with-mismatch tests
marcinpsk Mar 1, 2026
7408b7a
feat: librenms_id refactor from int to JSON
marcinpsk Feb 28, 2026
b9a44b1
fix: address librenms_id-related PR review comments
marcinpsk Feb 28, 2026
16dfb65
fix: update device_filter mocks to accept Q positional args
marcinpsk Feb 28, 2026
167eade
feat: squash-merge inventory branch onto refactor/librenms_id
marcinpsk Mar 1, 2026
3861167
fix: migrate librenms_id CF type to json; fix Install Branch logic
marcinpsk Mar 1, 2026
4ecce10
refactor: module_path badges are informational only; never block install
marcinpsk Mar 1, 2026
7ac54bb
fix: use modulebaytemplates instead of modulebays in module_type_is_e…
marcinpsk Mar 1, 2026
7d0ec6c
feat: legacy librenms_id int→JSON migration action on import page
marcinpsk Mar 1, 2026
9be9e15
fix: PR review fixes — schema, server_key, bulk_import, legacy badge,…
marcinpsk Mar 1, 2026
46d3775
fix: update test_init to expect json CF type instead of integer
marcinpsk Mar 1, 2026
4c31e0b
PR review: code quality, accessibility and correctness fixes
marcinpsk Mar 1, 2026
54b7623
PR review: inventory-specific fixes
marcinpsk Mar 1, 2026
0686cc7
Fix _refresh_existing_device: readiness logic and server_key
marcinpsk Mar 2, 2026
9a13a27
chore: uv.lock
marcinpsk Mar 2, 2026
0234f2e
fix: batch 4 PR review fixes
marcinpsk Mar 2, 2026
61dab4a
fix: inventory-specific batch 4 fixes
marcinpsk Mar 2, 2026
17d58c0
fix: batch 5 PR review fixes
marcinpsk Mar 2, 2026
d7ef8ac
fix: inventory-only: fix idx==0 cancellation check (enumerate starts …
marcinpsk Mar 2, 2026
0fa8e07
fix: batch 6 PR review fixes
marcinpsk Mar 2, 2026
4506ba6
fix: batch 7 - RQ-first cancellation, VC position off-by-one, platfor…
marcinpsk Mar 2, 2026
df133cb
port: upstream PR#227 maintainer commits to inventory branch
marcinpsk Mar 2, 2026
bb32f3f
fix: log exceptions in LibreNMSSettings get_or_create (PR#227 comment…
marcinpsk Mar 2, 2026
01c3d6b
amend! port: upstream PR#227 maintainer commits to inventory branch
marcinpsk Mar 2, 2026
622665e
port: upstream PR#227 maintainer commits to inventory branch
marcinpsk Mar 2, 2026
83fad51
port: upstream PR#227 maintainer commits to inventory branch
marcinpsk Mar 2, 2026
b3fed51
feat: show server name(s) alongside librenms_id in validation modal
marcinpsk Mar 2, 2026
2d26019
feat: show all LibreNMS server mappings on device sync page
marcinpsk Mar 2, 2026
9d520a8
fix: pass naming preferences to post-import re-validation
marcinpsk Mar 2, 2026
3d67b40
Address PR review findings: cache key naming flags, errored job termi…
marcinpsk Mar 3, 2026
0524e31
Fix PR review findings: race conditions, vc dedup, naming keys, error…
marcinpsk Mar 3, 2026
347938a
Fix PR review batch 3: logging, cache scoping, guards, precedence, locks
marcinpsk Mar 3, 2026
c846c5c
Fix PR review batch 4: disabled field, truthy parsing, VC rollback, p…
marcinpsk Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Below are the dev container defaults. The field name to change these defaults is
- Plugin loader: enabled; reads `.devcontainer/config/plugin-config.py` if present
- If `plugin-config.py` is missing: plugin is enabled with empty config (features won’t work until configured)



## 🔧 Configuration

### NetBox Version and Environment (use .devcontainer/.env)
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/scripts/diagnose.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# netbox-librenms-plugin devcontainer script

echo "🔍 DevContainer Startup Diagnostics"
echo "=================================="
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/scripts/load-aliases.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# netbox-librenms-plugin devcontainer script
# Quick alias loader for current session
# Usage: source .devcontainer/scripts/load-aliases.sh

Expand Down
1 change: 1 addition & 0 deletions .devcontainer/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# netbox-librenms-plugin devcontainer script
set -e

echo "🚀 Setting up NetBox LibreNMS Plugin development environment..."
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/scripts/start-netbox.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# netbox-librenms-plugin devcontainer script

# Check if we should run in background or foreground
BACKGROUND=false
Expand All @@ -18,7 +19,6 @@ if [ "$CODESPACES" = "true" ] && [ -n "$CODESPACE_NAME" ]; then
echo "🔗 GitHub Codespaces detected"
else
ACCESS_URL="http://localhost:8000"
echo "🐛 Debug: ACCESS_URL is set to: $ACCESS_URL"
fi

# Load shared process management helpers
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/scripts/welcome.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# netbox-librenms-plugin devcontainer script

# Ensure aliases are available in the postAttach terminal session
source "$(dirname "$0")/load-aliases.sh" 2>/dev/null
Expand Down Expand Up @@ -44,7 +45,7 @@ if [ -n "$CODESPACES" ]; then
echo " 💡 Click the link in the Ports panel or look for the 'Open in Browser' button"
else
echo "🖥️ Local Development Environment:"
echo " NetBox will be available at: http://localhost:8000 (paste into you browser)"
echo " NetBox will be available at: http://localhost:8000 (paste into your browser)"
fi

echo ""
Expand Down
28 changes: 3 additions & 25 deletions .github/workflows/lint-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ name: Lint and Format

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
format-and-lint:
Expand All @@ -20,31 +14,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.9'
cache: 'pip'
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff

- name: Run Ruff linting
run: |
echo "::group::Ruff Linting"
ruff check . --output-format=github
echo "::endgroup::"
run: ruff check .

- name: Run Ruff formatting check
run: |
echo "::group::Ruff Formatting"
ruff format --check .
echo "::endgroup::"

- name: Report formatting issues
if: failure()
run: |
echo "::error::Formatting or linting issues detected!"
echo "To fix locally, run:"
echo " ruff check --fix ."
echo " ruff format ."
echo "Then commit and push the changes."
run: ruff format --check .
28 changes: 28 additions & 0 deletions contrib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contrib: Example Mapping Files

This directory contains example YAML mapping files for bulk import into the
NetBox LibreNMS Plugin. Each file can be imported via the plugin's bulk import
feature in the NetBox UI.

## How to Import

1. Navigate to the mapping page (e.g., **LibreNMS → Device Type Mappings**)
2. Click the **Import** button (upload icon) in the top right
3. Select **YAML** format
4. Paste the contents of the relevant YAML file
5. Click **Submit**

## Available Mappings

| File | Description |
|------|-------------|
| `interface_type_mappings.yaml` | Maps LibreNMS interface types + speeds to NetBox interface types |
| `device_type_mappings.yaml` | Maps LibreNMS hardware strings to NetBox device types |
| `module_type_mappings.yaml` | Maps LibreNMS inventory model names to NetBox module types (incl. transceivers) |
| `module_bay_mappings.yaml` | Maps LibreNMS inventory container names to NetBox module bay names |

## Customisation

These files are **examples** — adjust values to match the device types, module
types, and interface types defined in your NetBox instance. The `netbox_*`
fields must reference objects that already exist in your NetBox.
73 changes: 73 additions & 0 deletions contrib/device_type_mappings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Device Type Mappings
#
# Maps LibreNMS hardware strings to NetBox device types.
# Import via: LibreNMS Plugin > Device Type Mappings > Import
#
# Fields:
# librenms_hardware — Hardware string exactly as shown in LibreNMS
# netbox_device_type — NetBox DeviceType (matched by model name or ID)
# description — Optional note
#
# The librenms_hardware value is matched case-insensitively.
# These mappings are checked BEFORE the built-in part_number/model fallback.

# Juniper — LibreNMS reports verbose marketing names
- librenms_hardware: "Juniper MX480 Internet Backbone Router"
netbox_device_type: "MX480"
description: "Juniper MX480 chassis"

- librenms_hardware: "Juniper MX960 Internet Backbone Router"
netbox_device_type: "MX960"
description: "Juniper MX960 chassis"

- librenms_hardware: "Juniper MX304 Edge Router"
netbox_device_type: "MX304"
description: "Juniper MX304 edge router"

- librenms_hardware: "JNP10008 [PTX10008]"
netbox_device_type: "PTX10008"
description: "Juniper PTX10008 core router"

- librenms_hardware: "JNP7100-32C [ACX7100-32C]"
netbox_device_type: "ACX7100-32C"
description: "Juniper ACX7100-32C"

- librenms_hardware: "JNP7024 [ACX7024]"
netbox_device_type: "ACX7024"
description: "Juniper ACX7024"

- librenms_hardware: "Juniper JNP10008 Internet Backbone Router"
netbox_device_type: "PTX10008"
description: "Juniper PTX10008 (alternate hardware string)"

- librenms_hardware: "Juniper VRR Internet Backbone Router"
netbox_device_type: "VRR"
description: "Juniper Virtual Route Reflector"

# Nokia — model string matches directly in most cases
- librenms_hardware: "7750 SR-7s"
netbox_device_type: "7750 SR-7s"
description: "Nokia 7750 SR-7s service router"

# Cisco — often matches by part_number but not always
- librenms_hardware: "WS-C4900M"
netbox_device_type: "WS-C4900M"
description: "Cisco Catalyst 4900M"

# Cisco IOS XR
- librenms_hardware: "8201-SYS"
netbox_device_type: "8201"
description: "Cisco 8201 (hardware string differs from model)"

# UfiSpace — LibreNMS reports SONiC/ONIE platform names
- librenms_hardware: "x86-64-ufispace-s9610-36d-r0"
netbox_device_type: "S9610-36D"
description: "UfiSpace S9610-36D"

- librenms_hardware: "x86-64-ufispace-s9610-46dx-r0"
netbox_device_type: "S9610-46DX"
description: "UfiSpace S9610-46DX"

- librenms_hardware: "x86-64-ufispace-s9700-53dx-r9"
netbox_device_type: "S9700-53DX"
description: "UfiSpace S9700-53DX"
Loading
Loading