Community discussions

MikroTik App
 
bronco1980
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Wed Jul 22, 2009 5:02 pm

Script does not run after upgrade!!

Wed Jun 23, 2010 3:01 pm

need ur help colleagues,
after upgrading from 2.9.51 to 4.10 .. the script isn't running anymore..
how can i fix this?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Script does not run after upgrade!!

Wed Jun 23, 2010 3:25 pm

There were some changes to the script interpreter from V2.x to both V3.x and V4.x. You will need to modify the script to comply with those changes. See the User Manual here
http://wiki.mikrotik.com/wiki/Manual:Scripting
If you need help, and it isn't a horribly complex script, you might post it here. Maybe someone will help you.
 
bronco1980
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Wed Jul 22, 2009 5:02 pm

Re: Script does not run after upgrade!!

Wed Jun 23, 2010 3:34 pm

I really didn't know how to write it and make it work!!

here is the script that it was working on 2.9 and would like to make it work on 4.10.

:local traf;
/queue simple
:for i from=1 to= 254 do = {
:if ([/queue simple find target-addresses=("172.28.2." . $i)] != "") do={
:set traf [get [find target-addresses=("172.28.2." . $i)] total-bytes]
:if ($traf <204857600) do = {
set [find target-addresses=("172.28.2." . $i)] max-limit=64000/256000 limit-at=64000/256000
}
}
}
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Script does not run after upgrade!!

Wed Jun 23, 2010 4:13 pm

This shows ok now:
:local traf;
/queue simple
:for i from=1 to= 254 do={
:if ([/queue simple find target-addresses=("172.28.2." . $i)] != "") do={
:set traf [get [find target-addresses=("172.28.2." . $i)] total-bytes]
:if ($traf < 204857600) do={
set [find target-addresses=("172.28.2." . $i)] max-limit=64000/256000 limit-at=64000/256000
}
}
}
ADD: I corrected only format errors. I did not check it to see if it does what you require.
 
bronco1980
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Wed Jul 22, 2009 5:02 pm

Re: Script does not run after upgrade!!

Wed Jun 23, 2010 4:56 pm

it still not working ..
the script is running ( i can see this when the cpu is 100% ) but nothing is changed in my queue.. meaning users passing the 200M still running at normal speed after the script is turned on.

anyone know how to fix this guys!!
 
shaneau
just joined
Posts: 22
Joined: Sun Jul 04, 2010 6:31 am

Re: Script does not run after upgrade!!

Sun Jul 04, 2010 6:33 am

How did you go with this. I just upgraded one of mine and have the same problem.
 
dousin
just joined
Posts: 5
Joined: Fri Jun 17, 2011 11:54 pm

Re: Script does not run after upgrade!!

Tue Jan 28, 2014 4:09 pm

Currently, 01/2014 - Router OS v6.7, I had a similar problem, the script stopped working:
The reason is that parameters were renamed: replace "target-addresses" with "target".
It is also necessary to specify the IP addresses including subnet mask: "172.16.66." . $i . "/32".

The full version of a similar script (restrict hungry users):
:local traf;
/queue simple
:for i from=20 to=244 do={
   :if ([/queue simple find target=("172.16.66." . $i . "/32")] != "") do={
      :set traf [get [/queue simple find target=("172.16.66." . $i . "/32")] total-bytes]
      :if ($traf  > 536870912) do={
        set [find target=("172.16.66." . $i . "/32")] max-limit=1024k/1024k
      }
   }
}
Hopefully, this will help someone...