Skip to content

Instantly share code, notes, and snippets.

@agent462
agent462 / ebs_raid.rb
Created November 11, 2011 16:41 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
@agent462
agent462 / gist:4462122
Created January 5, 2013 15:36
example for irc
node_list = { :nodeip1 => "server1", :nodeip2 => "server2", etc }
node_list.each do |k,v|
if k == node["ip_address"]
node.set["zabbix_windows"]["agent"]["servers"] = v
end
end
@agent462
agent462 / gist:4667299
Last active December 11, 2015 22:08
a very quick splunk starter example for sensu
require 'rubygems' if RUBY_VERSION < '1.9.0'
require "net/https"
require 'json'
require 'sensu-plugin/check/cli'
class checkSplunk < Sensu::Plugin::Check::CLI
def api_request(opts={})
o = {
:host => '',
class Chef::Provider::JsonFile < Chef::Provider::File
def load_json(path)
JSON.parse(::File.read(path)) rescue Hash.new
end
def dump_json(obj)
JSON.pretty_generate(obj) + "\n"
end
def to_mash(obj)
@agent462
agent462 / gist:5368716
Last active December 16, 2015 03:19
cli commands
#
# Welcome to the sensu-cli.
# ______
# .-' '-.
# .' __ '.
# / / \ \
# ------------------
# /\
# '--'
# SENSU