Route down log indication

Hi,
Looking to implement a check to confirm if routes are up and running for various subnets. Trying to get it working with Netwatch and an output to log at the moment but a major issue in the Loop that my inferior scripting skills have not managed to solve, so I turn to the forum for assistance.

Thanks to @Jotne for getting me this far with his post viewtopic.php?p=888800#p888800

Netwatch:
Host - 8.8.8.8
Up - Pointing to script “Test”
Down - Pointing to script “Test”

Script:
Name - Test
Source -

:local Host $host
/tool netwatch
:local Status [get [find where host="$Host"] status]
:while ($Status="down") do= {:log error "Down"}

This currently outputs an endless barrage of error log “Down” without end, only way I’ve found is a reboot. How can I get this error message to loop every minute if the netwatch status is marked as down and then to stop when status is up?

Is exactly what you want/write:
while $Status is down, write to error log “Down”…

If you had written instead:
if $tatus is down, write to error log “Down”…

Had already tried this however with logic it only outputs to log once. How would one go about getting this to repeat until the Status is noted as “up”?

:local Host $host
/tool netwatch
:local Status [get [find where host="$Host"] status]
:if ($Status="down") do={:log error "ITS DOWN"} else={:log error "ITS UP"}

ChatGPT gave me the answer

:while ($Status="down") do={
    :log error "Down"
    :delay 1000ms
    :set Status [get [find where host="$Host"] status] #THIS needs to check the var every time
}