From cbf5e38b35cd5203b0f1ec0800a8a2ef13f5f19e Mon Sep 17 00:00:00 2001 From: bboerni2 <93215657+bboerni2@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:34:37 +0200 Subject: [PATCH] Add additional status fields for IP addresses and update plugin configurations in extra.py Remove volume mapping for extra_local.py in docker-compose.override.yml --- configuration/extra.py | 53 ++++++++++++++++++++++++++++++++++--- docker-compose.override.yml | 2 -- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/configuration/extra.py b/configuration/extra.py index a7de9c0..8c0e4cb 100644 --- a/configuration/extra.py +++ b/configuration/extra.py @@ -48,7 +48,52 @@ # now = datetime.now().strftime("%d/%m/%Y %H:%M:%S") # BANNER_TOP = f'This instance started on {now}.' -try: - from .extra_local import * -except ImportError: - pass +# Zusätzliche Status-Felder für IP-Adressen +FIELD_CHOICES = { + 'ipam.IPAddress.status': ( + ('free', 'Free', 'lime'), + ('deprecated', 'Deprecated', 'red'), + ('reserved', 'Reserved', 'yellow'), + ('dhcp', 'DHCP', 'blue'), + ('active', 'Active', 'cyan'), + ('gateway', 'Gateway', 'darkkhaki'), + ) +} + +from netbox.configuration.configuration import PLUGINS, PLUGINS_CONFIG + +PLUGINS += [ + 'netbox_topology_views', + 'netbox_device_lifecycle_mgmt', + 'netbox_prometheus_sd', + 'netbox_qrcode', +] + +PLUGINS_CONFIG.update({ + # NetBox Topology Views + 'netbox_topology_views': { + # Beispiel: Standard-Layout für Graphen + 'default_device_bay_parent': True, + 'exclude_virtual_interfaces': True, + }, + + # Device Lifecycle Management + 'netbox_device_lifecycle_mgmt': { + # Tage vor EoX-Benachrichtigung + 'expiry_notice_days': 180, + }, + + # Prometheus Service Discovery + 'netbox_prometheus_sd': { + # Export-Path (innerhalb des Containers erreichbar) + 'path': '/etc/netbox/prometheus-sd', + 'reload_command': None, # oder z. B. 'systemctl reload prometheus' + }, + + # QRCode + 'netbox_qrcode': { + 'qr_code_size': 8, # 1–10, bestimmt Pixelgröße + 'qr_code_border': 4, + 'qr_code_error_correction': 'M', # L, M, Q, H + }, +}) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 14fee3d..f0f6e8b 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -8,8 +8,6 @@ services: options: max-size: "10m" max-file: "3" - volumes: - - ./configuration/extra_local.py:/etc/netbox/config/extra_local.py:ro netbox-worker: restart: unless-stopped