NetBox plugin for locating the access switch, interface, VLAN, and related IP/MAC information of an endpoint by querying LibreNMS.
Current documented release: 1.0.1
中文说明:README_CN.md
- Lookup by
IPv4orMAC - Correlate
IP / MAC / VLAN / portfrom the same LibreNMS record chain as closely as possible - Show switch/device name, interface, terminal VLAN, and related IPv4
- Optionally map the LibreNMS management address back to a NetBox
Device - Expose raw API data in the UI for troubleshooting
- Tested target: NetBox
4.4.x - Plugin
min_version:4.0.0 - Python:
>= 3.10
Install the plugin into the same Python environment used by NetBox:
git clone https://github.com/Jaycelu/netbox_-endpoint_locator.git
cd netbox_-endpoint_locator
pip install -e .If you already installed an older version and only want to upgrade:
cd netbox_-endpoint_locator
git pull
pip install -e .Add the plugin in configuration.py:
PLUGINS = ["netbox_endpoint_locator"]
PLUGINS_CONFIG = {
"netbox_endpoint_locator": {
"librenms_url": "https://librenms.example.com",
"librenms_token": "YOUR_TOKEN",
# optional
"verify_ssl": False,
"timeout": 15,
"top_level_menu": False,
}
}Required settings:
librenms_urllibrenms_token
Optional settings:
verify_ssltimeouttop_level_menu
After updating the config, restart the NetBox web workers for your deployment model.
Examples:
sudo systemctl restart netbox netbox-rqOr restart the relevant containers / Gunicorn / uWSGI processes in your environment.
- Open NetBox
- Go to
Endpoint Locator -> Lookup - Enter an IPv4 address or MAC address
- Review the returned:
- MAC
- related IPv4
- LibreNMS host
- switch/device name
- interface
- VLAN
- NetBox device match
Accepted MAC input styles include plain hex, colon-separated, dash-separated, and dotted formats.
The plugin now prefers a canonical correlation path instead of mixing unrelated fields from multiple LibreNMS responses.
Starting in 1.0.0, the plugin keeps the canonical IP / MAC / VLAN relationship intact, then separately tries to localize the displayed switch and interface to the nearest access-side device instead of stopping at an upstream aggregation interface when topology evidence exists. When LLDP or port-stack data is missing, it can also infer a downstream edge from uplink descriptions that explicitly name the next-hop device.
For IP lookups:
- Query ARP by IP
- Extract MAC and ARP
port_id - Query FDB by MAC
- Score FDB candidates using ARP
port_id, device, interface, and VLAN hints - Read the winning port details for:
- device relation
- VLAN relation
- Resolve the display VLAN from LibreNMS VLAN resources
For MAC lookups:
- Query ARP by MAC
- Query FDB by MAC
- Score candidates with ARP/device/interface hints
- Enrich the selected FDB row with port and device details
This is what fixes the earlier mismatch where IP -> MAC looked correct but MAC -> IP/VLAN/port drifted to another interface.
LibreNMS must already have fresh ARP, FDB, port, and VLAN data. The plugin only performs on-demand read queries.
Primary API endpoints used:
GET /api/v0/resources/ip/arp/<ip-or-mac>GET /api/v0/resources/fdb/<mac>GET /api/v0/resources/fdb/<mac>/detailGET /api/v0/ports/<port_id>?with=deviceGET /api/v0/ports/<port_id>?with=vlansGET /api/v0/resources/vlans?hostname=<device>
The plugin tries to match the LibreNMS management address back to NetBox by looking for a NetBox device whose primary_ip4 matches the LibreNMS management IP / hostname field.
If the NetBox device is shown as Unmatched, verify that:
- LibreNMS is returning the management IP you expect
- the NetBox device has the correct
primary_ip4 - both systems refer to the same management address
If switch/device name is empty:
- LibreNMS may not be returning the device relation on that port
- open the
Raw Responsesection in the plugin UI and inspectportanddetail
If VLAN is empty:
- LibreNMS may not expose a resolvable FDB
vlan_id -> vlan_vlanmapping for that device - the plugin intentionally avoids guessing a wrong default VLAN
If MAC -> IP is empty:
- LibreNMS may not currently have an ARP entry for that MAC
- the FDB match can still succeed even if ARP is stale or missing
If no interface is found:
- verify that LibreNMS web UI can see the endpoint in ARP/FDB tables first
- then compare the plugin
Raw Responseoutput with the corresponding LibreNMS page
- Package metadata version:
1.0.1 - Plugin config class:
netbox_endpoint_locator/__init__.py - Detailed Chinese deployment and troubleshooting guide:
README_CN.md