Community discussions

MikroTik App
 
Cobusbu
newbie
Topic Author
Posts: 43
Joined: Fri Jan 04, 2008 9:20 am
Location: Cape Town, South Africa

Dynamic simple queue "total-bytes"?

Tue Jun 23, 2009 6:19 am

I have written a script which interrogates the dynamic queues from Usermanager.

When the users download more than 150MB the script should override the speed of the queues released by user-manager:

{
:local traf 0;
/queue simple;
:foreach i in=[find dynamic=yes] do={
:set traf [get $i total-bytes];
:if ($traf > 150000000) do = {
set $i limit-at=64000/64000 max-limit=64000/64000 burst-threshold=0/0 burst-limit=0/0 burst-time=0/0; \
}
}
}

I have noticed that the above script does not work correctly because "total-bytes" only gives me the Target Upload bytes.
Is that because the default queue type of a dynamic queue is the "default-small" queue?

How can I extract the total-bytes not only the Target Upload bytes?

Any help will be appreciated.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Dynamic simple queue "total-bytes"?

Tue Jun 23, 2009 12:28 pm

what is traffic limit of the rule before you run the script?
 
Cobusbu
newbie
Topic Author
Posts: 43
Joined: Fri Jan 04, 2008 9:20 am
Location: Cape Town, South Africa

Re: Dynamic simple queue "total-bytes"?

Tue Jun 23, 2009 9:13 pm

There is no traffic limit only speed limit.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Dynamic simple queue "total-bytes"?

Wed Jun 24, 2009 12:30 am

sorry, bandwidth limit =)

if it exists, then queue is being created and should count traffic...