Bor g + Go + Z abbix
This is the service written on Go for Borg Backup repo monitoring.
Download the binary from releases.
Export variables and start the service:
$ declare -x BORGOZ_DEFAULT_REPO_KEY="XuolaiziVeiRa8DuPhoopeish5XexingaiveiTaaWaeg8elai1"
$ declare -x BORGOZ_LOG_LEVEL="DEBUG"
$ declare -x BORGOZ_REPOS_DIR="/home/borguser/repos"
$ declare -x BORGOZ_HOST="0.0.0.0"
$ declare -x BORGOZ_PORT="8080"
$ declare -x BORGOZ_BORG_BIN="borg-linux64"
$ borgoz-linux64
$ git clone https://github.com/vkhodor/borgoz
$ cd ./borgoz
$ make build
- BORGOZ_HOST
- BORGOZ_PORT
- BORGOZ_REPOS_DIR - directory where is all Borg Backup repos
- BORGOZ_DEFAULT_REPO_KEY - default repo key (it uses when :key is not set)
- BORGOZ_LOG_LEVEL - set LogLevel
- "DEBUG"
- "INFO" (DEFAULT)
- "WARN"
- "ERROR"
/check/lastBackupTime/:repo/:time/:key - with specific repo key /check/lastBackupTime/:repo/:time - with default repo key
- :repo - borg repo name
- :time - count of seconds
- :key - borg repo key (uses BORGOZ_DEFAULT_REPO_KEY if not set)
Example:
$ curl http://your.host.local:8080/check/lastBackupTime/some.host.borg.repo-dir/86400 # check last backup not older then 24h (in sec.)
The same with specific repokey.
$ curl http://your.host.local:8080/check/lastBackupTime/some.host.borg.repo-dir/86400/XuolaiziVeiRa8DuPhoopeish5XexingaiveiTaaWaeg8elai1
Check returns 200 if OK or 40x if not OK.