Monitoring remote storage quota with munin

I'm using's networked storage for my duplicity backups (operated with backupninja). 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 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 :



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`

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

        exit 0;;

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 account (ssh public keys, etc.), so a corresponding configuration should be added to /etc/munin/plugin-conf.d/munin-node in the form of :

user root


1. Le jeudi, décembre 2 2010, 08:09 par Olivier Berger

I have slightly improved the script, to report correctly even when the quota is over and a star is added next to the current volutme

Ajouter un commentaire

Le code HTML est affiché comme du texte et les adresses web sont automatiquement transformées.

La discussion continue ailleurs

URL de rétrolien :

Fil des commentaires de ce billet