bundles/backup-client: add check for last backup of specific client
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2022-01-05 22:44:55 +01:00
parent fa2f12375c
commit 35104cb8ce
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 76 additions and 1 deletions

View file

@ -104,7 +104,6 @@ def zfs_pool(metadata):
}
@metadata_reactor.provides(
'zfs/datasets',
'zfs/snapshots/snapshot_never',
@ -131,3 +130,23 @@ def zfs_datasets_and_snapshots(metadata):
},
},
}
@metadata_reactor.provides(
'icinga2_api/backup-server/services',
)
def monitoring(metadata):
services = {}
for client in metadata.get('backup-server/clients', {}).keys():
services[f'BACKUPS FOR NODE {client}'] = {
'command_on_monitored_host': f'sudo /usr/local/share/icinga/plugins/check_backup_for_node {client}',
}
return {
'icinga2_api': {
'backup-server': {
'services': services,
},
},
}