Skip to content

Instantly share code, notes, and snippets.

@joemiller
Created December 17, 2011 21:24
Show Gist options
  • Save joemiller/1491446 to your computer and use it in GitHub Desktop.
Save joemiller/1491446 to your computer and use it in GitHub Desktop.
files for graphite handler testing in sensu
{
"checks": {
"graphite_test1": {
"type": "metric",
"command": "/etc/sensu/plugins/graphite_test1.rb",
"subscribers": [ "role_sensu_server" ],
"interval": 10,
"handlers": ["graphite"]
}
}
}
"handlers": {
"default": "/etc/sensu/handlers/default",
"pagerduty": "/etc/sensu/handlers/pagerduty",
"irc": "/etc/sensu/handlers/irc",
"twitter": "/etc/sensu/handlers/twitter",
"graphite": {
"type": "amqp",
"exchange": "graphite",
"send_only_check_output": true
}
},
#!/usr/bin/env ruby
metrics=[]
#%w[test.sensu.key1 test.sensu.key2].each do |path|
%w[test.sensu.key1].each do |path|
timestamp = Time.now.to_i
val = rand(100)
metrics << "#{path} #{val} #{timestamp}"
end
puts metrics.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment