We are currenlty monitoring active hotspot users by running a script that returns /ip hotspot active print count-only. But, using the trial feature as well as local accounts entered on the router, along with users authenticated by an external radius server, we have no way to tell how many of the active users are radius and how many are local or dynamic.
For example, here’s the output of the active users (snipped):
When you print the active hotspot users, there is the flag column, but the get command doesn’t work using flag. Notice the user “joeblow” has the “R” next to him. Is this possible to extract the Radius flag value? Anyone have any hints or suggestions? Thanks.[/code]
Thanks for the suggestion Eugene. This command does work, but doesn’t return anything, I just get a new line for both radius and non-radius users. Perhaps this might do the trick in the future?
Ideally, It would be nice to have the following print extensions (or just integrate these into SNMP oids which is preferrable)
/ip hotspot active print count-only – prints all active users
/ip hotspot active print radius count-only – prints only radius active users
/ip hotspot active print trial count-only – prints only trial active users
I wouldn’t want to lose the all active user count, but it would be really handy for the print command to be able to separate the user types.
I’m not very familiar with scriptign in MT, so if I’m missing something obvious, please let me know
get command does not output anything to the screen. It merely returns a value to another script command. To get a printout, you should use something like this:
/ip hotspot active print from=[/ip hotspot active find login-by=trial]
/ip hotspot active print from=[/ip hotspot active find radius=yes]
and you could append count-only to each of these commands, of course.
I needed to update this thread as the solution provided by Eugene does not work on the newest versions of Mikrotik. The follow code has worked well when graphing different hostspot users based on if they authenticated via RADIUS or not:
/ip hotspot active print from=[/ip hotspot active find radius=yes] count-only
We have updated a couple of our busy routers from 2.9.27 to 2.9.42/.43 and this command now returns the count of all active users - count-only is ignoring the radius flag. For example:
[admin@router] > /ip hotspot active print
Flags: R - radius, B - blocked
# USER ADDRESS UPTIME SESSION-TIME-LEFT IDLE-TIMEOUT
0 R ruser1 192.168.254.47 5h29m56s 18h30m4s 12h
1 guest 192.168.254.53 8h21m1s 15h38m59s 1h
2 R ruser2 192.168.254.55 32m31s 4w1d23h27m29s 5d
3 T-00:12:5... 192.168.254.62 15m4s 1h44m56s 10m
4 local1 192.168.254.165 3h49m49s 4w1d20h10m11s 1w
[admin@router] > /ip hotspot active print count-only
5
[admin@router] > /ip hotspot active print from=[/ip hotspot active find
radius=yes]
Flags: R - radius, B - blocked
# USER ADDRESS UPTIME SESSION-TIME-LEFT IDLE-TIMEOUT
0 R ruser1 192.168.254.47 5h30m22s 18h29m38s 12h
1 R ruser2 192.168.254.55 32m57s 4w1d23h27m3s 5d
[admin@router] > /ip hotspot active print from=[/ip hotspot active find
radius=yes] count-only
5
[admin@router] >
The print command is working, but count-only is counting all users and ignoring the […radius = yes ] (or) […radius yes].
Does anyone know why this might be happening? Or, is there a different way to extract this count? Thanks.
Just in case someone runs into this problem later..version 2.9.44 fixes the radius count-only problem from my previous post. Thanks for fixing this guys