Skip to content

Commit

Permalink
Merge pull request #73 from rndmh3ro/monitoring
Browse files Browse the repository at this point in the history
add a monitoring call possibility
  • Loading branch information
DO1JLR authored Jul 12, 2022
2 parents d89d649 + 9f710b8 commit efd21f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions templates/restic_script_Linux.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit efd21f0

Please sign in to comment.