Community discussions

 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Moving Static Queue Above Dynamic Queues

Sat Sep 29, 2007 11:25 pm

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.

Image
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues

Mon Oct 01, 2007 12:56 pm

Anyone?
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Tue Oct 02, 2007 12:53 am

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
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Tue Oct 02, 2007 12:25 pm

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??
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Tue Oct 02, 2007 1:29 pm

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
}
}
setting up small WISP in Honduras over Satelite connections
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues: Possible bug?

Fri Oct 05, 2007 8:45 am

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.....
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues

Mon Oct 08, 2007 10:09 pm

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

Did you guys solve it?
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Mon Oct 08, 2007 10:54 pm

still no luck,, and really need this!!!!!!!
setting up small WISP in Honduras over Satelite connections
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues

Tue Oct 09, 2007 12:23 pm

I think it must be a bug.
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues

Wed Oct 10, 2007 11:50 pm

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
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues

Wed Oct 10, 2007 11:58 pm

OK, I have written support.

Lets hope they can help us!

Rgds

Alex
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues

Thu Oct 11, 2007 6:05 pm

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
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues (RESOLVED)

Thu Oct 11, 2007 9:08 pm

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
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Sat Oct 13, 2007 2:51 am

i need this for usermanager not for only hotspot.. still no luck getting anything to work and have tried .
setting up small WISP in Honduras over Satelite connections
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues

Sun Oct 14, 2007 2:43 pm

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
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Mon Oct 15, 2007 10:32 pm

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>
setting up small WISP in Honduras over Satelite connections
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues

Wed Oct 17, 2007 7:55 am

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...
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Wed Oct 17, 2007 11:43 pm

i am using from 8 to 5 on the dynamic queues and 1 on the static queue i want to move.
setting up small WISP in Honduras over Satelite connections
 
alex_rhys-hurn
Member
Member
Posts: 313
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Moving Static Queue Above Dynamic Queues

Thu Oct 18, 2007 7:48 am

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.
 
mps01k
Frequent Visitor
Frequent Visitor
Posts: 89
Joined: Fri Mar 23, 2007 9:09 pm
Location: HONDURAS
Contact:

Re: Moving Static Queue Above Dynamic Queues

Fri Oct 19, 2007 1:46 am

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
setting up small WISP in Honduras over Satelite connections
 
User avatar
navibaghdad
newbie
Posts: 27
Joined: Mon Oct 09, 2006 5:38 pm

Re: Moving Static Queue Above Dynamic Queues

Sat Dec 01, 2007 9:39 pm

Hi
I tried using this script and set the static simple queue priority to 1 but still not effect cause dynamic rule is still move over static.I'm using V3.0rc11 .

any suggestion ?
 
User avatar
navibaghdad
newbie
Posts: 27
Joined: Mon Oct 09, 2006 5:38 pm

Re: Moving Static Queue Above Dynamic Queues

Sun Dec 02, 2007 4:41 pm

any one can help us in this problem ???
 
User avatar
Dragonmen
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu Jun 16, 2005 6:20 pm
Location: Sabac, Serbia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Tue Dec 04, 2007 10:08 am

Tried everything some time ago, but i did not suceed.
I think it can't be done.
 
User avatar
navibaghdad
newbie
Posts: 27
Joined: Mon Oct 09, 2006 5:38 pm

Re: Moving Static Queue Above Dynamic Queues

Wed Dec 05, 2007 12:21 am

ok what about Mikrotik support ? is there any way to solve this problem ? any script to solve it !!!!
 
User avatar
maximan
Trainer
Trainer
Posts: 548
Joined: Sat May 29, 2004 12:10 am
Location: Rio Cuarto, Argentina
Contact:

Re: Moving Static Queue Above Dynamic Queues

Fri Dec 07, 2007 7:53 pm

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.
You can't use this sintaxis on scripting, use dinamic to find the position

Max
MKE Solutions> > The Base of knowledge in spanish.
Academia de Entrenamientos: Training Center
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5699
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Sat Dec 08, 2007 6:52 pm

ok what about Mikrotik support ? is there any way to solve this problem ? any script to solve it !!!!
I think Mikrotik have fixed this already in RC11, at least now it works in my case.
 
User avatar
navibaghdad
newbie
Posts: 27
Joined: Mon Oct 09, 2006 5:38 pm

Re: Moving Static Queue Above Dynamic Queues

Sat Dec 08, 2007 8:48 pm

ok I'm upgrad to RC11 but its still notwork.can u please post ur conf.
 
User avatar
Dragonmen
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu Jun 16, 2005 6:20 pm
Location: Sabac, Serbia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Sun Dec 09, 2007 12:05 am

RC = not totally stable version (is there sucha thing anyway?) so i don't recommend using it in production environment
 
warwickw
just joined
Posts: 14
Joined: Mon Oct 02, 2006 12:37 pm

Re: Moving Static Queue Above Dynamic Queues

Mon Dec 10, 2007 5:17 pm

rc = stable if hardware = rb333

RB333 users don't have choice we can only use version 3 release.
 
User avatar
navibaghdad
newbie
Posts: 27
Joined: Mon Oct 09, 2006 5:38 pm

Re: Moving Static Queue Above Dynamic Queues

Fri Dec 14, 2007 2:17 am

ok then what is the best solution now ? mrz can u explain how u do it please ?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5699
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Fri Dec 14, 2007 10:45 am

Well.. three queues:
[admin@gw-loc] /queue simple> print
Flags: X - disabled, I - invalid, D - dynamic
0 D name="<hotspot-user1>" target-addresses=10.1.101.225/32
..........
1 D name="hs-<hotspot1>" dst-address=0.0.0.0/0 interface=ether1 parent=none
..........

2 X name="queue1" target-addresses=10.1.101.225/32 dst-address=0.0.0.0/0
..........

Issue command:
/queue simple move [find name="queue1"] 0

and here you go, static queue is above dynamic:

Flags: X - disabled, I - invalid, D - dynamic
0 X name="queue1" target-addresses=10.1.101.225/32 dst-address=0.0.0.0/0
..........
1 D name="<hotspot-user1>" target-addresses=10.1.101.225/32
..........
 
Cyrix
just joined
Posts: 1
Joined: Sun May 11, 2008 4:08 am

Re: Moving Static Queue Above Dynamic Queues

Sun May 11, 2008 4:11 am

i have the same problem with queues between local network and internet.
does anyone have an idea how to do this when using Radius (user manager, etc...)???
 
User avatar
Dragonmen
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu Jun 16, 2005 6:20 pm
Location: Sabac, Serbia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Fri Jun 20, 2008 1:06 pm

No, the script above don't work if you make script out of it, it work just in console, since you can't print in the script but only in console so it won't work.
As i said it can't be done afaik.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5699
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Fri Jun 20, 2008 2:03 pm

Latest version (3.10) simple script:
/queue simple move [find name="queue1"] 0

Checked all possible ways to execute it ( from terminal, scheduler, netwatch etc.) It works!
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues

Fri Jun 20, 2008 5:10 pm

Latest version (3.10) simple script:
/queue simple move [find name="queue1"] 0

Checked all possible ways to execute it ( from terminal, scheduler, netwatch etc.) It works!
This does not work with dynamic queues created by user-manager or hotspot. The script cannot move "queue1" above any dynamic queues created by hotspot or user-manager.
 
User avatar
Dragonmen
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu Jun 16, 2005 6:20 pm
Location: Sabac, Serbia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Sat Jun 21, 2008 1:04 pm

Latest version (3.10) simple script:
/queue simple move [find name="queue1"] 0

Checked all possible ways to execute it ( from terminal, scheduler, netwatch etc.) It works!
This does not work with dynamic queues created by user-manager or hotspot. The script cannot move "queue1" above any dynamic queues created by hotspot or user-manager.
Exactly.
Wanted to say that but you were faster.
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues (FIXED)

Thu Jul 10, 2008 3:52 pm

This issue had been fixed in ROS 3.11. This script
/queue simple move [find name="cached"] 0
now works as expected.

Many thanks to the Mikrotik team for this fix.
 
cravetou
Frequent Visitor
Frequent Visitor
Posts: 55
Joined: Tue Oct 16, 2007 11:17 am

Re: Moving Static Queue Above Dynamic Queues

Sat Aug 02, 2008 11:06 am

Hello

u can u use this script to do what u want automaticlly

:foreach i in=[/queue simple find dynamic=no] do={/queue simple move [/ queue simple get $i name] [/queue simple find dynamic=yes]}

Rafal
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues (FIXED)

Thu May 28, 2009 1:30 am

This issue had been fixed in ROS 3.11. This script
/queue simple move [find name="cached"] 0
now works as expected.

Many thanks to the Mikrotik team for this fix.

This is broken again in ver3.24!
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues (FIXED)

Mon Jun 01, 2009 11:18 am

This is broken again in ver3.24!

Any comments on this from the Mikrotik squad?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5699
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Mon Jun 01, 2009 11:34 am

Works for me.
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues

Mon Jun 01, 2009 7:49 pm

Yes. it works but not with the expected result. Instead of moving the queue to #0, it is moved to the end.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5699
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Moving Static Queue Above Dynamic Queues

Tue Jun 02, 2009 8:26 am

If you are checking in winbox, make sure that queues are sorted by the first column
 
User avatar
skillful
Trainer
Trainer
Topic Author
Posts: 557
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Moving Static Queue Above Dynamic Queues

Tue Jun 02, 2009 3:15 pm

Queues are sorted by the first column. I get the same result in terminal when I issue command "/queue print without-paging"

When downgrade to version 3.23 and the script works as expected.
 
GREG3f
Frequent Visitor
Frequent Visitor
Posts: 76
Joined: Wed Dec 03, 2008 9:52 pm

Re: Moving Static Queue Above Dynamic Queues

Fri Aug 20, 2010 3:01 am

Anyone know how to force a static script to be the very last queue in the list. I can do a move command, but I guess I need to know how to find what the last queue is. The reason is, that I wish to use the dynamic queues made by userman, but in case I have other ips that were not generated by userman, I want them treated by a general PCQ rule that limits their speed.

so my command is
/queue simple move [find name=Catchall] 160

But of course the position is always changing.

I tried setting the position to something larger that the actual number of queues, but it always fails.
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Moving Static Queue Above Dynamic Queues

Fri Aug 20, 2010 3:17 am

Try something like
/queue simple move [/queue simple find name=catchall] [:len [/simple queue find]]
 
GREG3f
Frequent Visitor
Frequent Visitor
Posts: 76
Joined: Wed Dec 03, 2008 9:52 pm

Re: Moving Static Queue Above Dynamic Queues

Sat Aug 21, 2010 11:54 pm

I have tried your suggested code with no success.
/queue simple move [/queue simple find name=catchall] [:len [/queue simple find]]
Queue actually moves to the top [0] position.
Any other suggestions?
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Moving Static Queue Above Dynamic Queues

Thu Oct 17, 2013 6:13 pm

there are simple script, just use
/queue simple set [find dynamic] parent=Local (parent local-network you have created)

put in On Login default user profiles in hotspot.
it will put new dynamic hotspot user under your static parent

:D
 
kr4k3n
just joined
Posts: 14
Joined: Fri Jan 08, 2010 8:01 pm

Re: Moving Static Queue Above Dynamic Queues

Thu May 22, 2014 12:33 am

I use this script run from scheduler...

/queue simple move [find where !dynamic] 0

It works on 5.14 and 6.7 I haven't tried it on anything else yet

correction, it works from terminal command but not from a script.. WTF
 
User avatar
winagain
Member Candidate
Member Candidate
Posts: 243
Joined: Sat Jul 15, 2006 10:18 pm
Location: Botswana
Contact:

Re: Moving Static Queue Above Dynamic Queues

Sat Jul 19, 2014 11:28 am

I managed to get the following to work
/queue simple move [find name="ITEM-TO-BE-MOVED"] 0
by doing this
/queue simple print
/queue simple move [find name="ITEM-TO-BE-MOVED"] 0
It now moves the simple queue to the top as it does in the terminal, I know print is not the best thing to use in scripts however it solved my problem.

Who is online

Users browsing this forum: No registered users and 7 guests