Mot-clé - duplicity

Fil des billets - Fil des commentaires

dimanche, novembre 28 2010

Monitoring remote rsync.net storage quota with munin

I'm using rsync.net's networked storage for my duplicity backups (operated with backupninja). rsync.net uses quotas to limit each user's storage space. As I'm using munin to monitor my local machines, including their disks capacity, I wanted to include a similar graphing for the rsync.net quota too.

Here's a very basic munin plugin to be installed as /etc/munin/plugins/rsyncnetquota to be able to graph the output of the quota command :

#!/bin/bash

user=12345
host=whatever.rsync.net

quota=`ssh $user@$host quota | grep -e '^ */' | sed 's/^ *//g'`
current=`echo $quota | cut -d ' ' -f 2 | sed 's/\*$//'`
quota=`echo $quota | cut -d ' ' -f 3`
warning=$((quota*80/100*1024))
critical=$((quota*95/100*1024))

case $1 in
   config)
	echo "graph_title Rsync.net quota for $user (quota : $quota)"
	cat <<"EOM"
graph_vlabel quota
quota.label quota
EOM
echo "quota.warning $warning"
echo "quota.critical $critical"
#graph_args --base 1000

        exit 0;;
esac

echo -n "quota.value "
let current=$current*1024
echo $current

In my case, I want to have a warning alert at 80% and a critical message at 95%. Note that you may prefer adding constants here instead of issueing 2 ssh connections, one for the execution with parameter 'config' and one for the real value collection.

The script should be run as a user (here, root) which is allowed to execute password-less ssh onto the remote rsync.net account (ssh public keys, etc.), so a corresponding configuration should be added to /etc/munin/plugin-conf.d/munin-node in the form of :

[rsyncnetquota]
user root

mercredi, mars 3 2010

Restoring duplicity backups with different debian distro : attention to incompatible versions

I've recently had to test my backupninja + duplicity backups (yes, I think I haven't blogged about backups since I described my previous setup which used amanda).

The zonbu PC that managed the backup disks target of duplicity, which was running Debian stable has died.

I tried and restore the contents of its system (to have a look on the config files I had setup there) on a Debian testing system, using the same duplicity commandline (more or less).

However, I couldn't do that, since apparently, duplicity in Debian stable (0.4.11) and testing (0.6.06) don't seem to be exactly compatible.

I managed to restore anyway by reinstalling duplicity 0.4.11 in a custom prefix setup, which worked fine. The command-line then goes something like this (excerpt from the tarball's README) :

python setup.py install --prefix=/usr/local
PYTHONPATH='/usr/local/lib/python2.x/site-packages/' /usr/local/bin/duplicity -V

I've traced this problem in Debian BTS (#572102), as I'm afraid of the consequences when people will try and restore on the next stable distro backups made with the previous stable...

You've been warned anyway ;)