Skip to content

Instantly share code, notes, and snippets.

@rafmagana
Created February 4, 2011 16:40
Show Gist options
  • Save rafmagana/811337 to your computer and use it in GitHub Desktop.
Save rafmagana/811337 to your computer and use it in GitHub Desktop.
Send notifications to Prowl on God events
God.contact(:prowl) do |c|
c.name = 'your name'
c.apikey = 'your prowl api'
c.group = 'developers'
end
God.contact(:prowl) do |c|
c.name = 'another name'
c.apikey = 'another prowl api'
c.group = 'developers'
end
God.watch do |w|
#...
#a lot of things here
#...
w.transition(:up, :restart) do |on|
on.condition(:memory_usage) do |c|
c.interval = 20
c.above = 100.megabytes
c.times = [3, 5]
c.notify = {:contacts => 'developers',
:priority => 2,
:category => "Thin #{instance_number} memory too high!"}
end
end
#Check priorities in line 45 of https://github.com/mojombo/god/blob/master/lib/god/contacts/prowl.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment