[slbackup-commit] CVS update: slbackup/src/munin-plugins slbackup
finnarne-guest at alioth.debian.org
finnarne-guest at alioth.debian.org
Sun Jan 29 11:43:56 UTC 2006
User: finnarne-guest
Date: 06/01/29 11:43:56
Added: src/munin-plugins slbackup
Log:
Added munin-plugin to monitor the backup
Revision Changes Path
1.1 slbackup/src/munin-plugins/slbackup
Index: slbackup
===================================================================
#/bin/sh
#
# Author: Finn-Arne Johansen
# Date: 2006-01-29
if [ "$1" = "config" ] ; then
echo "graph_title slbackup status"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel count"
echo "graph_scale no"
echo "graph_category disk"
echo "success.label success"
echo "failed.label failed"
echo "failed.critical 1"
echo "lastrun.label last run"
echo "lastrun.warning 25"
echo "lastrun.critical 30"
echo "graph_info Show the number of failed and successfull backup set from the last run"
exit 0
fi
LAST=$(grep -n "Starting slbackup:" /var/log/slbackup/slbackup.log | tail -1 | cut -f1 -d:)
if [ "$LAST" ] ; then
echo -n "failed.value "
tail +$LAST /var/log/slbackup/slbackup.log | grep "Failed backing up client" | wc -l
echo -n "success.value "
tail +$LAST /var/log/slbackup/slbackup.log | grep "Successfully finished backing up client" | wc -l
else
echo "failed.value 0"
echo "success.value 0"
fi
LASTRUN="$(sed -ne "s/- Finished slbackup.//p" /var/log/slbackup/slbackup.log | tail -1 )"
if [ -z "$LASTRUN" ] ; then
echo lastrun.value 0
else
echo -n "lastrun.value ";
cat << EOF | bc
scale=2
($(date +%s) - $(date -d "$LASTRUN" +%s)) / 3600
EOF
fi
More information about the slbackup-commit
mailing list