Community discussions

MikroTik App
 
Megateq
newbie
Topic Author
Posts: 38
Joined: Thu Jan 08, 2009 12:33 am
Location: Nigeria
Contact:

Script for Daily Uptime Limit for Hotspot users

Thu Jan 08, 2009 1:06 am

Could someone help me out on script that will restrict the number of hours a user should be up and browsing per day. ie, if a user is to be allowed access for say, one month, i need to be able to restrict his/her uptime to say, 5hrs per day for the one month. Once this uptime limit is reached, the hotspot should log the user out, and allow the user access again only on the next day.
Am still novice to Script and new to Mikrotik
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6695
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Script for Daily Uptime Limit for Hotspot users

Thu Jan 08, 2009 9:08 am

The configuration for HotSpot only.

- to set limit for 5 hours of Internet usage,
ip hotspot user add limit-uptime=5h name=<username>
- to allow 5 hours a day, you need to reset counters once a day or over the required period,
ip hotspot user reset-counters [find]
add this line to /system sceduler and set required interval, for example 1 day at 00:01 to reset the counters and allow new 5 hours for the same user.
 
gtrappmann
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Fri Nov 03, 2006 7:42 am
Location: germany
Contact:

Re: Script for Daily Uptime Limit for Hotspot users

Thu Jan 15, 2009 9:08 am

hallo sergejs,

is it right that this is not running with user manager...
i tried to reset counters, but it only resets "used time", not "left time".
so if "left=0" you don´t get new time if you reset the user ...

regards

gerd
 
Mayssam961
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Fri Jun 04, 2010 10:13 am

Re: Script for Daily Uptime Limit for Hotspot users

Sun Oct 03, 2010 4:51 pm

I Have the same problem i need to refresh the users every single night at 12AM
So they can use the internet next day morning ,
Any Scrips ?
Please
 
andrescamino
Member Candidate
Member Candidate
Posts: 198
Joined: Wed Aug 19, 2009 7:07 pm
Location: Guayaquil-Ecuador

Re: Script for Daily Uptime Limit for Hotspot users

Tue Oct 12, 2010 12:51 am

hi

you may find this useful....I had the same problem so I did this

hope it helps

http://forum.mikrotik.com/viewtopic.php?f=2&t=45457
 
Mayssam961
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Fri Jun 04, 2010 10:13 am

Re: Script for Daily Uptime Limit for Hotspot users

Tue Mar 22, 2011 12:10 pm

thanks, that really helped
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: Script for Daily Uptime Limit for Hotspot users

Thu Jun 16, 2011 11:41 pm

Very helpful, But can we reset some set of users in a profile instead of all users? if yes how can this be achieved from the script?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Script for Daily Uptime Limit for Hotspot users

Thu Jun 16, 2011 11:43 pm

See the other thread in which you asked the same question.

Asking the same question all over the place wastes other people's time.
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: Script for Daily Uptime Limit for Hotspot users

Fri Jun 17, 2011 10:49 pm

See the other thread in which you asked the same question.

Asking the same question all over the place wastes other people's time.
When nobody is responding or helping!
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Script for Daily Uptime Limit for Hotspot users

Fri Jun 17, 2011 11:47 pm

The two posts are three minutes apart.
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: Script for Daily Uptime Limit for Hotspot users

Sat Jun 18, 2011 2:51 pm

I was just anxious of a solution as I am under pressure from my clients!
 
velkot
just joined
Posts: 1
Joined: Sat Feb 29, 2020 8:58 am

Uptime Limit reached

Sat Feb 29, 2020 9:20 am

hi everyone,

we've using MikroTik user man, within the validity period it shows an error message "uptime limit reached". for example, i generated 30 days validity cards. these cards are expired within a week and it shows an error "uptime limit reached".
help me to rectify this error...
 
joshuanieves32
just joined
Posts: 2
Joined: Sat Jun 25, 2022 5:59 am

Re: Script for Daily Uptime Limit for Hotspot users

Thu Oct 20, 2022 10:31 am

The configuration for HotSpot only.

- to set limit for 5 hours of Internet usage,
ip hotspot user add limit-uptime=5h name=<username>
- to allow 5 hours a day, you need to reset counters once a day or over the required period,
ip hotspot user reset-counters [find]
add this line to /system sceduler and set required interval, for example 1 day at 00:01 to reset the counters and allow new 5 hours for the same user.
How about to Reset Counter everyday using script thanks
 
eldoncito2019
Member
Member
Posts: 333
Joined: Fri Jun 14, 2019 1:07 pm

Re: Script for Daily Uptime Limit for Hotspot users

Thu Oct 20, 2022 4:22 pm

{
 /ip hotspot user reset-counters
}

I hope it will be of great help @joshuanieves32.




EL DONCITO.

Who is online

Users browsing this forum: drpioneer, own3r1138 and 21 guests