Hello.
I'm trying to set monit to take two actions in failure cases, ex:
check process PROCESS-MO-c matching "/home/USER/binn/PROCESS -f/home/USER/binn/PROCESS.c.properties --dispatch=MO --daemon"
start program "/home/USER/binn/PROCESS -f/home/USER/binn/PROCESS.c.properties --dispatch=MO daemon
stop program "/bin/bash -c '/bin/kill -9 `/bin/cat /tmp/PROCESS-MO.c.pid`'" as uid USER and gid GROUP
if does not exist then exec "/bin/bash /etc/monit.d/scripts/nagios_cmd.sh proc_mo_c_crit"
if does not exist for 5 cycles then start
else if recovered then exec "/bin/bash /etc/monit.d/scripts/nagios_cmd.sh proc_mo_corp_ok"
group gateway
When following the log, I see that if the process stops, monit will detect, and it will start it after 5 cycles, monit also runs the "else" action, however, it does not exec the first action, which is exec "/bin/bash /etc/monit.d/scripts/nagios_cmd.sh proc_mo_c_crit".
Any ideas of what am I doing wrong?
Regards,