Verified Commit 58cc9081 authored by Adrian Schollmeyer's avatar Adrian Schollmeyer
Browse files

generator/hosts: Add support for bridge interfaces and parent overrides

parent a7f8c252
......@@ -146,6 +146,10 @@ class Icinga2Host:
self.remote_check_method = method
def set_parent(self, parent):
self.parent = parent
def create_icinga2_config(self):
global j2_env
template = j2_env.get_template("generic-host.j2")
......@@ -340,6 +344,14 @@ class NetBoxParser:
parent = "bigsister"
if self.uplink_interface.connected_endpoint:
parent =
elif self.uplink_interface.type.value == "bridge":
bridge_members = self.netbox.dcim.interfaces.filter(
bridge_id =
for bridge_member in bridge_members:
if bridge_member.connected_endpoint:
parent =
elif self.vm:
parent =
......@@ -549,6 +561,12 @@ class NetBoxParser:
except KeyError:
if monitoring_config_context["parent"]:["parent"])
except KeyError:
except KeyError as e:
pass # So there is no extra monitoring config. Who cares anyway?
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment