2016-04-23 22:31:00 +02:00
|
|
|
# Borg exporter
|
|
|
|
|
|
|
|
Export borg information to prometheus.
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
2018-09-05 17:00:25 +02:00
|
|
|
* [Dateutils](http://www.fresse.org/dateutils/)
|
2016-04-23 22:31:00 +02:00
|
|
|
* Prometheus (obviously)
|
|
|
|
* Node Exporter with textfile collector
|
2018-09-05 17:00:25 +02:00
|
|
|
* [Borg](https://github.com/borgbackup/borg)
|
2016-04-23 22:31:00 +02:00
|
|
|
|
|
|
|
## Install
|
|
|
|
|
2018-09-06 10:31:45 +02:00
|
|
|
You must install this node exporter in each host that you want to monitor.
|
|
|
|
|
2018-09-05 17:00:25 +02:00
|
|
|
### With the Makfile
|
|
|
|
|
|
|
|
For convenience, you can install this exporter with the command line
|
|
|
|
`make install` or follow the process described in the next paragraph.
|
|
|
|
|
|
|
|
### Manually
|
|
|
|
Copy `borg_exporter.sh` to `/usr/local/bin`.
|
2016-04-23 22:31:00 +02:00
|
|
|
|
|
|
|
Copy `borg.env` to `/etc/borg` and replace your repokey and repository in it.
|
|
|
|
|
|
|
|
Copy the systemd unit to `/etc/systemd/system` and run
|
|
|
|
|
|
|
|
```
|
|
|
|
systemctl enable prometheus-borg-exporter.timer
|
|
|
|
systemctl start prometheus-borg-exporter.timer
|
|
|
|
```
|
|
|
|
|
|
|
|
Alternative: Use `ExecStartPost` in your borg backupt timer itself to write our the metrics.
|
|
|
|
|
|
|
|
## Configure your node exporter
|
|
|
|
|
2018-09-06 10:31:45 +02:00
|
|
|
You must start the node exporter service with the following parameter: `--collector.textfile.directory=/var/lib/node_exporter/textfile_collector`
|
2016-04-23 22:31:00 +02:00
|
|
|
|
2018-09-05 17:00:25 +02:00
|
|
|
## Exported metrics
|
2016-04-23 22:31:00 +02:00
|
|
|
|
|
|
|
```
|
2018-09-05 17:00:25 +02:00
|
|
|
borg_extract_exit_code
|
|
|
|
bork_hours_from_last_backup
|
|
|
|
bork_count
|
|
|
|
bork_files
|
|
|
|
bork_chunks_unique
|
|
|
|
bork_chunks_total
|
|
|
|
bork_last_size
|
|
|
|
bork_last_size_compressed
|
|
|
|
bork_last_size_dedup
|
|
|
|
bork_total_size
|
|
|
|
bork_total_size_compressed
|
|
|
|
bork_total_size_dedup
|
2016-04-23 22:31:00 +02:00
|
|
|
```
|
2017-02-23 10:56:43 +01:00
|
|
|
|
|
|
|
### Grafana dashboard
|
|
|
|
|
|
|
|
See [here](https://grafana.net/dashboards/1573) for a sample grafana dashboard.
|