I am trying to create a script to get data usage from simple queues. I created two simple queues with differnet IPs and then run the following script in my terminal which shows the correct log output.
:global numberOfQueues ([:len [/queue simple find]] - 1)
:for i from=0 to=$numberOfQueues do={
:global targetIP [/queue/simple/get number=$i target]
/log info $targetIP
}
However when I go to system > Script and add the same exact script and try to run it I get an error “executing script test from winbox failed. please check it manually”
I noticed that when I have just one simple queue, this error is not presented but the logs are also empty. What am I doing wrong here?