Devices whose role is one of disk_device_roles (default Server, NAS, SAN, MSA) get a "Datenträger" tab with slot layout, disks, RAID groups, warranty and age warnings, replacement history, CSV import, REST API and GraphQL. - First-visit wizard for slot count, rows, first slot number, numbering and form factor; layouts can be saved as device type templates and applied with one click. - Slot grid drawn like the device front, coloured by status, with warning icons; free slots open a pre-filled disk form. - Bulk fill of selected slots with shared attributes and one serial per line (barcode scanner friendly), with live count and duplicate checks. - Sizes in vendor notation (960 GB, 4 TB, 1,92 TB, 2 TiB); the tenant is always taken from the device and follows tenant changes. - RAID groups (RAID 0/1/5/6/10/50/60, RAID-Z1/Z2/Z3, JBOD) with hot spares, usable capacity, tolerated failures and degraded state. - "Ersetzen" marks a disk as removed and opens the successor form; removed disks stay as per-slot history. - Warnings for failed disks, expired or expiring warranties and disks older than disk_age_warning_years. - Global disk list with filters, export, global search by serial, optional device list column, CSV import, REST API and GraphQL. - New settings: disks_enabled, disk_device_roles, disk_age_warning_years, disk_warranty_warning_days. Co-Authored-By: Claude Opus 5.5 <[email protected]>
72 lines
2.7 KiB
Python
72 lines
2.7 KiB
Python
from netbox.plugins import PluginConfig, get_plugin_config
|
|
|
|
__version__ = "0.15.0"
|
|
|
|
|
|
class NetBoxUtilitiesConfig(PluginConfig):
|
|
name = "netbox_utilities"
|
|
verbose_name = "NetBox Utilities"
|
|
description = "Navigation, tenant utilities, connection VLANs, partial-width racks, disks and bulk operations"
|
|
version = __version__
|
|
author = "LKE"
|
|
base_url = "utilities"
|
|
min_version = "4.6.5"
|
|
max_version = "4.7.99"
|
|
default_settings = {
|
|
"navigation_customization_enabled": True,
|
|
"connection_vlans_enabled": True,
|
|
"connection_tenant_filter_enabled": True,
|
|
"reorder_rack_bulk_save_enabled": True,
|
|
"topology_views_rack_width_enabled": True,
|
|
"tenant_filter_enabled": True,
|
|
"tenant_required": True,
|
|
"offline_svg_export_enabled": True,
|
|
"site_prefix_column_enabled": True,
|
|
"disks_enabled": True,
|
|
"disk_device_roles": ["Server", "NAS", "SAN", "MSA"],
|
|
"disk_age_warning_years": 5,
|
|
"disk_warranty_warning_days": 90,
|
|
}
|
|
middleware = [
|
|
"netbox_utilities.middleware.GlobalTenantFilterMiddleware",
|
|
]
|
|
|
|
def ready(self):
|
|
super().ready()
|
|
from .patchpanel import install_patchpanel_automation
|
|
from .rack_width import install_rack_width_support
|
|
from .tenant_scope import install_search_filter
|
|
from .tenant_validation import install_tenant_validation
|
|
|
|
install_search_filter()
|
|
install_tenant_validation()
|
|
install_patchpanel_automation()
|
|
install_rack_width_support()
|
|
if get_plugin_config("netbox_utilities", "disks_enabled"):
|
|
from .disk_integration import install_disk_support
|
|
|
|
install_disk_support()
|
|
if get_plugin_config("netbox_utilities", "site_prefix_column_enabled"):
|
|
from .site_prefix import install_site_prefix_column
|
|
|
|
install_site_prefix_column()
|
|
if get_plugin_config("netbox_utilities", "connection_vlans_enabled"):
|
|
from .connection_vlans import install_connection_vlan_support
|
|
|
|
install_connection_vlan_support()
|
|
if get_plugin_config("netbox_utilities", "connection_tenant_filter_enabled"):
|
|
from .connection_scope import install_connection_scope_filter
|
|
|
|
install_connection_scope_filter()
|
|
if self.apps.is_installed("netbox_export"):
|
|
from .netbox_export import install_netbox_export_rack_width_support
|
|
|
|
install_netbox_export_rack_width_support()
|
|
if get_plugin_config("netbox_utilities", "reorder_rack_bulk_save_enabled"):
|
|
from .reorder_rack import install_reorder_rack_bulk_save
|
|
|
|
install_reorder_rack_bulk_save()
|
|
|
|
|
|
config = NetBoxUtilitiesConfig
|