ip hotspot active print count-only with mac

hello,


I need to get mac address of active hot spot user in variable , so ,
how to get it ?

with command " / ip hotspot active print count-only" give me active users , but
I would also need mac address with this active users.

Thank you,
Thomas

How are you planning to output it?

The below will put it in the terminal window for you.

:foreach int in=[/ip hotspot active find] do={:put [/ip hotspot active get $int mac-address]}

Thank you,

but how can I put in log i mean in :

:log info

\

:foreach int in=[/ip hotspot active find] do={:put [/ip hotspot active get $int mac-address]}


Thank you,
Thomas

try this

:foreach i in=[/ip hotspot active find] do={
local mac [/ip hotspot active get $i mac-address]
local user [ip hotspot active get $i user]
log info "user $user and mac $mac" 
}

Hello,

thank you for reply, but one problem remains.This list only one user.
How to list - output users (mac’s+ip’s) in one line if there are more than one user logged in?

Thank you,
Thomas

I need also remote login users and mac ,
something like this, but script not execute:


:foreach i in=[/ip hotspot active find] do={
local mac [/ip hotspot active get $i mac-address]
local user [ip hotspot active get $i user]
log info "user $user and mac $mac"
}

/tool fetch mode=http address=192.168.2.22 src-path=("/hotspot/net_status.php?hotspot=1&users=$user&mac1=$mac") keep-result="no" dst-path="" port=80 host=192.168.2.22}

\

Thank you,
Thomas