Created
February 5, 2014 22:33
-
-
Save thehar/8834683 to your computer and use it in GitHub Desktop.
graphite migrate
This file contains hidden or 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 | |
| metric=$1 | |
| metric_file=`echo $1|sed 's/\./\//g'`.wsp | |
| server=servername | |
| port=2003 | |
| # git clone https://github.com/graphite-project/whisper.git | |
| # to the following directory for whisper tools | |
| bindir=/usr/local/bin | |
| storage=/opt/graphite/storage | |
| $bindir/whisper-fetch.py $storage/whisper/$metric_file|while read LINE; do | |
| value=`echo $LINE|awk '{printf("%s",$2)}{printf("%s"," ")}{printf("%s",$1)}{printf("%s","\n")}'` | |
| echo "$metric $value"|nc $server $port | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment