Community discussions

MikroTik App
 
noes
just joined
Topic Author
Posts: 5
Joined: Tue Nov 11, 2008 12:50 pm

Hotspot: active users count

Wed May 13, 2009 7:17 pm

Hi all,

I'd like to create a basic script to count the active users, so I can reset the speedlimit per user, in order to maximize bandwith when only a few users are logged in. The script itself shouldn't be too hard, but I simply can't figure out how to count the total users logged in. Could someone push me in the right direction? I assume it has some command in the "/ip hotspot active"-dir?

I don't need a complete script, but just this command ;)

Thank you in advance!

noes
 
noes
just joined
Topic Author
Posts: 5
Joined: Tue Nov 11, 2008 12:50 pm

Re: Hotspot: active users count

Thu May 14, 2009 11:34 am

ahh, figured it out already, now I fully understand the :len command! :D

:put [:len [/ip hotspot active find]]
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7211
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Hotspot: active users count

Thu May 14, 2009 11:56 am

print count-only is a lot faster
 
Etza
newbie
Posts: 46
Joined: Tue May 31, 2011 10:33 pm

Re: Hotspot: active users count

Thu Aug 30, 2012 4:23 pm

ahh, figured it out already, now I fully understand the :len command! :D

:put [:len [/ip hotspot active find]]
its possible to run this from login html pages ??
thx
 
User avatar
omega-00
Forum Guru
Forum Guru
Posts: 1167
Joined: Sat Jun 06, 2009 4:54 am
Location: Australia
Contact:

Re: Hotspot: active users count

Wed Sep 05, 2012 5:35 am

A better alternative to this would be to setup PCQ based queues that automatically allocate share available bandwidth between online users.
This way there's no need for any independent scripting to determine how the queues should/could change.

Check out the presentation done here: http://www.tiktube.com/?video=mEeI3iCGh ... vllGoILDp=
And accompanying slides: http://mum.mikrotik.com/presentations/U ... -megis.pdf