Small tool to check delta from last repo sync.
It reads lastsync
file, which should contain last repository sync timestamp in unix format.
sync-monitor --file /path/to/repo/lastsync
sync-monitor --file /path/to/repo/lastsync --port 1221 --interval 2m
Lastsync file. Should exist.
Port to expose metrics at. Leave empty or 0 for disable metrics.
Interval between checks.
[Unit]
Description=Sync Monitor and Metrics
Wants=network-online.target
After=network-online.target nss-lookup.target
[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/usr/local/bin/sync-monitor --file /path/to/repo/lastsync --port 1221 --interval 2m
[Install]
WantedBy=multi-user.target
make binary
CGO_ENABLED=0 go build github.com/kyberorg/sync-monitor/cmd/sync-monitor
Application can monitor Manjaro's state
files.
It reads timestamp from repo's state
file and calculates delta (seconds between now and timestamp).
/usr/local/bin/sync-monitor
--manjaro.repo.path=/path/to/repo
--manjaro.repo.list=testing,stable,unstable
(other params are omiited)