Skip to content

Instantly share code, notes, and snippets.

@curtismitchell
Last active August 29, 2015 14:13
Show Gist options
  • Save curtismitchell/37cf2e190e68ae828aa6 to your computer and use it in GitHub Desktop.
Save curtismitchell/37cf2e190e68ae828aa6 to your computer and use it in GitHub Desktop.
StatsD and Graphite with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$scriptInflux = <<SCRIPT
#!/bin/bash
sudo apt-get update
sudo apt-get -y upgrade
wget http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb
sudo dpkg -i influxdb_latest_amd64.deb
sudo /etc/init.d/influxdb start
sudo apt-get -y install git nodejs python python-setuptools
cd /opt
sudo git clone https://github.com/etsy/statsd.git
cd statsd
sudo apt-get -y install npm
sudo npm install statsd-influxdb-backend -d
sudo apt-get -y install apache2
wget http://grafanarel.s3.amazonaws.com/grafana-1.5.4.tar.gz
tar xvf grafana-1.5.4.tar.gz
sudo mv grafana-1.5.4/ /var/www/html/grafana
cd /var/www/grafana-1.5.4
cp config.sample.js config.js
cd ~
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
sudo pip install statsd
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
config.vbguest.auto_update = false
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu/trusty64"
config.vm.provision "shell", inline: $scriptInflux
config.vm.network :forwarded_port, guest: 8125, host: 8125
config.vm.network :forwarded_port, guest: 8083, host: 8083
config.vm.network :forwarded_port, guest: 8086, host: 8086
config.vm.network :forwarded_port, guest: 8090, host: 8090
config.vm.network :forwarded_port, guest: 8099, host: 8099
config.vm.network :forwarded_port, guest: 80, host: 8080
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment