[PR #4844] [MERGED] Adds name lookup to NAPALM if no primary IP address exists for device #12928

Closed
opened 2025-12-29 22:24:25 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4844
Author: @jvanderaa
Created: 7/10/2020
Status: Merged
Merged: 7/13/2020
Merged by: @jeremystretch

Base: developHead: napalm_lookup_hostname


📝 Commits (3)

  • 7788bf3 Adds to NAPALM, name lookup if no primary IP address for device
  • cac4892 Adds verification of device.name configured
  • ba8b99d Moves location of the IP address / hostname check and assignment

📊 Changes

1 file changed (+20 additions, -6 deletions)

View changed files

📝 netbox/dcim/api/views.py (+20 -6)

📄 Description

Fixes: #4831

  • For NAPALM connection, uses Python socket library to attempt to resolve a name to IP address when a primary IP address is not defined.
  • Name resolution must be done without adding any suffixes to the name such as: rtr01 would be supplied back to name resolution. If rtr01 does not resolve to anything on the NetBox host, no translation will be found.
    • If hosts exist in *.infra.example.com, but the host can only lookup against *.example.com, then the name resolution will fail
  • Remaps IP address to use "host" for the name to indicate could be an IP address or could be a device name

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/4844 **Author:** [@jvanderaa](https://github.com/jvanderaa) **Created:** 7/10/2020 **Status:** ✅ Merged **Merged:** 7/13/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `napalm_lookup_hostname` --- ### 📝 Commits (3) - [`7788bf3`](https://github.com/netbox-community/netbox/commit/7788bf3ce34aaa98d83bfafdb14bc82a7079e7a5) Adds to NAPALM, name lookup if no primary IP address for device - [`cac4892`](https://github.com/netbox-community/netbox/commit/cac48924aeba4c1116af3e4b2cca9991e3b077f8) Adds verification of device.name configured - [`ba8b99d`](https://github.com/netbox-community/netbox/commit/ba8b99d3b8fb1a31781c563b9b511c383abc4731) Moves location of the IP address / hostname check and assignment ### 📊 Changes **1 file changed** (+20 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/api/views.py` (+20 -6) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be opened for approval prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. Please indicate the relevant feature request or bug report below. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ACCEPTED BUG REPORT OR FEATURE REQUEST, IT WILL BE MARKED AS INVALID AND CLOSED. --> ### Fixes: #4831 <!-- Please include a summary of the proposed changes below. --> - For NAPALM connection, uses Python socket library to attempt to resolve a name to IP address when a primary IP address is not defined. - Name resolution must be done without adding any suffixes to the name such as: `rtr01` would be supplied back to name resolution. If `rtr01` does not resolve to anything on the NetBox host, no translation will be found. - If hosts exist in *.infra.example.com, but the host can only lookup against *.example.com, then the name resolution will fail - Remaps IP address to use "host" for the name to indicate could be an IP address or could be a device name --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:24:25 +01:00
adam closed this issue 2025-12-29 22:24:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12928