bebehei / nagios-plugin-check_borg Goto Github PK
View Code? Open in Web Editor NEWnagios plugin to monitor borg repositories
License: GNU General Public License v3.0
nagios plugin to monitor borg repositories
License: GNU General Public License v3.0
Hi there,
running check_borg
while a borg backup via borg create is running results into
Failed to create/acquire the lock $BORG_REPO/lock.exclusive (timeout).
which in turns lets NRPE fail with NRPE: Unable to read output
.
Any ideas how to solve this issue?
BR z3dm4n
Edit:
It's the borg list
that fails to acquire the lock. As it seems to me, this is a limitation within borg's locking implementation. So I guess, that we won't get around this easily within the limits of borg. I'll think about a workaround and will get back to you (via PR).
# ./check_borg -R /data/backups/borg/
Formatting Error: "{time}{NUL}".format({'utcnow': datetime.datetime(2018, 1, 2, 15, 45, 44, 95787), 'user': 'root', 'borgpatch': '1.0.9', 'now': datetime.datetime(2018, 1, 2, 16, 45, 44, 95767), 'hostname': 'prod-web2', 'fqdn': 'prod-web2', 'pid': 4005, 'borgversion': '1.0.9', 'borgmajor': '1', 'borgminor': '1.0'}): KeyError('time')
date: invalid date '@'
It seems that now borg uses --list-format LISTFORMAT not --format
Hi,
First of all, thanks for your work and for sharing this plugin.
I've made a couple of changes to make this script work under FreeBSD, but noticed that there's no licence along your code clarifying what I may do with your code and what not. :)
So I'd like to ask you kindly to add a licence to this repository.
Hi there!
Thanks for your contribution. Great script. Exactly what I was looking for, but I think borg's env variables like BORG_PASSPHRASE and BORG_REPO should be included in check_borg and not in any insecure nagios/icinga file, because this files are usually readable by the unprivileged nagios/icinga user and therefore a potential security issue.
My fix for this issue is to change permissions to 0700 on check_borg and execute check_borg via sudo by allowing the nagios user (in my case) to remotely execute this plugin via nrpe.
BORG_PASSPHRASE and BORG_REPO are exported in check_borg directly. Would be nice, if check_borg wouldn't insist on the -R switch, if BORG_REPO is set.
Hi there... again! ;-)
It seems that GNU date
gives a f*** about POSIX compatibility. I would like to run check_borg on my FreeBSD boxes as well, but *BSD date
doesn't like the --date
switch of GNU date
.
The date command confuses me at the moment. I need to look deeper inside your code to fix the issue. Maybe you can give me a little hint on how to fix this for *BSD.
Differences between both commands
Thanks a lot!
Using --last 1
will eventually show a checkpoint archive, which I not consider a successful archive (which you documented already in the README).
I use this to show the last successful backup timestamp in the repo:
borg list --sort timestamp --format '{time}{TAB}{name}{NEWLINE}' $REPOSITORY | grep -v '\.checkpoint$' | tail -1 | cut -f 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.