Global Search by Service Name in Web UI #3687

Closed
opened 2025-12-29 18:30:37 +01:00 by adam · 4 comments
Owner

Originally created by @mahomedh on GitHub (May 14, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.8.4

Proposed Functionality

Globally search for all Devices and VMs that have a service name that matches search parameter. For example if you search for SSH it lists all devices with a matching service name.

Use Case

I'll personally be using the services to record all A Records that are associated with the particular Web Server device/VM. But this is not very much use if you can't search for devices with the assigned address.

Another use case would be if you want to search for all servers that have a particular service assigned (like postgresql for example).

Database Changes

None (afaik)

External Dependencies

None (afaik)

Originally created by @mahomedh on GitHub (May 14, 2020). ### Environment * Python version: 3.6.9 * NetBox version: 2.8.4 ### Proposed Functionality Globally search for all Devices and VMs that have a service name that matches search parameter. For example if you search for `SSH` it lists all devices with a matching service name. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case I'll personally be using the services to record all A Records that are associated with the particular Web Server device/VM. But this is not very much use if you can't search for devices with the assigned address. Another use case would be if you want to search for all servers that have a particular service assigned (like postgresql for example). <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes None (afaik) <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None (afaik)
adam closed this issue 2025-12-29 18:30:37 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 14, 2020):

I'll personally be using the services to record all A Records that are associated with the particular Web Server device/VM.

This is not a valid use of the service model. A service is a running process on a device that is associated with a specific protocol (TCP/UDP) and port number (and optionally one or more IP addresses assigned to the device). It is intended to model available services and is not suitable for tracking DNS records.

@jeremystretch commented on GitHub (May 14, 2020): > I'll personally be using the services to record all A Records that are associated with the particular Web Server device/VM. This is not a valid use of the service model. A service is a running process on a device that is associated with a specific protocol (TCP/UDP) and port number (and optionally one or more IP addresses assigned to the device). It is intended to model available services and is not suitable for tracking DNS records.
Author
Owner

@mahomedh commented on GitHub (May 14, 2020):

I agree it's not the intended design, but it works for our use case as we have upto 90 records on some servers. The DNS and custom text fields cannot accomodate this many records. Currently we keep this in a text hosts file. The idea is to be able to store it in Netbox and build the hosts file from data stored in Netbox.

Additionally, technically the service that is running is www.siteA.com on tcp port 443 and www.siteB.com on tcp port 443 etc.

Regardless though, would you not agree it would still be useful to search by service name?

@mahomedh commented on GitHub (May 14, 2020): I agree it's not the intended design, but it works for our use case as we have upto 90 records on some servers. The DNS and custom text fields cannot accomodate this many records. Currently we keep this in a text hosts file. The idea is to be able to store it in Netbox and build the hosts file from data stored in Netbox. Additionally, technically the service that is running is `www.siteA.com on tcp port 443` and `www.siteB.com on tcp port 443` etc. Regardless though, would you not agree it would still be useful to search by service name?
Author
Owner

@jeremystretch commented on GitHub (May 15, 2020):

I don't think it makes sense to search for devices by the name of an assigned service. That seems prone to returning too many irrelevant results. For example, you might be looking for devices with "dns" in their name but end up with all devices owning a "DNS" service.

@jeremystretch commented on GitHub (May 15, 2020): I don't think it makes sense to search for devices by the name of an assigned service. That seems prone to returning too many irrelevant results. For example, you might be looking for devices with "dns" in their name but end up with all devices owning a "DNS" service.
Author
Owner

@mahomedh commented on GitHub (May 15, 2020):

I see your concern. It doesn't matter much now because I found that the "Name" field is too short for some our aliases. Instead, I now create the following:

Name          Protocol    Port      IP                   Description
DNS Alias     TCP         53        192.168.0.10/24      www.mydomain.com

I have also just discovered that I can go to IPAM > Services and I can search there. So although it's not as convenient, it makes it usable for our use case.

So happy to close this. Thanks.

@mahomedh commented on GitHub (May 15, 2020): I see your concern. It doesn't matter much now because I found that the "Name" field is too short for some our aliases. Instead, I now create the following: ``` Name Protocol Port IP Description DNS Alias TCP 53 192.168.0.10/24 www.mydomain.com ``` I have also just discovered that I can go to IPAM > Services and I can search there. So although it's not as convenient, it makes it usable for our use case. So happy to close this. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3687