Community discussions

MikroTik App
 
User avatar
chapex
Member Candidate
Member Candidate
Topic Author
Posts: 138
Joined: Wed May 30, 2007 1:23 am
Location: Patagónia Argentina
Contact:

script performing - change mask

Sat May 30, 2015 3:39 am

Dears... with the following script I covered 254 host. In the event that I want to analyze a / 20 or /21, for example, present in 2000 simple queue, what parameters should be changed? I currently run a script for each / 24, which generates excessive CPU consumption. Help !!! :D


:local traffic
/queue simple
:for i from=1 to=254 do={
:set traffic [get [find target="192.168.10.$i/32"] total-bytes]
:if ($traffic > 1572864000) do={
set [find target="192.168.10.$i/32"] max-limit=512000/512000
}
}

best regards !!!


Luciano
 
User avatar
9939781
Member Candidate
Member Candidate
Posts: 103
Joined: Tue Jun 14, 2011 6:42 am

Re: script performing - change mask

Tue Jun 02, 2015 5:41 am

:foreach i in=[/queue simple find target~"/32" total-bytes>1572864000] do={
/queue simple set $i max-limit=512000/512000}

like this? :lol:
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: script performing - change mask

Tue Jun 02, 2015 2:45 pm

Even more efficient:
/queue simple set [find target~"/32" and total-bytes>1572864000] max-limit=512000/512000

Who is online

Users browsing this forum: No registered users and 53 guests