How to automate pinging multiple webservers, then fire automation only after multiple failures?

I want to be ping 2 different hostnames, and if there is are successive failures over a period of time, then run an automation like notify me?

Specifically:

  1. Ping domain1.com and domain2.com every 15 mins.
  2. If one succeeds, then good.
  3. if both fail, then wait until next interval and ping again. If both still fail, send alert.

I see there a ping platform, but not sure how to chain logic together as I describe. Suggestions?