Created
September 8, 2011 18:44
-
-
Save Drewzar/1204259 to your computer and use it in GitHub Desktop.
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 | |
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