Skip to content

Instantly share code, notes, and snippets.

@Drewzar
Created September 8, 2011 18:44
Show Gist options
  • Save Drewzar/1204259 to your computer and use it in GitHub Desktop.
Save Drewzar/1204259 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
queue_length = `/opt/redis-2.2.2/bin/redis-cli zcard q:jobs:total_report:inactive`
begin
if queue_length.to_i > 50000
puts "status ok there are #{queue_length.to_i} jobs"
elsif queue_length > 10000
puts "status warn there are #{queue_length.to_i} jobs"
else
puts "status err there are #{queue_length.to_i} jobs"
end
rescue
puts "status err queue length is nil"
end
puts "metric queue_length int #{queue_length.to_i}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment