Community discussions

MikroTik App
 
andrescamino
Member Candidate
Member Candidate
Topic Author
Posts: 198
Joined: Wed Aug 19, 2009 7:07 pm
Location: Guayaquil-Ecuador

hotspot limit

Thu Sep 30, 2010 6:31 pm

Hello to all,

Is there a way to reset the uptime limit everyday in hotspot for example I have a created a user with uptime limit 1 hour, but the next day I would like to reset that hour again...is there a posibility to do that?

thanks for your help
 
andrescamino
Member Candidate
Member Candidate
Topic Author
Posts: 198
Joined: Wed Aug 19, 2009 7:07 pm
Location: Guayaquil-Ecuador

Re: hotspot limit

Thu Sep 30, 2010 6:43 pm

well..

in case anyone wants it....i figured out that you can reset the counters every day with the scheduler with a line of script to reset the counters in the hotspot
 
keefus
just joined
Posts: 14
Joined: Tue May 25, 2010 11:49 am

Re: hotspot limit

Thu Sep 30, 2010 10:38 pm

i would like to be able to reset the counters on the 1st of the month if thats possible
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: hotspot limit

Thu Sep 30, 2010 11:20 pm

in case anyone wants it..
You started off asking a question, and unfortunately nobody knew, read your post, or wanted to answer.

It's all a self-help thing really, so why not just post your script solution so the next person who needs it can find it.

You'll get all famous and loads of Karma.
 
andrescamino
Member Candidate
Member Candidate
Topic Author
Posts: 198
Joined: Wed Aug 19, 2009 7:07 pm
Location: Guayaquil-Ecuador

Re: hotspot limit

Tue Oct 05, 2010 2:27 am

Hello to all,

Well the solution is really simple, this is how I did it.

Ok first of all you have to set your time on the router with the following command
 /system clock set date=DATE time=TIME 
Now you will be able to change or reset the counters at a specific date and time.

The second thing is to create a scritp so you can scheduled it
 /system script add name=resetcounter
then you have to fill the script, you can do it with this command
 /system script edit resetcounter source 
then the terminal will open an editor and you have to write this line
 /ip hotspot user reset-counters 
and press ctrl+o to save and quit

now the script to reset the user's counter is done...now you have to schedule the script in order to run the script at a specific date
 /system scheduler add name=dateresetcounter on-event=resetcounter
 interval=1d start-date=DATE WHEN YOU WANT TO START YOUR RESET
and that would be all.

if you require any further explanation just write
 
keefus
just joined
Posts: 14
Joined: Tue May 25, 2010 11:49 am

Re: hotspot limit

Mon Oct 11, 2010 6:14 pm

Thats great but is there a way of running it monthly???
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: hotspot limit

Mon Oct 11, 2010 6:32 pm

Yes, search the wiki for "schedule monthly" and you'll see several script examples for other purposes that run monthly. Combine that with his post.
 
andrescamino
Member Candidate
Member Candidate
Topic Author
Posts: 198
Joined: Wed Aug 19, 2009 7:07 pm
Location: Guayaquil-Ecuador

Re: hotspot limit

Tue Oct 12, 2010 12:34 am

Thats great but is there a way of running it monthly???
Hi Keefus...well you can search on the wiki as fewi said...or you can also create a script to alternate between 30 or 31 days to reset the counters...or maybe a simpler solution is to schedule the first day of everymonth without interval like this
/system scheduler add name=dateresetcounter on-event=resetcounter start-date=Oct/01/2010
one of them for every month...and that will reset your counters for the rest of the year...i know it's not very clean solution but it will work unless your clock stops working

Regards
 
keefus
just joined
Posts: 14
Joined: Tue May 25, 2010 11:49 am

Re: hotspot limit

Tue Oct 12, 2010 12:49 pm

Sound I'll give that a go cheers
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: hotspot limit

Thu Jun 16, 2011 11:38 pm

Is they a way of reseting a particular users in a profile instead of all users?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: hotspot limit

Thu Jun 16, 2011 11:42 pm

Sure. If you do not give it items to act on reset-counters acts on all users. Limit it by using a find command that filters on profile instead.
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: hotspot limit

Fri Jun 17, 2011 11:06 pm

 /ip hotspot user reset-counters 
How do i insert the find command?
Sure. If you do not give it items to act on reset-counters acts on all users. Limit it by using a find command that filters on profile instead.
Can you help? i have a profile called "students"
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: hotspot limit

Fri Jun 17, 2011 11:47 pm

/ip hotspot user reset-counters [find profile="students"]
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: hotspot limit

Sat Jun 18, 2011 2:54 pm

Thanks a million, fewi!

Very helpful!
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: hotspot limit

Mon Jun 20, 2011 12:37 pm

/system clock set date=DATE time=TIME
MT v5.4 is not accepting the command above! It replies:

invalid date!

My date and time is set correctly. What can i do?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: hotspot limit

Mon Jun 20, 2011 4:33 pm

Specify a valid date?

Or use NTP, which is pretty much a must with RouterOS since RouterBOARDs don't have batteries to store time during reboots.

It's impossible to tell you where a syntax error is if you don't paste the exact command you got an error for. I imagine you didn't actually tell it the four letters D, A, T, and E as a date.
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: hotspot limit

Mon Jun 20, 2011 7:17 pm

Thanks fewi!

They was an error in the command,

But can users in the usermanager be specified instead of users in the hotspot?

I tried this but not working:
/tool user-manager user reset-counters [find profile="students"]
When i tried it from the new terminal, it is asking me to specify a user in the user manager to reset its counter.

How can I specify all users in a profile or even all users in the user manager?
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: hotspot limit

Sun Jun 26, 2011 1:59 am

Nobody is helping me achieve my ideas as narated above!
 
trevorlc1234
just joined
Posts: 19
Joined: Tue May 25, 2010 8:46 am

Re: hotspot limit

Tue Aug 30, 2011 8:06 pm

/tool user-manager user reset-counter [/tool user-manager user find]
As per
http://forum.mikrotik.com/viewtopic.php?f=9&t=45731

Who is online

Users browsing this forum: Amazon [Bot], grayfoxbsd and 160 guests