Monitor specific website with Monit

CC-BY-4.0 by Peter Molnar () at
https://petermolnar.net/monitor-specific-website-with-monit/
#code #monit #monitoring

How to: monitor the health of a remote web address with Monit.

Most of the examples of Monit checking a web address’ health is for localhost and in connection with checking the apache process. However, in case you want to monitor remote addresses, you’ll need this:

check host domain.com with address domain.com every 6 cycles
    if failed port 80 protocol http for 5 cycles then alert
    alert your.email@provider.com { connection, timeout } with mail-format {
        from: monit@your-server.com
        subject: $EVENT at $DATE on $HOST
        message: domain.com is unreachable from your-server.com server
    }