From 4390256abc488811e34854b0b8f1530e7e15b157 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Wed, 6 Apr 2022 18:13:01 +0200 Subject: [PATCH] bundles/zfs: add metadata option to disable ZFS OLD SNAPSHOTS check --- bundles/zfs/metadata.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bundles/zfs/metadata.py b/bundles/zfs/metadata.py index 001d7ab..6bd15a8 100644 --- a/bundles/zfs/metadata.py +++ b/bundles/zfs/metadata.py @@ -45,9 +45,6 @@ defaults = { 'command_on_monitored_host': 'sudo /usr/local/share/icinga/plugins/check_zfs_volumes', 'vars.notification.mail': True, }, - 'ZFS OLD SNAPSHOTS': { - 'command_on_monitored_host': 'sudo /usr/local/share/icinga/plugins/check_zfs_old_snapshots', - } }, }, }, @@ -158,6 +155,11 @@ def monitoring(metadata): services = {} + if metadata.get('zfs/enable_old_snapshots_check', True): + services['ZFS OLD SNAPSHOTS'] = { + 'command_on_monitored_host': 'sudo /usr/local/share/icinga/plugins/check_zfs_old_snapshots', + } + for poolname, _ in metadata.get('zfs/pools').items(): services['ZFS ZPOOL ONLINE {}'.format(poolname)] = { 'command_on_monitored_host': 'sudo /usr/local/share/icinga/plugins/check_zpool_online {}'.format(poolname),