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.
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 .
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}
}
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 ..
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.
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 .
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 .
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"]
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"]
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 .