Skip to content

Instantly share code, notes, and snippets.

@vadv
Created February 2, 2012 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vadv/1725277 to your computer and use it in GitHub Desktop.
Save vadv/1725277 to your computer and use it in GitHub Desktop.
munin resque
#!/usr/bin/env ruby
require 'rubygems'
require 'resque'
require 'resque-cleaner'
HOST = ENV['host'] ? ENV['host'] : 'db1.kupikupon.ru'
PORT = ENV['port'] ? ENV['port'] : '6379'
Resque.redis = "#{HOST}:#{PORT}"
cleaner = Resque::Plugins::ResqueCleaner.new
if ARGV.any? && ARGV[0] == 'config'
puts 'graph_title Queues'
puts 'graph_vlabel Failed Jobs'
puts 'graph_category resque'
cleaner.stats_by_class.each do |queue, error|
puts "#{queue}.label #{queue}"
end
exit 0
end
cleaner.stats_by_class.each do |queue, error|
puts "#{queue}.value #{error}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment