Page 1 of 1

mikrotik.Send(.... for set queue

Posted: Tue Dec 24, 2013 3:15 pm
by sajjadzare
I use api for set queue for customer,but the result that return is :

Policy !trap=message=no such item.tag=username!done.tag=username

why ?

Re: mikrotik.Send(.... for set queue

Posted: Fri Dec 27, 2013 3:56 pm
by boen_robot
How does your request look and what is the RouterOS version you're using?

Re: mikrotik.Send(.... for set queue

Posted: Sat Dec 28, 2013 1:35 pm
by sajjadzare
How does your request look and what is the RouterOS version you're using?
on this router and with this code , every thing is correct but sometimes occur this error,not always

Re: mikrotik.Send(.... for set queue

Posted: Sat Dec 28, 2013 5:47 pm
by boen_robot
If you're targeting the queue by ID instead of a name, you should keep in mind that IDs may change as you add/remove/move queues, which could be the reason why it sometimes works, and sometimes not. Target queues by their name instead.

Re: mikrotik.Send(.... for set queue

Posted: Sun Dec 29, 2013 8:49 am
by sajjadzare
If you're targeting the queue by ID instead of a name, you should keep in mind that IDs may change as you add/remove/move queues, which could be the reason why it sometimes works, and sometimes not. Target queues by their name instead.
means that when i want to set queue for a customer, i should send username no id ? if yes, customer's id is unique and not change

Re: mikrotik.Send(.... for set queue

Posted: Sun Dec 29, 2013 3:45 pm
by boen_robot
I mean use the queue name. If the queue name is the customer's ID, then the customer ID it is.

So if the name of your queue is "CustomerID-1234", then make the request be something like:
/queue/simple/set
=numbers=CustomerID-1234
=max-limit=10M/10M


Re: mikrotik.Send(.... for set queue

Posted: Sun Dec 29, 2013 9:36 pm
by sajjadzare
I mean use the queue name. If the queue name is the customer's ID, then the customer ID it is.

So if the name of your queue is "CustomerID-1234", then make the request be something like:
/queue/simple/set
=numbers=CustomerID-1234
=max-limit=10M/10M

I use below codes
/queue/simple/set
=.id=<pppoe-CUSTOMERUSERNAME>
=max-limit=10M/10M

Re: mikrotik.Send(.... for set queue

Posted: Sun Dec 29, 2013 10:44 pm
by boen_robot
That should be equivalent to the above, so that's not the problem.

What RouterOS version are you using? There was a bug in recent versions about added/modified items (not just queues...) not being made available to scripts/API until a whole second after the fact. I don't remember the exact version, but it should certainly already be fixed in 6.7.

Re: mikrotik.Send(.... for set queue

Posted: Mon Dec 30, 2013 7:16 am
by Bee05
Nice post!

Re: mikrotik.Send(.... for set queue

Posted: Mon Dec 30, 2013 7:31 am
by sajjadzare
That should be equivalent to the above, so that's not the problem.

What RouterOS version are you using? There was a bug in recent versions about added/modified items (not just queues...) not being made available to scripts/API until a whole second after the fact. I don't remember the exact version, but it should certainly already be fixed in 6.7.
our RouterOS version is 6.7