Created
June 6, 2012 21:35
-
-
Save jbuchbinder/2884969 to your computer and use it in GitHub Desktop.
Poll rrdcache stats from control socket for Ganglia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# rrdcache-stats.sh | |
# @jbuchbinder | |
# | |
GMETRIC="/usr/bin/gmetric" | |
( echo "STATS"; sleep 1; echo "QUIT" ) | \ | |
sudo socat - unix:/var/rrdtool/rrdcached/rrdcached.sock | \ | |
grep ':' | \ | |
while read X; do | |
K="$( echo "$X" | cut -d: -f1 )" | |
V="$( echo "$X" | cut -d: -f2 )" | |
$GMETRIC -g rrdcached -t uint32 -n "rrdcached_stat_${K}" -v ${V} -x 300 -d 300 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment