bundles/smartd: do not try to guess disk names
This commit is contained in:
parent
07a44598d2
commit
d1b369fb26
3 changed files with 10 additions and 26 deletions
|
@ -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',
|
||||
)
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue