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'
sparkcheck=`redis-cli -h REDIS_HOST llen REDIS_QUEUE`.to_i
sparkcheck2=`redis-cli -h REDIS_HOST llen REDIS_QUEUE2`.to_i
pagerduty = Pagerduty.new("API_KEY")
queue = case sparkcheck
when 0..20 then "Pass"
else incident = pagerduty.trigger("Queue size is #{sparkcheck}")
end
queue2 = case sparkcheck2
when 0..20 then "Pass"
else incident = pagerduty.trigger("Queue size is #{sparkcheck2}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment