Skip to content

Instantly share code, notes, and snippets.

@slb350
Last active August 29, 2015 14:27
Show Gist options
  • Save slb350/db97c193dd4b98d15fa2 to your computer and use it in GitHub Desktop.
Save slb350/db97c193dd4b98d15fa2 to your computer and use it in GitHub Desktop.
require 'pagerduty'
check1=`redis-cli -h REDIS_HOST llen REDIS_QUEUE1`.to_i
check2=`redis-cli -h REDIS_HOST llen REDIS_QUEUE2`.to_i
pagerduty = Pagerduty.new("PD_API_KEY")
queue = case check1
when 0..20 then "Pass"
else incident = pagerduty.trigger("Queue size is #{check1}")
end
processing = case check2
when 0..20 then "Pass"
else incident = pagerduty.trigger("Queue size is #{check2}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment