Using Statuscake's monitoring and Cloudflare to achieve high availability.
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
statusCakeMonitor.rename.me.php

README.md

StatusCake-CloudFlare

Using Statuscake's monitoring and Cloudflare to achieve high availability.

A PHP web hook to handle down notifications from Statuscake. If a Down notification is received, it'll change the A record of a domain on cloudflare to a backup IP set by you.



License: MIT
Dependencies: Web Server, PHP, php-curl lib

Setup:
1. I suggest you rename the php file to something obscure.
2. Add / change the global vars section. It consists of credentials and other information that needs to be modified to your needs.
3. Upload this script to the desired server, make sure the script is accessible via the internet.
4. On StatusCake:
Go into group contacts and add the ping URL. This URL is the URL of your PHP script that you just uploaded to your server in step 3.
Make sure the domains you're monitoring has the correct contact group (a group that contains the ping URL). 5. It's recommended that you have more than the PHP script as an alert type, so you can switch it back to the primary server once it's up. With this setup, a website shouldn't have a downtime of more than ~6 minutes, assuming your DNS provider does not cache queries.

You can reach me on twitter .

If you're looking for UptimeRobot + Cloudflare, you can find it here .