Unless anyone has a good idea, I shall switch back to multiple requests. error : skipping queued event /var/monit/id - unknown data format info : Monit start delay set - pause for 240s info : Starting monit daemon with http interface at error : 'webserver' service restarted 2 times within 2 cycles(s) - exec info : 'php-fpm' start: /usr/sbin/service error : 'php-fpm' process is not running error : 'webserver' failed, cannot open a connection to INET[via TCPSSL error : 'webserver' failed protocol test at INET[via TCPSSL - HTTP: Error receiving data - Resource temporarily unavailable error : skipping queued event /var/monit/state - unknown data format In my case, this caused multiple reboots: error : skipping queued event /var/monit/id - unknown data format It seems that the timeout action is re-run after a reboot under certaing circumstances. If someone knows how to do it better, advice is stil appreciated :) Thanks!Īfter some testing, I DO NOT recommend to use monit's timeout feature ( IF 2 REsTARTS WITHIN.) for second-order actions. This modification does not include the alert on first URL fail (a workaround would be to use dummy start/stop commands, here) but can do a restart after 2 fails and a reboot aber 4 fails - with only one server request. IF FAILED (url and content = 'test content' and timeout 20 seconds) Therefore, I would apprechiate some advice very much.Īfter spending some mot time with the monit man page (it's much better structured than the online manual, in my opinion), I found this optimization: CHECK HOST webserver WITH ADDRESS 127.0.0.1 I tried to find the answers from the official monit reference, but obviously, I do not understand the possibilities as decribed in that source. Is there any way to run one request per cycle and perform different activities after a different number of fails? To do different actions after 1 fail, 2 fails, and 4 fails, I need three if failed conditions, resulting in three server requests.Can I use any other check instead of check process? Actually, I do not want to monitor the nginx process here, but the ports/URLs. ![]() That's not entirely wrong, but some questions remain: If failed (url and content = 'test string' and timeout 20 seconds) Here's my monit configuration file (in conf.d): check process webserver with pidfile /var/run/nginx.pid To do so, I create two bash scripts /etc/monit/ and /etc/monit/. I am not so much interested in the cause of a current problem, but want to restart both processes. When something happens, the both processes (ad their threads) usually exist and need a restart. Of course, I never know, if nginx may crash as well, some day. If some trouble occurs, usually php5-fpm hung up, resulting in a "bad gateway" server error.
0 Comments
Leave a Reply. |