Skip to content

Instantly share code, notes, and snippets.

View phrawzty's full-sized avatar
🕺
probably karaoke

Daniel Maher phrawzty

🕺
probably karaoke
View GitHub Profile
@phrawzty
phrawzty / foo.ddl
Created June 20, 2011 10:36
MC "timeout" not being respected ?
metadata :name => 'Foo',
:description => 'foo foo foo',
:author => '[email protected]',
:license => 'other',
:version => '0.1',
:url => 'none',
:timeout => 30
action 'go', :description => 'waits for X seconds' do
input :time,
@phrawzty
phrawzty / syslog
Created June 14, 2011 16:33
how to debug this mcollective error ?
2011-06-14T18:20:49.00000+02:00 [hostname.here] mcollectived[7774]: agents.rb:126:in `dispatch' Execution of test failed: Could not create instance of plugin test_agent: /usr/lib/ruby/1.8/mcollective/rpc/ddl.rb:46:in `initialize': (eval):57:in `initialize': compile error
2011-06-14T18:20:49.00000+02:00 [hostname.here] mcollectived[7774]: agents.rb:127:in `dispatch' /usr/lib/ruby/1.8/mcollective/pluginmanager.rb:69:in `[]'
2011-06-14T18:20:49.92722+02:00 [hostname.here] /usr/lib/ruby/1.8/mcollective/agents.rb: 103:in `timeout'
2011-06-14T18:20:49.92722+02:00 [hostname.here] /usr/lib/ruby/1.8/mcollective/agents.rb: 113:in `dispatch'
2011-06-14T18:20:49.92722+02:00 [hostname.here] /usr/lib/ruby/1.8/mcollective/agents.rb: 111:in `initialize'
2011-06-14T18:20:49.92722+02:00 [hostname.here] /usr/lib/ruby/1.8/mcollective/agents.rb: 111:in `new'
2011-06-14T18:20:49.92722+02:00 [hostname.here] /usr/lib/ruby/1.8/mcollective/agents.rb: 111:in `dispatch'
2011-06-14T18:20:49.92722+02:00 [hostname.here] /usr/li
@phrawzty
phrawzty / agentreload.rb
Created March 25, 2011 09:37
An MCollective agent to hot-reload MCollective agents (simple RPC-style)
module MCollective
module Agent
class agentreload<RPC::Agent
action 'reload' do
reload
end
private
def reload
@phrawzty
phrawzty / simple-nagios-json.rb
Created March 1, 2011 14:40
A simple Nagios plugin that makes an HTTP request and interprets a JSON response; implemented in Ruby - because why not? This is really more of a proof of concept than something super useful, so ymmv. ;)
#!/usr/bin/ruby1.9.1
# Nagios plugin that looks for some JSON or summat.
require 'json'
require 'net/http'
require 'uri'
require 'optparse'
@options = {}
@phrawzty
phrawzty / check_repli.rb
Created February 18, 2011 15:20
Same as pyr's, but with Nagios-correct exit codes.
#!/usr/bin/env ruby
require 'mysql'
require 'yaml'
require 'optparse'
def parse argv
env = {:path => 'check_repli.yml'}
env[:path] = ENV['CHECK_REPLI_CONFIG'] if ENV.include? 'CHECK_REPLI_CONFIG'