Backup monitoring - coopdevs/handbook GitHub Wiki
Aquest handbook està descontinuat. La nova adreça és: https://handbook.coopdevs.org/ca/home |
1.- Install the monitoring_role
from ansible
2.- Enable promtail
and its module backups
in host_vars
config file.
monitoring_enabled: true
monitoring_promtail_enabled: true
monitoring_promtail_modules_enabled:
- backups
3.- Add (and encrypt) the Loki's credentials:
monitoring_loki_user: <int>
monitoring_loki_hostname: somewhere.lokihost.net
monitoring_loki_key: asgkD7agAKJAyAHAKJlaj9AJkjgOadA0DAD2AAsadajsfh3
4.- Run the playbook provision.yml
.
The following query is valid for both dashboard and Grafana alerts.
count_over_time({job="backup"} |="Backup complete" [1d])<1
Query:
count_over_time({job="backup"} |="Backup complete" [1d])<1
A - Query
Key | Value |
---|---|
Rule Type | Grafana managed alert |
Datasource | Loki |
Timerange | now-1d to now |
Query | count_over_time({job="backup"} |="Backup complete" [1d]) |
Query Type | Range |
B - Expression
Key | Value |
---|---|
Operation | Classic condition |
Conditions | WHEN count() OF A IS BELOW 1 |
Query:
({filename="/var/log/cron.d/restic-stdout.log",job="backup"})