danihodovic / borg-exporter

Prometheus exporter for Borg backups.
MIT License
18 stars 6 forks source link

Question of where I need to install borgmatic and how use it #55

Closed PhilippeAccorsi closed 8 months ago

PhilippeAccorsi commented 1 year ago

Hi, I have installed borg and borgmatic on one server and data are backuped via ssh on another server. I want to monitor if backup is done correctly.

On which server I need to collect metric ? On destination server or source server ?

What is the good way to use this exporter ? Is it a pull exporter with scraping from prometheus or is it a push exporter to prometheus server ?

Regards, Philippe

danihodovic commented 1 year ago

On which server I need to collect metric ? On destination server or source server ?

I don't think it matters as long as you have a borgmatic (&borg) binary and can access your configuration file. Presumably this is on the source server where you are also running the backups. The exporter is just a wrapper around the borgmatic --info command.

https://github.com/danihodovic/borg-exporter/blob/9dc661bb0da675c09d74d577d50574e486b4506f/src/metrics.py#L33

The exporter runs as a daemon and HTTP server. If you request from http://localhost:9996/metrics it should return Prometheus compatible metrics. https://github.com/danihodovic/borg-exporter/blob/master/src/http_server.py

PhilippeAccorsi commented 9 months ago

thanks.

PhilippeAccorsi commented 8 months ago

Its work.