Skip to content

Commit

Permalink
Added support for shared networks
Browse files Browse the repository at this point in the history
  • Loading branch information
cholyoak committed Mar 8, 2024
1 parent 961207f commit eb79cae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kea_exporter/kea_http_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def load_subnets(self):
for module in config:
for subnet in module.get("arguments", {}).get("Dhcp4", {}).get("subnet4", {}):
self.subnets.update({subnet["id"]: subnet})
self.subnets += [
subnet
for shared_network in self.config["Dhcp4"].get("shared-networks", [])
for subnet in shared_network["subnet4"]
]
for subnet in module.get("arguments", {}).get("Dhcp6", {}).get("subnet6", {}):
self.subnets6.update({subnet["id"]: subnet})

Expand Down
5 changes: 5 additions & 0 deletions kea_exporter/kea_socket_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def reload(self):
if "Dhcp4" in self.config:
self.dhcp_version = BaseExporter.DHCPVersion.DHCP4
subnets = self.config["Dhcp4"]["subnet4"]
subnets += [
subnet
for shared_network in self.config["Dhcp4"].get("shared-networks", [])
for subnet in shared_network["subnet4"]
]
elif "Dhcp6" in self.config:
self.dhcp_version = BaseExporter.DHCPVersion.DHCP6
subnets = self.config["Dhcp6"]["subnet6"]
Expand Down

0 comments on commit eb79cae

Please sign in to comment.