02-04-2025 01:31 AM
Hi,
I'm trying to fetch client count statistics via Catalyst API : /dna/data/api/v1/clients/count
I apply basic filtering to only give the count of a certain Building and floor.
The number i get returned does not match the number I see in Catalyst GUI or WLC. Both Catalyst GUI and WLC DO match so I presume the correct data should be present, somehow at least. The number I get (i tested multiple buildings and floors) is almost double of the actual clients which are present. I already tested with filtering on SSID Any clue what could be happening ?
02-04-2025 06:26 AM
Wild guess, check if the API is returning real time data or aggregated data over a specific time period. I had a look at the docs quick, but could not see any notes on data refresh intervals.
02-04-2025 06:29 AM
I also tried to filter on startime (EPOCH time) but got similar results. Somehow it doesn't add up.
02-04-2025 06:34 AM
What happens if you collect total client count without any filters and compare it to the GUI/WLC to isolate whether the issue is with the filtering logic, same?
02-05-2025 01:05 AM
Yes, the nr. is more or less double of the actual connected clients.
02-05-2025 01:44 AM
Something does not seem right here, i would suggest asking TAC on this one as you have tried a few options and now the API endpoint need to be inspected to see why this differs so.
02-05-2025 07:32 AM
I figured it out. Clients in 'disconnected' state are also counted. A bit silly if you ask me. so the count API is useless imo. Fetching all clients and then filtering on clients in 'connected' state and perform a count on them did the trick. Would have been nice if the connectedState filter could be used in the API call.
02-05-2025 07:42 AM
@aflbakker hmm nice caveat, Glad you found it.
03-05-2025 12:32 PM
I use the RESTConf API off the WLC directly. The return on this will include a collection with an entry for every client. If all you need is a count it will be easy enough to get from there.
'https://{ip}:443/restconf/data/Cisco-IOS-XE-wireless-client-oper:client-oper-data/common-oper-data'
03-17-2025 04:00 PM
if you use a UTC time of about 6 minutes ago and that will filter a lot of the disconnected out and then you can are always just filter the last few out at your end.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide