# Duplicati Monitor

Link: [https://github.com/RafaMunoz/duplicati-monitor](https://github.com/RafaMunoz/duplicati-monitor) git clone [https://github.com/RafaMunoz/duplicati-monitor.git](https://github.com/RafaMunoz/duplicati-monitor.git)

# Duplicati Monitor

<div class="markdown-heading" dir="auto" id="bkmrk-">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/RafaMunoz/duplicati-monitor#duplicati-monitor)</div>Duplicati Monitor is a docker-packaged monitoring solution for Duplicati.

It allows you to control the status of your backups and statistics for each report and notifies you by any means supported by **Apprice**. It is meant to be self-hosted and powered by docker.

## Quick Start

<div class="markdown-heading" dir="auto" id="bkmrk--2">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/RafaMunoz/duplicati-monitor#quick-start)</div>### Notifications

<div class="markdown-heading" dir="auto" id="bkmrk--4">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/RafaMunoz/duplicati-monitor#notifications)</div>To send notifications and satisfy the end user, it has been implemented with the Apprise library, which allows you to send a notification to almost all the most popular notification services available today, such as: Telegram, Discord, Slack, Amazon SNS, Gotify, etc.

You can check all the services available in the [official documentation](https://github.com/caronc/apprise#productivity-based-notifications).

### Templates

<div class="markdown-heading" dir="auto" id="bkmrk--6">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/RafaMunoz/duplicati-monitor#templates)</div>You can create your own templates to receive the information you exactly need.

By default we use the following two:

```
# Succes backup
💾 🟢 <Extra.backup-name>

# Error backup 
💾 🔴 <Extra.backup-name>

```

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" id="bkmrk--8"><div class="zeroclipboard-container">  
</div></div>You can create your own templates in a simple way. You only have to use the symbols `<` and `>` delimit the fields and separating keys with dots `.` to send along with the message that you want.

In the [docs/examples\_report](https://github.com/RafaMunoz/duplicati-monitor/blob/main/docs/examples_report) folder of this repository you have two examples of the JSON reports that Duplicati sends and in which you can see the fields that compose it.

For example, with the following template, the result shown in the telegram image would be obtained.

```
💾 🟢 Backup: <Extra.backup-name>\n - Examined Files: <Data.ExaminedFiles>\n - Duration: <Data.Duration>\n - Status: *<Data.TestResults.ParsedResult>*

```

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" id="bkmrk--9"><div class="zeroclipboard-container">  
</div></div>[![telegram-example-notication](https://github.com/RafaMunoz/duplicati-monitor/raw/main/docs/img/telegram-example-notication.png)](https://github.com/RafaMunoz/duplicati-monitor/blob/main/docs/img/telegram-example-notication.png)

### Environment Variables

<div class="markdown-heading" dir="auto" id="bkmrk--11">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/RafaMunoz/duplicati-monitor#environment-variables)</div><table id="bkmrk-environment-variable-1" style="width: 100%;"><thead><tr><th style="width: 17.998%;">ENVIRONMENT VARIABLE</th><th style="width: 9.6518%;">TYPE</th><th style="width: 18.1199%;">DEFAULT</th><th style="width: 54.2323%;">DESCRIPTION</th></tr></thead><tbody><tr><td style="width: 17.998%;">`URI_NOTIFICATION`</td><td style="width: 9.6518%;">required</td><td style="width: 18.1199%;"> </td><td style="width: 54.2323%;">URI in Apprise format where the notifications will be sent.</td></tr><tr><td style="width: 17.998%;">`TEMPLATE_SUCCESS`</td><td style="width: 9.6518%;">opcional</td><td style="width: 18.1199%;">💾 🟢 &lt;Extra.backup-name&gt;</td><td style="width: 54.2323%;">Message template to be sent when the backup is successful.</td></tr><tr><td style="width: 17.998%;">`TEMPLATE_ERROR`</td><td style="width: 9.6518%;">opcional</td><td style="width: 18.1199%;">💾 🔴 &lt;Extra.backup-name&gt;</td><td style="width: 54.2323%;">Message template that will be sent when the backup is executed in an erroneous way.</td></tr><tr><td style="width: 17.998%;">`PORT`</td><td style="width: 9.6518%;">opcional</td><td style="width: 18.1199%;">8000</td><td style="width: 54.2323%;">Listening port on which the service is set up to receive the reports.</td></tr></tbody></table>

### Docker Run

<div class="markdown-heading" dir="auto" id="bkmrk--13">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/RafaMunoz/duplicati-monitor#docker-run)</div>To start the container you can do it with the following command.

```
docker run -d --name=duplicati-monitor -p 8000:8000 -e URI_NOTIFICATION=tgram://<TOKEN_TELEGRAM_BOT>/<CHANEL_ID>/?format=markdown rafa93m/duplicati-monitor

```

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" id="bkmrk--15"><div class="zeroclipboard-container">  
</div></div>Or you can also use the following docker compose.

```
version: "3"
services:
    duplicati-monitor:
        container_name: duplicati-monitor
        image: rafa93m/duplicati-monitor
        ports:
            - 8000:8000
        environment:
            URI_NOTIFICATION: "tgram://<TOKEN_TELEGRAM_BOT>/<CHANEL_ID>/?format=markdown"
            TEMPLATE_SUCCESS: "💾 🟢 Backup: <Extra.backup-name>"
            TEMPLATE_ERROR: "💾 🔴 Backup <Extra.backup-name> failed 🔥 🔥"
        restart: unless-stopped
```

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" id="bkmrk--16"><div class="zeroclipboard-container">  
</div></div>### Setup Duplicati

<div class="markdown-heading" dir="auto" id="bkmrk--17">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/RafaMunoz/duplicati-monitor#setup-duplicati)</div>Add theses two options for each backup you want to monitor:

- **send-http-result-output-format**: json
- **send-http-url**: http://**IP\_ADDRESS**:**PORT**/report

[![advanced-options](https://github.com/RafaMunoz/duplicati-monitor/raw/main/docs/img/advanced-options.png)](https://github.com/RafaMunoz/duplicati-monitor/blob/main/docs/img/advanced-options.png)