Skip to content

Instantly share code, notes, and snippets.

@ctgswallow
Created January 31, 2013 15:47
Show Gist options
  • Save ctgswallow/4683837 to your computer and use it in GitHub Desktop.
Save ctgswallow/4683837 to your computer and use it in GitHub Desktop.
#!/bin/bash
while true ; do
for i in {1..4} ; do
now=$(date '+%s' | perl -pe 's/\012//')
c=$(echo stats | nc xtincache0$i.xt.local 11211 | grep curr_conn | cut -d ' ' -f 3 | perl -pe 's/\015//' )
echo "greg.cache.xtincache0${i}.curr_connections ${c} $now" | nc graphite-s1.xt.local 2013
done
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment