Difference between revisions of "NOC:ctwug qos"
From CTWUG Wiki
(→Script) |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
== Purpose == | == Purpose == | ||
+ | *Remove simple quees where the comments starts with "AUTO" | ||
+ | *Create Simple quees based on the comment on the interfaces where the interface comment starts with "client;256;". The "256" is the max kbps that the interface is allowed to upload. | ||
== Dependencies == | == Dependencies == | ||
+ | Interface comments need to start with "client;max-kbps;some other comments". ie. | ||
+ | client;256;link to Aragon | ||
== Script == | == Script == | ||
− | /queue simple | + | /queue simple |
− | :local qos | + | :local qos |
− | :foreach qos in [find] do={ | + | :foreach qos in [find] do={ |
− | + | :if ( [:pick [get $qos comment] 0 4] = "AUTO" ) do=[remove $qos] | |
− | } | + | } |
− | /interface | + | /interface |
− | :local qos | + | :local qos |
− | :foreach qos in [find] do={ | + | :foreach qos in [find] do={ |
− | + | :local com [get $qos comment] | |
− | + | :if ( [:pick $com 0 6] = "client" ) do={ | |
− | + | :local name [get $qos name] | |
− | + | :local p1 ([:find $com ";"] + 1) | |
− | + | :local p2 [:find $com ";" $p1] | |
− | + | :local mb ([:pick $com $p1 $p2]*1000) | |
− | + | :local com ("AUTO ".$name." BULK") | |
− | + | /queue simple add interface=$name name=$com packet-marks=BULK comment=$com max-limit=("0/".$mb) direction=download disabled=yes | |
− | + | } | |
− | } | + | } |
− | /system script run ctwug_run | + | /system script run ctwug_run |
− | |||
− | |||
− |
Latest revision as of 18:09, 30 June 2013
Purpose
- Remove simple quees where the comments starts with "AUTO"
- Create Simple quees based on the comment on the interfaces where the interface comment starts with "client;256;". The "256" is the max kbps that the interface is allowed to upload.
Dependencies
Interface comments need to start with "client;max-kbps;some other comments". ie.
client;256;link to Aragon
Script
/queue simple :local qos :foreach qos in [find] do={ :if ( [:pick [get $qos comment] 0 4] = "AUTO" ) do=[remove $qos] } /interface :local qos :foreach qos in [find] do={ :local com [get $qos comment] :if ( [:pick $com 0 6] = "client" ) do={ :local name [get $qos name] :local p1 ([:find $com ";"] + 1) :local p2 [:find $com ";" $p1] :local mb ([:pick $com $p1 $p2]*1000) :local com ("AUTO ".$name." BULK") /queue simple add interface=$name name=$com packet-marks=BULK comment=$com max-limit=("0/".$mb) direction=download disabled=yes } } /system script run ctwug_run