Capsman registration identify with dhcp lease comment

Hi everyone.

This weekend i was working in a script that someone asked in the forum, i couldn’t find the topic, so here you have

Is useful to know who is connect in which access point in Capsman. Capsman only shows mac-address, so this script search this mac-adress in dhcp-lease and create an access-list whit the mac and the same comment in DHCP. The result you will see in registration table the name that you have already set in static dhcp-lease list.

You can schedule this script for example each 4 hours, if someone new is connect (and you have it static dhcp lease) it will be add it. Be careful to make it often, remember each time you add some entry in access-list, your capsman will disconnect for a few seconds all clients and them they will connect again.

:local maccaps
:local macdhcp
:local name
:foreach i in=[/caps-man registration-table find ] do={
	:set maccaps ( [/caps-man registration-table get value-name=mac-address number=$i])
	:foreach j in=[/ip dhcp-server lease find ] do={
		:set macdhcp ( [/ip dhcp-server lease get value-name=mac-address number=$j])
		:set name [/ip dhcp-server lease get [find where mac-address=$macdhcp] comment ] 
		:if ($maccaps = $macdhcp ) do={
		/caps-man access-list disable [find mac-address=$macdhcp]
		/caps-man access-list add mac-address=$macdhcp comment=$name
		}
		}	
	}
/caps-man access-list remove [find where disabled]

Please test it and give me your comments.

If you give identity to your caps and in provision menu you use identity as prefix, whats the point of that script? In registration tab you can see who is where connected!
I always give static names to caps (like reception, mainbar, pool) and not let them as caps1, caps2, caps3 etc. that way i know which cap is down or who is connected where.

Hi.

Maybe you don’t undearstand my point. I don’t rename the CAPs, i only use comment of lease to comment wich device is connected in CAPs.

Here you have some pictures to ilustrate my script.

aaaa ok now i understand

I have CAPS man setup with multiple SSID all working fine. Now want to add the users of each SSID to an address list.
So I wanted to query the registration table but there does not seem to be a field for SSID.
EG: SSID one = Managers
SSID two= Workers.
Each SSID has its own DHCP to allocate IP addresses.
dhcp1=managers
dhcp2 = workers

Want to create and add any ip address of users login on through the managers SSID into an address list called managers_list. And the same for the workers SSID to workers_list
Anyone have any idea how to get this right.

Grant

Hi Gustave,

The screenshots are not shown here any more, can you upload them again?

Do I understand correct:

This script copies the DHCP lease comment to the caps access list comment?
It seems not to work for me with 6.43.4 .
I get a “invalid internal item number” errror.

Cheers
-gramels

Thank.. Work it for ME