Skip to content

rsync wrapper (or output parser) that pushes metrics to prometheus

License

Notifications You must be signed in to change notification settings

jonasekl/rsyncprom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rsync-prom

Go Reference

An rsync wrapper (or output parser) that pushes metrics to prometheus.

This allows you to then build dashboards and alerting for your rsync batch jobs.

Installation

go install github.com/stapelberg/rsyncprom/cmd/rsync-prom@latest

Build

GOOS=linux GOARCH=amd64 go build -o rsync-prom-linux-amd64
GOOS=linux GOARCH=arm64 go build -o rsync-prom-linux-arm64

Setup example: crontab

9 9 * * * /home/michael/go/bin/rsync-prom --instance="sync-drive" -- /home/michael/sync-drive.sh

Setup example: systemd

[Service]
ExecStart=/home/michael/go/bin/rsync-prom --instance="sync-wiki" -- /usr/bin/rsync --exclude data/cache -av --checksum server:wiki/ /var/cache/wiki

Code example: SSH wrapper

Here’s an example for code which uses the x/crypto/ssh package to trigger rsync on a remote machine and parses the output:

https://github.com/stapelberg/zkj-nas-tools/blob/02d46d718df60c413844d9218f6dd702ad94e5f1/dornroeschen/sshutil.go#L134-L139

About

rsync wrapper (or output parser) that pushes metrics to prometheus

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.7%
  • Makefile 2.3%