Sign inSign up

lmerza/rsync-exporter

By lmerza

•Updated about 2 months ago

rsync metrics exporter for **Prometheus.io**

Image
0

1.8K

lmerza/rsync-exporter repository overview

⁠Overview

⁠Description

rsync metrics exporter for Prometheus.io

https://github.com/ljmerza/rsync-exporter⁠

⁠Setup

You will need to run rsync with the --stats option since this exporter is parsing these two lines:

2023/12/22 01:18:25 [2224747] sent 39,889,034,403 bytes  received 5,146,208 bytes  70,546,738.48 bytes/sec
2023/12/22 01:18:25 [2224747] total size is 199,212,300,476  speedup is 4.99

You will also need to log to a file since the exporter is reading the file. So the command at a minimum would look like this:

rsync --stats --quiet -avh /source /destination > /logs/rsync.log
rsync_exporter:
    build:
      context: ./projects/rsync-prometheus-exporter
      dockerfile: Dockerfile
    container_name: rsync_exporter
    restart: unless-stopped
    ports:
      - 9150:9150
    volumes:
      - ./volumes/rsync_exporter/rsync.log:/logs/rsync.log:ro

Since you are logging to a file, you can use logrotate to manage the file size.

/logs/rsync.log {
    rotate 5
    daily
    compress
    missingok
    notifempty
    copytruncate
}
⁠Metrics
MetricDescription
rsync_bytes_sent_totalTotal bytes sent
rsync_bytes_received_totalTotal bytes received
rsync_total_sizeTotal size of files to be transferred
rsync_last_syncLast sync time

Tag summary

Content type

Image

Digest

sha256:15db2b930…

Size

4.1 MB

Last updated

about 2 months ago

docker pull lmerza/rsync-exporter