diff --git a/kea_exporter/kea_http_exporter.py b/kea_exporter/kea_http_exporter.py index 11eebb4..77ef1ad 100644 --- a/kea_exporter/kea_http_exporter.py +++ b/kea_exporter/kea_http_exporter.py @@ -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}) diff --git a/kea_exporter/kea_socket_exporter.py b/kea_exporter/kea_socket_exporter.py index ec89e62..86af0dc 100644 --- a/kea_exporter/kea_socket_exporter.py +++ b/kea_exporter/kea_socket_exporter.py @@ -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"]