-
Notifications
You must be signed in to change notification settings - Fork 0
Inventory rebased #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5d4392c
0242afe
b14cf4a
05cd80f
ec4faa2
a9ad37a
62f838c
cd04118
298a996
6c1938e
0ded2b6
ac32d75
013eee3
c6ce2bf
ff122d3
248db7c
ff38c19
19be3a0
0eb26b5
8aed2a9
700a5bc
b398090
35f5a84
bee4af2
865a39e
9793c65
2b38f84
d3f917a
f6ebcf3
714b730
dd47910
6c42769
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,7 @@ updates: | |
| github-actions: | ||
| patterns: | ||
| - "*" | ||
| - package-ecosystem: "uv" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| ## Summary | ||
| Briefly describe what this PR does in plain English, and provide as much of the following information as possible. | ||
|
|
||
| ## Motivation / Problem | ||
| What issue does this solve? | ||
| - Bug | ||
| - Feature | ||
| - Refactor | ||
| - Maintenance / cleanup | ||
|
|
||
| Link any related issues if applicable. | ||
|
|
||
| ## Scope of Change | ||
| Delete items that don’t apply: | ||
|
|
||
| - Sync/Import logic | ||
| - NetBox models / ORM | ||
| - LibreNMS API interaction | ||
| - Config / settings | ||
| - Web UI / templates | ||
| - Database migrations | ||
| - Tests | ||
| - Docs only | ||
| - Other: <describe> | ||
|
|
||
| ## How Was This Tested? | ||
| Delete items that don’t apply and describe briefly. | ||
|
|
||
| - Unit tests: <yes/no + what> | ||
| - Manual testing: <yes/no + what> | ||
| - Not tested: <explain why> | ||
|
|
||
| ### Manual Test Steps (if applicable) | ||
| 1. | ||
| 2. | ||
| 3. | ||
|
|
||
| ## Risk Assessment | ||
| - Does this change affect existing users? | ||
| - Could this cause unintended imports / updates? | ||
|
|
||
| Explain briefly. | ||
|
|
||
| ## Backwards Compatibility | ||
| - No breaking changes | ||
| - Breaking change (explain and document) | ||
|
|
||
| ## Other Notes | ||
| Anything the maintainer(s) should pay particular attention to? | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,7 +59,7 @@ jobs: | |
| working-directory: netbox-librenms-plugin | ||
| run: | | ||
| pip install -e . | ||
| pip install pytest pytest-django | ||
| pip install pytest pytest-django pytest-cov | ||
|
|
||
| - name: Set up configuration | ||
| working-directory: netbox | ||
|
|
@@ -75,4 +75,14 @@ jobs: | |
| env: | ||
| NETBOX_CONFIGURATION: netbox.configuration | ||
| run: | | ||
| python -m pytest ../../netbox-librenms-plugin/netbox_librenms_plugin/tests/ -v | ||
| python -m pytest ../../netbox-librenms-plugin/netbox_librenms_plugin/tests/ -v \ | ||
| --cov=netbox_librenms_plugin \ | ||
| --cov-report=html:../../netbox-librenms-plugin/coverage_html \ | ||
| --cov-report=term-missing | ||
|
|
||
| - name: Upload coverage report | ||
| uses: actions/upload-artifact@v4 | ||
| if: matrix.python-version == '3.12' | ||
| with: | ||
| name: coverage-report | ||
| path: netbox-librenms-plugin/coverage_html/ | ||
|
Comment on lines
+83
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/test.yaml | head -100Repository: marcinpsk/netbox-librenms-plugin Length of output: 3101 🌐 Web query:
💡 Result: The
Pin Other actions in this workflow ( 🔒 Proposed fix to pin the action SHA - name: Upload coverage report
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: matrix.python-version == '3.12'
with:
name: coverage-report
path: netbox-librenms-plugin/coverage_html/🤖 Prompt for AI Agents |
||
| 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. |
| 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" |
Uh oh!
There was an error while loading. Please reload this page.