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 )