Community discussions

MikroTik App
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

I need Help urgent please pleasse

Mon Apr 30, 2012 9:54 am

:(

Dear Support,

Kindly, i need to make script all details below :

Example :( : if username reached limit-bytes-total , then ( disable the limit-bytes-total and change profile for this user to another profile) else don't make anything.

Please please support make to me script for this issue if possible coz i need it urgent , i'm write script but not problem and show to me error coz i don't have any experiences for script mikrotik low .

I'm wait from you good reply about this is issue ASAP.


Thank you for cooperating with me in advance and thank you for help me again.
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Mon Apr 30, 2012 10:16 am

I want to informed you im use hotspot system to limit users ..
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: I need Help urgent please pleasse

Tue May 01, 2012 12:29 am

try this and comment

foreach userhotspot in=[/ip hotspot user find] do={
#change (example 200 Mb) limit traffic per user
local limitraf 2
local Mb (1024*1024)
local totaltraf ($limitraf*$Mb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Wed May 02, 2012 8:21 pm

try this and comment

foreach userhotspot in=[/ip hotspot user find] do={
#change (example 200 Mb) limit traffic per user
local limitraf 2
local Mb (1024*1024)
local totaltraf ($limitraf*$Mb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
Thank you for help me , but not understand what do you mean for this script .
I told you , i have 200 user and but im limited user for 4G 30day and profile default without limit for speed , i want when user reached the 4G the limit-total , the limit-total be zero and transfer to another profile down the speed to 400Kbps .

As well as if possible explain me that to check it if work or not please please .

Thank you again for help me , i will happy for your reply in hurry .
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Thu May 03, 2012 9:51 am

try this and comment

foreach userhotspot in=[/ip hotspot user find] do={
#change (example 200 Mb) limit traffic per user
local limitraf 2
local Mb (1024*1024)
local totaltraf ($limitraf*$Mb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
Thank you for help me , but not understand what do you mean for this script .
I told you , i have 200 user and but im limited user for 4G 30day and profile default without limit for speed , i want when user reached the 4G the limit-total , the limit-total be zero and transfer to another profile down the speed to 400Kbps .

As well as if possible explain me that to check it if work or not please please .

Thank you again for help me , i will happy for your reply in hurry .

Sir,

I make the script below :
foreach userhotspot in=[/ip hotspot user find] do={
#change 
local limitraf 4
local Gb (1000*1000*1000)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile ChangSO4G for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=ChangSO4G}
}
please check it correct or not correct ...


Thank you again .
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: I need Help urgent please pleasse

Thu May 03, 2012 10:27 pm

foreach userhotspot in=[/ip hotspot user find] do={
#change limitraf  
local limitraf 4
local Gb (1024*1024*1024)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile ChangSO4G for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=ChangSO4G}
}

and reset counter
foreach userhotspot in=[/ip hotspot user find] do={
ip hotspot user  reset-counters $userhotspot
}
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Sat May 05, 2012 9:33 am

foreach userhotspot in=[/ip hotspot user find] do={
#change limitraf  
local limitraf 4
local Gb (1024*1024*1024)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile ChangSO4G for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=ChangSO4G}
}

and reset counter
foreach userhotspot in=[/ip hotspot user find] do={
ip hotspot user  reset-counters $userhotspot
}
Thank you for this is script, but i want reset counter just for user reached the limit and transfer to another profile , good transfer to another profile but the reset counter for user the reached limit only , coz im run the script reset counter for all users ..

Please help me if possible ...
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Sat May 05, 2012 12:03 pm

foreach userhotspot in=[/ip hotspot user find] do={
#change limitraf  
local limitraf 4
local Gb (1024*1024*1024)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile ChangSO4G for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=ChangSO4G}
}

and reset counter
foreach userhotspot in=[/ip hotspot user find] do={
ip hotspot user  reset-counters $userhotspot
}
Thank you for this is script, but i want reset counter just for user reached the limit and transfer to another profile , good transfer to another profile but the reset counter for user the reached limit only , coz im run the script reset counter for all users ..

Please help me if possible ...
foreach userhotspot in=[/ip hotspot user find] do={
#change limitraf
local limitraf 4
local Gb (1000*1000*1000)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
/ip hotspot user reset-counters [find where profile="test1"]
Thank you my friend for help me , and i give you karma.
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Sun May 06, 2012 11:03 am

foreach userhotspot in=[/ip hotspot user find] do={
#change limitraf  
local limitraf 4
local Gb (1024*1024*1024)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile ChangSO4G for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=ChangSO4G}
}

and reset counter
foreach userhotspot in=[/ip hotspot user find] do={
ip hotspot user  reset-counters $userhotspot
}
Thank you for this is script, but i want reset counter just for user reached the limit and transfer to another profile , good transfer to another profile but the reset counter for user the reached limit only , coz im run the script reset counter for all users ..

Please help me if possible ...
foreach userhotspot in=[/ip hotspot user find] do={
#change limitraf
local limitraf 4
local Gb (1000*1000*1000)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
/ip hotspot user reset-counters [find where profile="test1"]
Thank you my friend for help me , and i give you karma.
My friend,

Kindly, I have problem right now, coz i have 200user, 150user limited and 50 user not limited and take another profile , when run this script will apply on all user and and when byte-in and byte-out for all user will transfer to another profile , if possible resolve me this problem i will be happy from you to help me .

Thank you for help me in advance and thank you for all Team support mikrotk .
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Sun May 06, 2012 11:08 am

My friend,

Kindly, I have problem right now, coz i have 200user, 150user limited and 50 user not limited and take another profile , when run this script will apply on all users and when (byte-in and byte-out= 4G ) for all user will transfer to another profile , if possible resolve me this problem i will be happy from you to help me .

Thank you for help me in advance and thank you for all Team support mikrotik .
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Wed May 09, 2012 12:29 pm

Any update please , coz i need this script ASAP.
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: I need Help urgent please pleasse

Wed May 09, 2012 11:36 pm

add comment "limited"for each user limited


foreach userhotspot in=[/ip hotspot user find comment=limited] do={
#change limitraf
local limitraf 4
local Gb (1000*1000*1000)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
/ip hotspot user reset-counters [find where profile="test1"]
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: I need Help urgent please pleasse

Thu May 10, 2012 2:43 am

Is this what you're trying to do?

For each user where bytes-in + bytes-out is greater than 4GB, reset-counters and change profile for them:
foreach userhotspot in=[ /ip hotspot user find ( (bytes-in + bytes-out) > 4294967296 ) ] do={
	/ip hotspot user reset-counters $userhotspot
	/ip hotspot user set $userhotspot profile=test
}
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Thu May 10, 2012 9:36 am

add comment "limited"for each user limited


foreach userhotspot in=[/ip hotspot user find comment=limited] do={
#change limitraf
local limitraf 4
local Gb (1000*1000*1000)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
/ip hotspot user reset-counters [find where profile="test1"]

Dear,

If replace the comment by profile work or not , example:
foreach userhotspot in=[/ip hotspot user find profile=G4G] do={
#change limitraf
local limitraf 4
local Gb (1000*1000*1000)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile test1 for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=test1}
}
/ip hotspot user reset-counters [find where profile="test1"]
Please this is correct or not.

I'll wait reply from you....
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: I need Help urgent please pleasse

Sat May 12, 2012 9:24 pm

is ok
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Sun Jul 22, 2012 10:48 am

is ok

Dear Sir,

This script not work at this days, i don't when the problem .. version package is 5.19 ..
foreach userhotspot in=[/ip hotspot user find profile=Use1M] do={
#change limitraf
local limitraf 2
local Gb (1000*1000*1000)
local totaltraf ($limitraf*$Gb)
local in [ip hotspot user get $userhotspot bytes-in]
local out [ip hotspot user get $userhotspot bytes-out ]
local total ($in+$out)
#change profile Cutservice for user 
if ($total>$totaltraf) do={/ip hotspot user set $userhotspot profile=Cutservice}
}
when run this script take all users limited and change the profile , please help me for this problem coz i have Quite a few users.

I'll wait your solve from you , thank you for cooperating with me and thank you for your support .
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: I need Help urgent please pleasse

Tue Jul 24, 2012 5:20 am

why not working??
because is wrong?
 
MICPROF
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: I need Help urgent please pleasse

Fri Jul 27, 2012 1:52 pm

I will use user manager would you please give me link to check user limit down and up and user manger change profile when user reache limited ..