This setup allows continuous pinging of an IP and then takes action based on the outcome. Tweak times to desired times, I like to start with low times and test/watch it work, then modify actions, then increase time once I'm happy it's working.
Note: This uses the following command to write the output of the ping command to a file in the tmp dir.
A result of 0 = Ping Response and 1 = Fail.
This also uses CRON to run script @reboot.