simple carbon-cache data check

Here's a simple script I use to check if updates are coming into carbon (graphite storage backend) as expected:

#!/bin/bash
#

PATHS='servers carbon statsd'
CARBONPATH='/var/lib/carbon/whisper'

for i in $(ls $CARBONPATH/servers)
do
        COLD=`find $CARBONPATH/servers/$i -mmin +5 | wc -l`
        CTOT=`find $CARBONPATH/servers/$i | wc -l`
        PERC=`echo "scale=2; $COLD / $CTOT * 100 " | bc | cut -d "." -f 1`
        echo "Host: $i - count: $COLD/$CTOT ($PERC%)"
done

OLD=`find $CARBONPATH/servers -mmin +5 | wc -l`
TOTAL=`find $CARBONPATH/servers | wc -l`
echo Old/Total: $OLD/$TOTAL

1 comments on simple carbon-cache data check

  1. Anonymous
    Fri, 01/17/2014 - 00:34
    you didn't use PATHS in the script, what's it's purpose?