Skip to content

Instantly share code, notes, and snippets.

@ampledata
Created March 23, 2011 23:37
Show Gist options
  • Save ampledata/884268 to your computer and use it in GitHub Desktop.
Save ampledata/884268 to your computer and use it in GitHub Desktop.
Cloudkick 'check' status update script in a few lines of ruby.
require 'rubygems'
require 'oauth'
require 'openssl'
# your OAuth consumer credentials.
# https://support.cloudkick.com/API/Authentication#Generating_OAuth_Consumers
CONSUMER_KEY = 'xxx'
CONSUMER_SECRET = 'yyy'
node_id='n359b40753' # your node_id
status='err' # or 'ok'
details="Donny, you're out of your element!" # or 'she probably kidnapped herself'
id='qc4a7b82cd' # your check_id
OAuth::AccessToken.new( OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, :site => 'https://api.cloudkick.com', :http_method => :get) ).post("/2.0/check/#{id}/update_status", { :status => status, :node_id => node_id, :details => details } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment