[slbackup-commit] CVS update: slbackup/contrib munin-plugin

werner at alioth.debian.org werner at alioth.debian.org
Sun Jan 29 11:56:53 UTC 2006


  User: werner  
  Date: 06/01/29 11:56:53

  Added:       contrib  munin-plugin
  Log:
  munin-plugin for slbackup - Thanks to Finn-Arne Johansen <faj at bzz.no>
  
  Revision  Changes    Path
  1.1                  slbackup/contrib/munin-plugin
  
  Index: munin-plugin
  ===================================================================
  #/bin/sh
  
  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