Community discussions

MikroTik App
 
EngAMoktar
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Fri Aug 15, 2008 7:18 pm

[Help] How to find Queues that its names contains a word ?

Wed Mar 25, 2009 4:53 am

i wanna use script day and night to use a different bandwidth limit.
in 2.9 there are no argument (comment) , so
i included a word in the names that i wanna apply this script on like
George ==> George-CAT1

The script in this way doesn't work , it searches for the name "CAT1"
/queue simple
set [find name=CAT1] max-limit=256000/256000
I want the script to find any name contains "CAT1" or whatever
Any Help , Please ?
 
DjStraw
newbie
Posts: 46
Joined: Mon Oct 15, 2007 4:54 am

Re: [Help] How to find Queues that its names contains a word ?

Wed Mar 25, 2009 7:52 am

I try to do the same as you and I could not, but I manage and I did so differently.

First:
========================================================
Rescale them a comment andalusia Simple Queue, for that I leave you with the following script which I do easily.

/queue simple
set [/queue simple find name="CAT1"] comment=CAT1
:log info "Comment Added"

where it says name put the name of your Simple Queue must be between ""

Second:
========================================================
Create a scheduler with the following script and you're done.

/ queue simple
set [find comment =CAT1] max-limit = 256000/384000

Excuse my English but use a translator;)
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7054
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: [Help] How to find Queues that its names contains a word ?

Wed Mar 25, 2009 9:35 am

{
  :local name;
  :foreach i in=[/queue simple find] do={
    :set name [/queue simple get $i name];
    :if ([:find $name "CAT1"] >= 0) do={
         /queue simple set $i max-limit=256000/256000
    }
  }
}

Who is online

Users browsing this forum: No registered users and 36 guests