GTM Monitor for Traceroute

Need some help to setup advanced monitor. I am trying to setup a monitor to find if the traceroute went through some specific nodes to decide which pool will be active in GTM. For instance, traceroute from the GTM towards 1.1.1.1, if it goes through 2.2.2.2, then pool 1 up and pool 2 down. If it goes to 3.3.3.3, then pool 1 down and pool 2 up.

Here is an example of an external monitor I wrote for HTTPS:

Here is the main page for external monitor, with more examples and explanation:

Not sure what monitor you are referring to. GTM DNS response should tell which pool is active.