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!
You need to use request like this: if failed host example.com port 80 protocol http request “/blog” then alert
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.