[PR #545] [CLOSED] Add Utilization to PrefixTable #12074

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/545
Author: @csfreak
Created: 9/9/2016
Status: Closed

Base: developHead: prefix-utilization


📝 Commits (2)

📊 Changes

2 files changed (+34 additions, -1 deletions)

View changed files

📝 netbox/ipam/models.py (+32 -0)
📝 netbox/ipam/tables.py (+2 -1)

📄 Description

From https://github.com/digitalocean/netbox/issues/40

This patch calculates prefix utilization based on the following rules and displays it in the PrefixTable:

  1. If the prefix has any child prefixes in the same VRF, use sum of child prefix size. This is the same behavior as aggregates
  2. If the prefix has no child prefixes and does have IPs, and is not a /32, use sum of IPs +2 over prefix size.
  3. If the prefix has no child prefixes and does have IPs, and is a /32, use sum of IPs over prefix size.
  4. If the prefix has no child prefixes and no IPs, return 0.

🔄 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/545 **Author:** [@csfreak](https://github.com/csfreak) **Created:** 9/9/2016 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `prefix-utilization` --- ### 📝 Commits (2) - [`fe0fa74`](https://github.com/netbox-community/netbox/commit/fe0fa743c4dcae694a16ba5337c4e41620258dd4) Add Utilization to PrefixTable - [`e648c2b`](https://github.com/netbox-community/netbox/commit/e648c2bc50c73d0ea35ac49b5fc1136c4b5c30be) Pep8 Fixes ### 📊 Changes **2 files changed** (+34 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/models.py` (+32 -0) 📝 `netbox/ipam/tables.py` (+2 -1) </details> ### 📄 Description From https://github.com/digitalocean/netbox/issues/40 This patch calculates prefix utilization based on the following rules and displays it in the PrefixTable: 1. If the prefix has any child prefixes in the same VRF, use sum of child prefix size. This is the same behavior as aggregates 2. If the prefix has no child prefixes and does have IPs, and is not a /32, use sum of IPs +2 over prefix size. 3. If the prefix has no child prefixes and does have IPs, and is a /32, use sum of IPs over prefix size. 4. If the prefix has no child prefixes and no IPs, return 0. --- <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:19:29 +01:00
adam closed this issue 2025-12-29 22:19:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12074