Service Templates #1308

Closed
opened 2025-12-29 16:31:17 +01:00 by adam · 4 comments
Owner

Originally created by @darkstar on GitHub (Oct 13, 2017).

Originally assigned to: @jeremystretch on GitHub.

Issue type

[x] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.2.1

Description

Currently, you can assign a Service (TCP/UDP + Port Number) to a device/VM by hand.

It would be nice to have some sort of "Service Template" where you could assign a name to one (or more?) TCP/UDP ports and attach that to a VM. That would make sure that the name is the same for all VMs/devices and that no typos sneak in.

For example you could define a service template "iSCSI" with TCP Port 3260, and another one called "CIFS file services" with TCP Ports 139 and 445. Some predefined ones could also be nice ("HTTP", "HTTPS", "SSH", "NFS", "CIFS", ...?)

Originally created by @darkstar on GitHub (Oct 13, 2017). Originally assigned to: @jeremystretch on GitHub. ### Issue type [x] Feature request <!-- Requesting the implementation of a new feature --> [ ] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> ### Environment * Python version: 3.5.2 * NetBox version: 2.2.1 ### Description Currently, you can assign a Service (TCP/UDP + Port Number) to a device/VM by hand. It would be nice to have some sort of "Service Template" where you could assign a name to one (or more?) TCP/UDP ports and attach that to a VM. That would make sure that the name is the same for all VMs/devices and that no typos sneak in. For example you could define a service template "iSCSI" with TCP Port 3260, and another one called "CIFS file services" with TCP Ports 139 and 445. Some predefined ones could also be nice ("HTTP", "HTTPS", "SSH", "NFS", "CIFS", ...?)
adam added the status: acceptedtype: feature labels 2025-12-29 16:31:17 +01:00
adam closed this issue 2025-12-29 16:31:17 +01:00
Author
Owner

@wdennis commented on GitHub (Feb 25, 2020):

Shouldn't services be a discrete object class (like a Site or Device Type), attachable to a IP (or multiple/all IPs) on a device, instead of being defined on a device-by-device basis? It's a bit silly to keep defining "TCP/22" as "SSH" on multiple devices for instance...

Interested in services due to integration with Nornir (https://github.com/nornir-automation/nornir) using Netbox as an inventory provider; Nornir wants a "port" (TCP port to connect to) defined as one of its host attributes. The thinking is that perhaps we can use Netbox service attachment to the default IP for this.

@wdennis commented on GitHub (Feb 25, 2020): Shouldn't services be a discrete object class (like a Site or Device Type), attachable to a IP (or multiple/all IPs) on a device, instead of being defined on a device-by-device basis? It's a bit silly to keep defining "TCP/22" as "SSH" on multiple devices for instance... Interested in services due to integration with Nornir (https://github.com/nornir-automation/nornir) using Netbox as an inventory provider; Nornir wants a "port" (TCP port to connect to) defined as one of its host attributes. The thinking is that perhaps we can use Netbox service attachment to the default IP for this.
Author
Owner

@ifoughal commented on GitHub (Oct 26, 2021):

It would be handy to implement the templates as generic service template, that we can assign to VMs, thus, enabling users to define the template services themselves, and attach them to the type of device later on. (VMs, switches, sd-wan appliances, etc.)

@ifoughal commented on GitHub (Oct 26, 2021): It would be handy to implement the templates as generic service template, that we can assign to VMs, thus, enabling users to define the template services themselves, and attach them to the type of device later on. (VMs, switches, sd-wan appliances, etc.)
Author
Owner

@pobk commented on GitHub (Dec 8, 2021):

It would be handy to implement the templates as generic service template, that we can assign to VMs, thus, enabling users to define the template services themselves, and attach them to the type of device later on. (VMs, switches, sd-wan appliances, etc.)

A minor input but this should be assignable to anything with an IP.

I currently have an integration issue as well. We use services to indicate application spaces hosts by nodes. NetBox inventory for ansible inventory currently uses the service name to group on. SInce this is a free-form field and not a slug or some other object, this means we're having to rely on strict enforcement of naming for service names.

A service template should include a slug field for uniform grouping and filtering purposes.

@pobk commented on GitHub (Dec 8, 2021): > It would be handy to implement the templates as generic service template, that we can assign to VMs, thus, enabling users to define the template services themselves, and attach them to the type of device later on. (VMs, switches, sd-wan appliances, etc.) A minor input but this should be assignable to anything with an IP. I currently have an integration issue as well. We use services to indicate application spaces hosts by nodes. NetBox inventory for ansible inventory currently uses the service name to group on. SInce this is a free-form field and not a slug or some other object, this means we're having to rely on strict enforcement of naming for service names. A service template should include a slug field for uniform grouping and filtering purposes.
Author
Owner

@jeremystretch commented on GitHub (Jan 12, 2022):

Shouldn't services be a discrete object class (like a Site or Device Type), attachable to a IP (or multiple/all IPs) on a device, instead of being defined on a device-by-device basis? It's a bit silly to keep defining "TCP/22" as "SSH" on multiple devices for instance...

Services aren't defined this way because it quickly becomes burdensome when you need to run a service on a nonstandard port. For example, you might run HTTP on tcp/80, or tcp/8000, or tcp/8080, etc.

@jeremystretch commented on GitHub (Jan 12, 2022): > Shouldn't services be a discrete object class (like a Site or Device Type), attachable to a IP (or multiple/all IPs) on a device, instead of being defined on a device-by-device basis? It's a bit silly to keep defining "TCP/22" as "SSH" on multiple devices for instance... Services aren't defined this way because it quickly becomes burdensome when you need to run a service on a nonstandard port. For example, you might run HTTP on tcp/80, or tcp/8000, or tcp/8080, etc.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1308