Created
February 2, 2012 19:32
-
-
Save vadv/1725277 to your computer and use it in GitHub Desktop.
munin resque
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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