Moving Static Queue Above Dynamic Queues

I use this code in a hotspot login script

/queue simple move [find name=cached] 0

to move a particular rule to the topmost position. The script executes fine but rule does not get to position “0”. The rule always end up below the dynamic rules.

I can manually move the rule to position “0” in winbox but the script can only move it as far as the dynamic rules. I am using ROS3.0RC5.

Anyone?

hello i, i am trying to do the exactly same thing for the same reason. will delete my message or move it here as it is the same topic.

michael

hello ,

if we cant move the static above the dynamic with script what about moving the dynamic below the static???

anybody out there with anygood ideas??

tried this but somting is wrong in it

{

:local name

/queue simple
:foreach i in=[/queue simple] do={

:set name [get $i name]

:if ($name=!“proxy_cache”) do={
/queue simple move 0 6
}
}

Hi Folks,

Have we stumbled upon a bug here?

I am able to replicate exactly what you are saying, in that dynamic queues for hotspot ALWAYS join at the top of the list, BUT this is not ALWAYS true for ALL dynamic queues.

I tried this also with my PPPOE server, and the PPPOE dynamic queues ALWAYS join at the bottom of the list (i.e. AFTER the static queues) therefore negating the need for the script that you guys (and myself) are looking for.

So, can someone at Mikrotik confirm for us what is the expected normal behaviour of dynamic queues?

Regarding the script, the first one that Skillful proposes always sends the static queues to the bottom because (I believe) we havent issued the print command before running the move command.

So I think mps01k is heading in the right direction in that we must query the queues first and then issue the move command.

I am not too good on scripting but am trying to work it through…

I have tried and failed with a script to solve this…

Did you guys solve it?

still no luck, and really need this!!!

I think it must be a bug.

OK, so if we all think its a bug, then lets all send in our supout to support@mikrotik.com.

So, to clarify my problem, dynamic HOTSPOT queues ALWAYS jump to the top of the list above any static simple queues. But when I do dynamic PPPOE queues they stay at the bottom, leaving the static simple queues at the top where they can work.

Just to ask you, which version ROS are you using? I have had this with 2.9.46

Regards

Alex

OK, I have written support.

Lets hope they can help us!

Rgds

Alex

Ok folks,

This is the feedback from the ever helpful Sergejs at Mikrotik Support. (Their support is great isnt it?)

Hello Alex,

Yes, it is working as designed, HotSpot queues are placed to the of the list.
It is possible to use ‘on-login’ and ‘on-logout’ script for the HotSpot user profile, when script is executed when any user logged in.

Identification is required for the ‘queue simple’ entry, in order script may find static ‘queue’ and place to the top,

you may use this script, that check for the priority (any other option might be used),

:foreach n in=[/queue simple find priority=1] do={ /queue simple move $n [:pick [/queue simple find] 0] }

Regards,
Sergejs

So he proposes a script! Which is where we started with this anyway.

I am going to start playing with this tonight. Will revert.

Rgds

Alex

OKAY!

Now I am getting the idea.

Sergejs script looks for queue priorities, then moves the script of the relevant priority to position zero. Then the script loops round and repeats until finished.

I cant pretend to understand fully all the script variables, but it is working.

So, standard pppoe and hotspot dynamic simple queues have a default priority of 8 the loweest priority.

So I changed the priority of my static simple queues to 1 and then ran the script, and hey presto all the statics jump to the top of the list.

So now I have set the script to run on each login event of the hotspot user, and it is working.

Now I wonder how to set “on user login” scripts with usermanager… but thats for another time.

Rgds

Alex

i need this for usermanager not for only hotspot.. still no luck getting anything to work and have tried .

Hey mps01k

Can you describe fully what you are trying to do?

The script Sergejs suggest is working perfectly for me. I am using for dynamic scripts from both PPPOE server AND hotspot server. And it works for me both using usermanager and also the built in Hotspot users and PPPOE secrets.

It moves the queues to exactly where I want them, so to the original query in the this topic we have (sergejs have) solved it…

I see that you are setting a wisp in Honduras via satelite? I am doing this in Kenya with a WISP with 2 x VSAT dishes, and all works great.

Post your config, we help you out.

Rgds

Alex

hello ,

this is the error i am getting

[admin@MikroTik] /ip hotspot active> print
Flags: R - radius, B - blocked

USER ADDRESS UPTIME SESSION-TIME-LEFT IDLE-TIMEOUT

0 R casm 192.168.250.3 29m39s
1 R favio 192.168.250.11 1h13m32s
2 R lucia 192.168.250.14 16m5s
[admin@MikroTik] /ip hotspot active> :foreach n in=[/queue simple find priority=1] do={ /queue simple move $n [:pick [
/queue simple find] 0] }
destination number too large
[admin@MikroTik] /ip hotspot active>

can you tell me what the priority you are giving to the hotspot dynamic queues? just double click one and look for priority.

Its not clear from your dump…

i am using from 8 to 5 on the dynamic queues and 1 on the static queue i want to move.

Ok,

so you have changed the script to choose queue priority 1 which is correct, as that is the static that you have.

When I try to run this from the command prompt I get a different error like this:

“no items or no numbers defined”

But when I run it from inside the script system it works fine. I suggest you try that.

Maybe that is the problem? Because everything else looks ok.

what version of OS are you running ? i am using 3.0rc5. I just put it into the scripter and it runs but does nothing at all.

can you post an exapmple of exactly how you have it set , that it works for you and not for me?

thanks