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
This commit is contained in:
bboerni2 2025-09-23 16:34:37 +02:00
parent 981de305ae
commit cbf5e38b35
2 changed files with 49 additions and 6 deletions

View file

@ -48,7 +48,52 @@
# now = datetime.now().strftime("%d/%m/%Y %H:%M:%S") # now = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
# BANNER_TOP = f'<marquee width="200px">This instance started on {now}.</marquee>' # BANNER_TOP = f'<marquee width="200px">This instance started on {now}.</marquee>'
try: # Zusätzliche Status-Felder für IP-Adressen
from .extra_local import * FIELD_CHOICES = {
except ImportError: 'ipam.IPAddress.status': (
pass ('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, # 110, bestimmt Pixelgröße
'qr_code_border': 4,
'qr_code_error_correction': 'M', # L, M, Q, H
},
})

View file

@ -8,8 +8,6 @@ services:
options: options:
max-size: "10m" max-size: "10m"
max-file: "3" max-file: "3"
volumes:
- ./configuration/extra_local.py:/etc/netbox/config/extra_local.py:ro
netbox-worker: netbox-worker:
restart: unless-stopped restart: unless-stopped