Community discussions

MikroTik App
 
drmotaadam
just joined
Topic Author
Posts: 11
Joined: Sat Nov 13, 2021 12:22 am

Looping/switching Queues automatically

Sat Nov 13, 2021 2:25 pm

Hi,

I need help with looping Queues. Basically, I have a few queues and I need to do something special with that. I need to run one queue for 10seconds and after that, I need to run the second queue for 10seconds and then I need to loop it. Basically, I need to do the first queue (10s), second queue (10s), first queue (10s), second queue (10s) ane so on. Or I can do it also by switching queues on and off after some time... The first queue on/second queue off after 10s will be the first queue off/second queue on and so on.

I tried to do it but I have no idea how.
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 724
Joined: Tue Dec 17, 2019 1:08 pm

Re: Looping/switching Queues automatically

Wed Nov 17, 2021 1:31 am

The quick and easy way is to use "comment" to find the correct Queue...
In the following exemple the comment must contain Q1="abcdef" and Q2="123456"
Warning Basic-Script so no Buiild-in error mitigation and Co.


# Queue Flip-Flop Script
#-----------------------------------------------------------
# Define a Unique String for each Queue in the Comments
:global UIDQ1 "abcdef"
:global UIDQ2 "123456"
#-----------------------------------------------------------
/queue simple
:if ([get [find comment~($UIDQ1)] disabled] != [get [find comment~($UIDQ2)] disabled]) do={
# Only 1 of 2 Queues are Online
:if ([get [find comment~[$UIDQ1]] disabled]) do={
enable [find where comment~$UIDQ1]
disable [find where comment~$UIDQ2]
} else={
disable [find where comment~$UIDQ1]
enable [find where comment~$UIDQ2]
}
} else={
#Both Queues have the same Status
}
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: Amazon [Bot], BoraHorza, JesusUve and 92 guests