Skip to content

Instantly share code, notes, and snippets.

@thehar
Created February 5, 2014 22:33
Show Gist options
  • Select an option

  • Save thehar/8834683 to your computer and use it in GitHub Desktop.

Select an option

Save thehar/8834683 to your computer and use it in GitHub Desktop.
graphite migrate
#!/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