gem install thor
mkdir -p ~/vagrants && cd ~/vagrants
curl -LO https://raw.github.com/gist/1528832/vagrantify
chmod 755 vagrantify
./vagrantify init webserver
require 'mixlib/cli' | |
EXIT_CODES = { | |
'OK' => 0, | |
'WARNING' => 1, | |
'CRITICAL' => 2, | |
'UNKNOWN' => 3, | |
} | |
class Sensu |
require 'open-uri' | |
# simple wrapper around open-uri's open() that will | |
# fetch an HTTP or HTTPS resource including follow redirects. | |
# Returns a hash with 2 members: | |
# | |
# response[:meta] = the original open-uri response object. Use this to | |
# access metadata such as status code. See | |
# http://ruby-doc.org/stdlib-1.9.2/libdoc/open-uri/rdoc/OpenURI/Meta.html | |
# for a list of attributes and methods available. |
module Noah | |
def noah_get_host(hostname) | |
require "net/http" | |
require "json" | |
noah_server="http://10.251.12.10:9292" | |
url = URI.parse("#{noah_server}/hosts/#{hostname}") | |
req = Net::HTTP::Get.new(url.path) | |
resp = Net::HTTP.new(url.host, url.port).start do |http| |
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI) | |
# This should be performed as root since it's going to be installing a bunch of stuff | |
# --- Update things to make sure we have the latest patches --- | |
# Add EPEL so we can get reasonably recent packages | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
# --- Install all the packages --- # | |
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached |
require 'rubygems' | |
require 'chef' | |
require 'fog' | |
require 'google_spreadsheet' | |
Chef::Config.from_file("~/.chef/knife.rb") | |
ec2 = Fog::AWS::EC2.new(:aws_access_key_id => ENV["AWS_KEY"], | |
:aws_secret_access_key => ENV["AWS_SECRET"] ) |
require 'rubygems' | |
require 'sinatra' | |
require 'redis' | |
# To use, simply start your Redis server and boot this | |
# example app with: | |
# ruby example_note_keeping_app.rb | |
# | |
# Point your browser to http://localhost:4567 and enjoy! | |
# |