Page 1 of 1
hotspot limit
Posted: Thu Sep 30, 2010 6:31 pm
by andrescamino
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
Re: hotspot limit
Posted: Thu Sep 30, 2010 6:43 pm
by andrescamino
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
Re: hotspot limit
Posted: Thu Sep 30, 2010 10:38 pm
by keefus
i would like to be able to reset the counters on the 1st of the month if thats possible
Re: hotspot limit
Posted: Thu Sep 30, 2010 11:20 pm
by adrianatkins
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.
Re: hotspot limit
Posted: Tue Oct 05, 2010 2:27 am
by andrescamino
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
Re: hotspot limit
Posted: Mon Oct 11, 2010 6:14 pm
by keefus
Thats great but is there a way of running it monthly???
Re: hotspot limit
Posted: Mon Oct 11, 2010 6:32 pm
by fewi
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.
Re: hotspot limit
Posted: Tue Oct 12, 2010 12:34 am
by andrescamino
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
Re: hotspot limit
Posted: Tue Oct 12, 2010 12:49 pm
by keefus
Sound I'll give that a go cheers
Re: hotspot limit
Posted: Thu Jun 16, 2011 11:38 pm
by JP_Wireless
Is they a way of reseting a particular users in a profile instead of all users?
Re: hotspot limit
Posted: Thu Jun 16, 2011 11:42 pm
by fewi
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.
Re: hotspot limit
Posted: Fri Jun 17, 2011 11:06 pm
by JP_Wireless
/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"
Re: hotspot limit
Posted: Fri Jun 17, 2011 11:47 pm
by fewi
/ip hotspot user reset-counters [find profile="students"]
Re: hotspot limit
Posted: Sat Jun 18, 2011 2:54 pm
by JP_Wireless
Thanks a million, fewi!
Very helpful!
Re: hotspot limit
Posted: Mon Jun 20, 2011 12:37 pm
by JP_Wireless
/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?
Re: hotspot limit
Posted: Mon Jun 20, 2011 4:33 pm
by fewi
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.
Re: hotspot limit
Posted: Mon Jun 20, 2011 7:17 pm
by JP_Wireless
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?
Re: hotspot limit
Posted: Sun Jun 26, 2011 1:59 am
by JP_Wireless
Nobody is helping me achieve my ideas as narated above!
Re: hotspot limit
Posted: Tue Aug 30, 2011 8:06 pm
by trevorlc1234
/tool user-manager user reset-counter [/tool user-manager user find]
As per
http://forum.mikrotik.com/viewtopic.php?f=9&t=45731