From d1b369fb26ced0b6c67a3ec18c3ab9361deea116 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Thu, 24 Oct 2024 19:25:00 +0200 Subject: [PATCH] bundles/smartd: do not try to guess disk names --- bundles/smartd/metadata.py | 24 ------------------------ nodes/carlene.toml | 4 ++-- nodes/home/nas.py | 8 ++++++++ 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/bundles/smartd/metadata.py b/bundles/smartd/metadata.py index 73789d0..5202068 100644 --- a/bundles/smartd/metadata.py +++ b/bundles/smartd/metadata.py @@ -43,30 +43,6 @@ if node.has_bundle('telegraf'): } -@metadata_reactor.provides( - 'smartd/disks', -) -def zfs_disks_to_metadata(metadata): - disks = set() - - for config in metadata.get('zfs/pools', {}).values(): - for option in config['when_creating']['config']: - if option.get('type', '') in {'log', 'cache'}: - continue - - for disk in option['devices']: - if search(r'p([0-9]+)$', disk) or disk.startswith('/dev/mapper/'): - continue - - disks.add(disk) - - return { - 'smartd': { - 'disks': disks, - }, - } - - @metadata_reactor.provides( 'icinga2_api/smartd/services', ) diff --git a/nodes/carlene.toml b/nodes/carlene.toml index 40a421b..42847d0 100644 --- a/nodes/carlene.toml +++ b/nodes/carlene.toml @@ -255,8 +255,8 @@ dkim = "uO4aNejDvVdw8BKne3KJIqAvCQMJ0416" [metadata.smartd] disks = [ - "/dev/nvme0", - "/dev/nvme1", + "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00B00_S677NF0W508470", + "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00B00_S677NX0W114380", ] [metadata.travelynx] diff --git a/nodes/home/nas.py b/nodes/home/nas.py index 1122e43..0415c87 100644 --- a/nodes/home/nas.py +++ b/nodes/home/nas.py @@ -190,6 +190,14 @@ nodes['home.nas'] = { 'disks': { '/dev/nvme0', + # old nas disks + '/dev/disk/by-id/ata-WDC_WD6003FFBX-68MU3N0_V8GE15GR', + '/dev/disk/by-id/ata-WDC_WD6003FFBX-68MU3N0_V8HJ406R', + '/dev/disk/by-id/ata-WDC_WD6003FFBX-68MU3N0_V8HJBTLR', + '/dev/disk/by-id/ata-WDC_WD6003FFBX-68MU3N0_V8HJGN6R', + '/dev/disk/by-id/ata-WDC_WD6003FFBX-68MU3N0_V8J8ZKRR', + '/dev/disk/by-id/ata-WDC_WD6003FFBX-68MU3N0_V9JS5UYL', + # encrypted disks '/dev/disk/by-id/ata-Samsung_SSD_870_QVO_8TB_S5SSNJ0X409404K', '/dev/disk/by-id/ata-Samsung_SSD_870_QVO_8TB_S5SSNJ0X409845F',