We are monitoring sidekiq process through monit. Once the sidekiq process reaches the memory of around 2 GB, we are restarting the process. We have start and stop program defined with tiemout of 90 seconds. But the stop program is getting failed (after waiting for the timeout of 90 seconds).
this is the sample monit configuration.
check process sidekiq
with pidfile /pathtopidfile
start program = "/bin/sh -c start sidekiq commmand" with timeout 90 seconds
stop program = "stop sidekiq command" with timeout 90 seconds
if totalmem is greater than 2GB for 3 cycles then restart
***## I need have some condition like this -> if "stop_program failed" then "do some action"***
end
P.S I dont know the correct syntax for capturing stop program failed in monit.. I checked the monit blogs but i could not.