Monit waits for process to stop when "check process" is used (since it knows the PID in such case, it will wait for process to stop).
In the case of "check host" it cannot detect whether the process stopped or not, since it is configured to test via network only. When restart action is triggered, it thus calls stop program immediately followed by start program.
If you want to call restart only, you can set it this way:
if failed host 192.168.1.10 port 80 protocol http for 5 times then exec "/etc/init.d/domino restart"
On Nov 6, 2009, at 9:27 AM, Balcoes wrote:
Problem solved using verbose logging – thank you. I got confused because the configuration file had the line if failed host 192.168.1.10 port 80 protocol http 10 times within 10 cycles then restart and when the web server is down, Monit status page shows “online with all services” during the first 10 checks. I thought that Monit would report immediately that the service is down. I used this long 10 check delay because Domino has it’s own recovery system and Monit is standing in the back line just in case. First problem solved and now I bumbed into another: shutting down the Domino server can take up to 2 minutes. However Monit stops and starts Domino at the same second: [CET Nov 6 08:18:46] info : 'myserver' stop: /etc/init.d/domino [CET Nov 6 08:18:46] info : 'myserver' start: /etc/init.d/domino The problem is that the stop command on the first line above shuts down the server started on the second line. The /etc/init.d/domino has a ‘restart’ parameter, but as seen Monit uses ‘stop’ followed by ‘start’. if failed host 192.168.1.10 port 80 protocol http 2 times within 2 cycles then stop if failed host 192.168.1.10 port 80 protocol http 5 times within 5 cycles then start but the first line causes Monit to ‘unmonitor’ the server and the second line is never run. Is there a elegant solution to get Monit pass the init script ‘restart’ parameter i.e. ‘/etc/init.d/domino restart’?