Created
January 20, 2010 21:32
-
-
Save bitbckt/282296 to your computer and use it in GitHub Desktop.
munin plugin for 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' | |
HOST = ENV['host'] ? ENV['host'] : '127.0.0.1' | |
PORT = ENV['port'] ? ENV['port'] : '6379' | |
Resque.redis = "#{HOST}:#{PORT}" | |
queues = {} | |
Resque.queues.each do |queue| | |
queues[queue] = Resque.size(queue) | |
end | |
if ARGV.any? && ARGV[0] == 'config' | |
puts 'graph_title Queues' | |
puts 'graph_vlabel Enqueued Jobs' | |
puts 'graph_category resque' | |
queues.keys.each do |queue| | |
puts "#{queue}.label #{queue}" | |
end | |
exit 0 | |
end | |
queues.each do |queue, depth| | |
puts "#{queue}.value #{depth}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment