hotspot limit

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

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

i would like to be able to reset the counters on the 1st of the month if thats possible

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.

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

Thats great but is there a way of running it monthly???

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.

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

Sound I’ll give that a go cheers

Is they a way of reseting a particular users in a profile instead of all users?

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.

How do i insert the find command?

Can you help? i have a profile called “students”

/ip hotspot user reset-counters [find profile="students"]

Thanks a million, fewi!

Very helpful!

/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?

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.

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?

Nobody is helping me achieve my ideas as narated above!

/tool user-manager user reset-counter [/tool user-manager user find]

As per
http://forum.mikrotik.com/t/reset-uptime-counter/41420/1