I'm trying to use god to restart apache whenever certain lambda conditions
are met:
Enter code here...w.restart_if do |restart|
restart.condition(:lambda) do |c|
c.interval = 30.seconds
c.lambda = lambda do
# check that response times on apache threads are not >= 80%
slow ( >4s but checks script for current values )
system "/usr/local/bin/check-apache-slow-threads.rb >
/tmp/check-apache-slow-threads.log"
# if this is true, restart
if $?.exitstatus > 0
return true
end
# check that reply states of apache threads are not >= 90%
"Waiting Reply"
system "/usr/local/bin/check-apache-reply-states.rb >
/tmp/check-apache-reply-states.log"
# if this is true, restart
if $?.exitstatus > 0
return true
end
# i we don't have many slow threads or many waiting reply
states, so don't restart
return false
end
end
end
Anyway, the config file is accepted, so I don't see a syntax error but the
commands don't seem to run ( the files /tmp/check-apache* don't seem to be
created )
When I run the same ruby code ( the code for the lambda ) from a seperate
file there is no issue but I'm not sure the lambda conditions work this way.
I'm using god god-0.13.7 ( as a part of the ruby 1.8 gems in centos 6).
--
You received this message because you are subscribed to the Google Groups
"god.rb" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/god-rb.
For more options, visit https://groups.google.com/d/optout.