From 9f710b8a0f8588697e068c86036d919dfec78e55 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Tue, 12 Jul 2022 21:25:34 +0200 Subject: [PATCH] add a monitoring call possibility --- README.md | 1 + templates/restic_script_Linux.j2 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 39d8fbd..f608efb 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ Available variables: | `log_to_journald` | no | Optionally switch logging to journald with the name of the backup job as the tag | | `mail_on_error` | no | Optionally send a mail if the backupjob will fail *(mailx is required)* | | `mail_address` | if `mail_on_error` is true | The mail addressto recive mails if you enabled ``mail_on_error``. | +| `monitoring_call` | no | A command that will be called if the backup is *successful*. Useful for heartbeat monitoring systems that warn when no heartbeat is received. Use the full command, you need to run. Example: `curl https://monitoring.example.com/api/push/E9Wzm4lJ2O?status=up&msg=OK&ping=` | Example: ```yaml diff --git a/templates/restic_script_Linux.j2 b/templates/restic_script_Linux.j2 index b6a8d6b..e699a8b 100644 --- a/templates/restic_script_Linux.j2 +++ b/templates/restic_script_Linux.j2 @@ -178,6 +178,9 @@ fi if [[ $? -eq 0 ]] then echo "$(date -u '+%Y-%m-%d %H:%M:%S') OK" {{ forget_result_log }} + {% if item.monitoring_call is defined %} + {{ item.monitoring_call }} + {% endif %} else echo "$(date -u '+%Y-%m-%d %H:%M:%S') ERROR" {{ forget_result_log }} {% if item.mail_on_error is defined and item.mail_on_error == true %}