Report this

What is the reason for this report?

Does anybody know for both domain & subdirectory at the same time how to set up monit?

Posted on October 7, 2018
LS1

By LS1

I have already setup monit for main domain(code below) but I am stuck for the subdirectory.

check process nginx with pidfile /var/run/nginx.pid group www-data start program = “/etc/init.d/nginx start” stop program = “/etc/init.d/nginx stop” if failed host example.com port 80 protocol http then restart if 5 restarts within 5 cycles then timeout

   check process mysql with pidfile /var/run/mysqld/mysqld.pid
       start program = "/etc/init.d/mysql start"
       stop program = "/etc/init.d/mysql stop"
       if failed unixsocket /var/run/mysqld/mysqld.sock then restart
       if 5 restarts within 5 cycles then timeout

   check process php7.0-fpm with pidfile /var/run/php7.0-fpm.pid
       start program = "/etc/init.d/php7.0-fpm start"
       stop program = "/etc/init.d/php7.0-fpm stop"
       if failed host example.com port 80 protocol http then restart
       if 5 restarts within 5 cycles then timeout


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You need to use request like this: if failed host example.com port 80 protocol http request “/blog” then alert

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.