how to check if a wan connection is truly live

I am running a mixture of 7 cable and dsl internet connections to get my users online. I run a script which pings 3 hosts, the problem is sometimes the hosts can be pinged but at the same time the internet would not be working on those connections. This situation is getting the best of my script.

Does anyone here have an idea for a better approach?

Choose different ip to test for each wan and set blackhole for the ip in case its route is invalid. Then the ping will go only by selected wan or it will be discarded.

pinging is not the issue, the connections I use are unreliable meaning ping tests often return successful but internet browsing is dead.

And where are you pinging to? Are you sure you are not pinging thru other wan than you believe? What doesn’t work when ping works?

I have multiple webservers, I ping those. Using the following command to run pings
/ping interface=wan(number) xxx.xxx.xxx.xxx count=2

So use other ip addresses for testing if each wan is alive.