Check average rate script

Hello,

I was trying to make a script, which will check the rate of the particular queue in queue tree. The idea is, that starting from 19h until 01h every 30 minutes to check the current rate of that queue, if the rate is less than the rate configured in the same but disabled queue, than to enable it and disable the active queue, but if the current rate is higher than the disabled queue configured rate, than to keep using the active queue and do nothing. What I can’t successfully achieve with the script is to get the rate of the queue, and of course I’m not quite good in scripting so any help of you guys will be appreciated.

Regards.

Faton.

/queue tree get rate

Thanks mrz, what about the complete script solution ?

Regards.

Faton

Should this be the script for this:

:global check_rate [/queue tree get PRIO8 rate]
:local rate 20000000

:if ( $check_rate < $rate ) do={
/queue tree enable PRIO8-19h; /queue tree disable PRIO8

:if ( $check_rate > $rate ) do={
/queue tree enable PRIO8; /queue tree disable PRIO8-19h

But, with this command I do not get any value:
/queue tree get PRIO8 rate

Regards.

Faton

Ok, I have edited the script it works fine, just the first part:

:global checkrate [/queue tree get PRIO8 rate]
:local rate 20000000

:if ( $checkrate < $rate ) do={
/queue tree enable PRIO8-19h; /queue tree disable PRIO8
}

But the second part where if the result is > than rate doesn’t work;

:global checkrate [/queue tree get PRIO8 rate]
:local rate 20000000

:if ( $checkrate < $rate ) do={
/queue tree enable PRIO8-19h; /queue tree disable PRIO8
}

I think I’m missing something !!!

here is the complete script edited:

:global checkrate [/queue tree get PRIO8 rate]
:local rate 20000000

:if ( $checkrate < $rate ) do={
/queue tree enable PRIO8-19h; /queue tree disable PRIO8
}

:if ( $checkrate > $rate ) do={
/queue tree enable PRIO8; /queue tree disable PRIO8-19h
}



Regards.

Faton