service/backup: add alerts when systemd fails

This commit is contained in:
Felix Buehler 2023-06-19 22:20:36 +02:00
parent 3bf85421fb
commit 32c4c30bdd

View file

@ -161,5 +161,16 @@ in
yearly = 2; yearly = 2;
}; };
}; };
my.services.prometheus.rules = {
borgbackup_execution_missing = {
condition = ''time() - systemd_timer_last_trigger_seconds{name="borgbackup-job-hetzner.timer"} >= (60 * 60 * (24 + 1))'';
description = "{{$labels.instance}}: last backup was 25 hours ago please check.";
};
borgbackup_last_execution = {
condition = ''systemd_unit_state{state="failed", name="borgbackup-job-hetzner.timer"} >= 1'';
description = "{{$labels.instance}}: last backup was not successfull please check.";
};
};
}; };
} }