bundles/smartd: do not try to guess disk names

This commit is contained in:
Franzi 2024-10-24 19:25:00 +02:00
parent 07a44598d2
commit d1b369fb26
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 10 additions and 26 deletions

View file

@ -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',
)