Last active
October 21, 2019 01:52
-
-
Save eksiscloud/76aa756a4a2456815e5b053ccacdf1df to your computer and use it in GitHub Desktop.
Monit conf for a host/domain/site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### example.tld | |
check host example.tld with address www.example.tld | |
# ICMP check | |
if failed icmp type echo | |
for 2 times within 2 cycles | |
then alert | |
# HTTP check | |
if failed port 80 protocol http | |
with http headers [Host: www.example.tld, Cache-Control: no-cache] | |
and request / with content = "www.example.tld" | |
then alert | |
# HTTPS check | |
if failed port 443 type tcpSSL protocol http | |
with http headers [Host: www.example.tld, Cache-Control: no-cache] | |
and request / with content = "www.example.tld" | |
then alert |
host = just an unique name, not a real host
address = real URL
Varnish:
touch /var/www/example.tld/public_html/pong
nano /var/www/example.tld/public_html/pong
add what ever you have as content; here: www.example.tld
nano /etc/varnish/default.vcl
add:
if (req.url ~ "/pong") {
return (pass);
}
systemctl reload varnish
nano /etc/monit/conf.d/sites
change:
and request /pong with content = "www.example.tld"
systemctl restart monit
And now you can monitor downtime with Varnish.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/etc/monit/conf.d/