auto bandwidth test

hi…

i plan to have a script that put in scheduler…
:global Bandtest [/tool bandwidth-test 172.16.103.11 user=user password=password
duration=3s direction=both]; if ($Bandtest ([rx-total-average]<=5Mbps)) do={ping 172.16.103.11}

but i getting bad command message for it, how i make it if the received average <5M then it will ping 172.16.103.11 ip???

try this

{global bps1
/tool bandwidth-test 192.168.88.252 user=admin duration=3 direction=both do={:set bps1 (rx-total-average)};
if ($bps1<=5000000) do={ping 8.8.8.8 count=5}}