Add tally of remaining Available IPs in web UI views #3663

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

Originally created by @schmitmd on GitHub (May 9, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.7.11

Note: I'm aware that 2.7.11 is not the latest stable version, but the functionality being requested is not in the latest version of the code either. If I need to deploy 2.8.3 to see the same and update this issue, I can do that.

Proposed Functionality

Add a count of the number of remaining Available IPs in Prefix views (and any others that seem logical). For instance, this could be under https://netbox.example.com/ipam/prefixes/1/ in a field, but it would also be nice to have a tally next to the Utilization percentage bar in the https://netbox.example.com/ipam/prefixes/ listing view as well.

Use Case

Showing a prefix to a particular user or tenant with a tally of remaining available IPs would make understanding the data easier and simpler without the need to look through the Prefix definition to find out how many are available. I understand that this is easily done in the API, but the UI is all that some of my consumers see.

Database Changes

As far as I'm aware, this would not require a database change.

External Dependencies

As far as I'm aware, this would not require any external dependencies.

Originally created by @schmitmd on GitHub (May 9, 2020). ### Environment * Python version: 3.6.8 * NetBox version: 2.7.11 Note: I'm aware that 2.7.11 is not the latest stable version, but the functionality being requested is not in the latest version of the code either. If I need to deploy 2.8.3 to see the same and update this issue, I can do that. ### Proposed Functionality Add a count of the number of remaining Available IPs in Prefix views (and any others that seem logical). For instance, this could be under https://netbox.example.com/ipam/prefixes/1/ in a field, but it would also be nice to have a tally next to the Utilization percentage bar in the https://netbox.example.com/ipam/prefixes/ listing view as well. ### Use Case Showing a prefix to a particular user or tenant with a tally of remaining available IPs would make understanding the data easier and simpler without the need to look through the Prefix definition to find out how many are available. I understand that this is easily done in the API, but the UI is all that some of my consumers see. ### Database Changes As far as I'm aware, this would not require a database change. ### External Dependencies As far as I'm aware, this would not require any external dependencies.
adam added the type: featurestatus: needs ownerpending closure labels 2025-12-29 18:30:26 +01:00
adam closed this issue 2025-12-29 18:30:26 +01:00
Author
Owner

@kobayashi commented on GitHub (May 10, 2020):

I think total cound of available ips is almost same as Utilization. So putting either one is okay but both may redundant.

@kobayashi commented on GitHub (May 10, 2020): I think total cound of available ips is almost same as Utilization. So putting either one is okay but both may redundant.
Author
Owner

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

I don't follow. NetBox already display the utilization of each prefix as a percentage. Are you proposing to display this same information as an absolute count as well? I agree with @kobayashi; seems redundant, especially for larger prefixes. For example, IMO it makes sense to say that a /16 is 32% utilized but not that it has 44,564 IPs available.

@jeremystretch commented on GitHub (May 11, 2020): I don't follow. NetBox already display the utilization of each prefix as a percentage. Are you proposing to display this same information as an absolute count as well? I agree with @kobayashi; seems redundant, especially for larger prefixes. For example, IMO it makes sense to say that a /16 is 32% utilized but not that it has 44,564 IPs available.
Author
Owner

@fgadot commented on GitHub (May 11, 2020):

It's a little redundant, but some people are not comfortable with maths. Typical scenario, someone has to add 327 new servers, and the view shows "88% used". -> We know that 12% is free, but how much IPs is this really? Just my 2 cents.

@fgadot commented on GitHub (May 11, 2020): It's a little redundant, but some people are not comfortable with maths. Typical scenario, someone has to add 327 new servers, and the view shows "88% used". -> We know that 12% is free, but how much IPs is this really? Just my 2 cents.
Author
Owner

@schmitmd commented on GitHub (May 11, 2020):

I hear you on the redundancy comments and I think you're right. In my particular use case though, I actually would indeed prefer to see "44,564 available" next to a /16 instead of "32%"

Do you think maybe a setting toggle would be workable? Something that shows count or percentage based on something in configuration.py (or the new user settings functionality, maybe)?

@schmitmd commented on GitHub (May 11, 2020): I hear you on the redundancy comments and I think you're right. In my particular use case though, I actually would indeed prefer to see "44,564 available" next to a /16 instead of "32%" Do you think maybe a setting toggle would be workable? Something that shows count or percentage based on something in configuration.py (or the new user settings functionality, maybe)?
Author
Owner

@fgadot commented on GitHub (May 11, 2020):

Just do something easy:
"Utilization of IP range: 50% (2,345 out of 4,690)"

This presents two good points:

  • a percentage, because it is easier in the human brain to represent portions of things in percentages. 50% for example is quicker to assimilate to the brain than "2,345 out of 4,690)

  • A number, because when we already have a number in our head about the numbers of IP we are going to need (for example "I need to assign 382 IPs to a rack tomorrow", it is easier to see that 328 can work with "2,235 IP left" versus "12% of 900 is free"

@fgadot commented on GitHub (May 11, 2020): Just do something easy: "Utilization of IP range: 50% (2,345 out of 4,690)" This presents two good points: - a percentage, because it is easier in the human brain to represent portions of things in percentages. 50% for example is quicker to assimilate to the brain than "2,345 out of 4,690) - A number, because when we already have a number in our head about the numbers of IP we are going to need (for example "I need to assign 382 IPs to a rack tomorrow", it is easier to see that 328 can work with "2,235 IP left" versus "12% of 900 is free"
Author
Owner

@DanSheps commented on GitHub (May 12, 2020):

I can see a benefit to this, but I do agree most of the time it will be redundant. the "IP Addresses" tab already has this mostly available. I imagine we could make get_utilization return a tuple(percentage, used, total) instead of just the percentage.

@DanSheps commented on GitHub (May 12, 2020): I can see a benefit to this, but I do agree most of the time it will be redundant. the "IP Addresses" tab already has this mostly available. I imagine we could make get_utilization return a tuple(percentage, used, total) instead of just the percentage.
Author
Owner

@fgadot commented on GitHub (May 12, 2020):

@DanSheps Yes, that would help @schmitmd

@fgadot commented on GitHub (May 12, 2020): @DanSheps Yes, that would help @schmitmd
Author
Owner

@schmitmd commented on GitHub (Jun 8, 2020):

I think fgadot and DanSheps' feedback is in line with what I was hoping to get out of this. Are we still looking for additional feedback? Looks like almost a month since discussion stopped.

@schmitmd commented on GitHub (Jun 8, 2020): I think fgadot and DanSheps' feedback is in line with what I was hoping to get out of this. Are we still looking for additional feedback? Looks like almost a month since discussion stopped.
Author
Owner

@AllenEllis commented on GitHub (Jul 22, 2020):

Just to chime in, perhaps a tooltip is a way to achieve this result without crowding the UI.

Most web applications that I interact with these days that show relative dates ("6 days ago") will show the full date/time as a tooltip when you hover over them.

Example with GitHub:

Screen Shot 2020-07-21 at 11 46 26 PM

That sets a precedent for a similar behavior here. Keep the existing UI as just showing "33% used", as it's a predictable & compact size. When you hover it would say "44,564 available out of 65,534 total"

@AllenEllis commented on GitHub (Jul 22, 2020): Just to chime in, perhaps a tooltip is a way to achieve this result without crowding the UI. Most web applications that I interact with these days that show relative dates ("6 days ago") will show the full date/time as a tooltip when you hover over them. Example with GitHub: > <img width="380" alt="Screen Shot 2020-07-21 at 11 46 26 PM" src="https://user-images.githubusercontent.com/13372560/88132080-89817e80-cbac-11ea-80ac-fbcba86d1eb4.png"> That sets a precedent for a similar behavior here. Keep the existing UI as just showing "33% used", as it's a predictable & compact size. When you hover it would say "44,564 available out of 65,534 total"
Author
Owner

@stale[bot] commented on GitHub (Sep 7, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Sep 7, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@schmitmd commented on GitHub (Sep 7, 2020):

Is there anything I can do to be helpful toward this? I'm not much of a Python dev, but I could give it a shot, maybe? I might be able to set get_utilization to return a tuple, but I don't even know where I'd start if the tooltip is the way to go.

@schmitmd commented on GitHub (Sep 7, 2020): Is there anything I can do to be helpful toward this? I'm not much of a Python dev, but I could give it a shot, maybe? I might be able to set get_utilization to return a tuple, but I don't even know where I'd start if the tooltip is the way to go.
Author
Owner

@jvanderaa commented on GitHub (Oct 21, 2020):

@jeremystretch this is one that I think I could take some work to do so.

@jvanderaa commented on GitHub (Oct 21, 2020): @jeremystretch this is one that I think I could take some work to do so.
Author
Owner

@jeremystretch commented on GitHub (May 21, 2021):

With configure tables now in place, this can easily be implemented by adding an optional column to display the number of available IP addresses.

@jeremystretch commented on GitHub (May 21, 2021): With configure tables now in place, this can easily be implemented by adding an optional column to display the number of available IP addresses.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 21, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jul 21, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@schmitmd commented on GitHub (Jul 21, 2021):

I would still like to see this feature implemented, but I understand if it's too low-pri.

@schmitmd commented on GitHub (Jul 21, 2021): I would still like to see this feature implemented, but I understand if it's too low-pri.
Author
Owner

@jeremystretch commented on GitHub (Sep 1, 2021):

See #7044 for a proposed alternative implementation.

@jeremystretch commented on GitHub (Sep 1, 2021): See #7044 for a proposed alternative implementation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3663