mirror of
https://github.com/roles-ansible/ansible_role_restic/
synced 2024-12-11 20:30:18 +01:00
Merge pull request #73 from rndmh3ro/monitoring
add a monitoring call possibility
This commit is contained in:
commit
efd21f0d0a
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue