On Sat, Feb 18, 2012 at 11:41 AM, Dan Cook <[email protected]> wrote:

> I need to execute a some ruby code on notification.
> We have a central health monitoring service on the box and process
> health is just one part of the overall reports.
> I would like to put the events into a queue on the disk and have our
> health monitoring service slurp up any events and send them to another
> centralized server.
>
> I assume I can just do this:
>
> w.transition(:up, :start) do |on|
>  on.condition(:process_exits) do |c|
>    # custom notification method here....
>  end
> end
>
>
A little more context on this:
I set up a very simple test where god was using the above condition.

w.transition(:up, :start) do |on|
 on.condition(:process_exits) do |c|
   LOG.info("Hello world.")
 end
end

and the resulting output is:

I [2012-02-19 18:22:08]  INFO: Loading foo.god
I [2012-02-19 18:22:08]  INFO: Syslog enabled.
I [2012-02-19 18:22:08]  INFO: Using pid file directory: /var/run/god
I [2012-02-19 18:22:08]  INFO: Hello world.
I [2012-02-19 18:22:08]  INFO: Started on drbunix:///tmp/god.17165.sock

So the above code only runs once at start time so my original question
stands.

How do I register a custom notification hook in god?

Cheers,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"god.rb" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/god-rb?hl=en.

Reply via email to