Client count by SSID per AP

Solved
Prodrick
Building a reputation

Client count by SSID per AP

I’d like to be able to get the current client count for a given AP grouped by SSID Name. Thoughts on which API endpoints might provide this info?

1 Accepted Solution
Prodrick
Building a reputation

@alemabrahao thanks for causing me to not be lazy and to look a little deeper.  I found the following per-network endpoint to provide what I was looking for.  I started with no filters and the default timespan of 1 day, but this gets just Wireless clients for the past hour and provides the per-Wireless client data usage for the related SSID and AP.  With this I can group and sum the data per AP and per SSID.

https://developer.cisco.com/meraki/api/get-network-clients/

I wish this were a per Org Call so I could get it more often or if the syslog would write the SSID connection information, so I could get this without any API calls.  Please let me know if you/anyone might know of a more API efficient way to get this information.  Thanks again.

curl -L --request GET \
--url 'https://api.meraki.com/api/v1/networks/[networkId]/clients?timespan=3600&recentDeviceConnections[]=Wireless' \
--header 'Authorization: Bearer [API Key]' \
--header 'Accept: application/json'

Example response for one of the many clients (I anonymized the Client PII)

{
"id":"abc123",
"mac":"[Client MAC ]",
"description":"[Client Description]",
"ip":"[Client IPv4 Address]",
"ip6":null,"ip6Local":"[Client IPv6 Address]",
"user":null,
"firstSeen":"2023-12-07T18:14:25Z",
"lastSeen":"2023-12-08T04:15:21Z",
"manufacturer":null,
"os":"Apple iPhone",
"deviceTypePrediction":null,
"recentDeviceSerial":"[Meraki AP Serial Number]",
"recentDeviceName":"[Meraki AP Name]",
"recentDeviceMac":"[Meraki AP MAC]",
"recentDeviceConnection":"Wireless",
"ssid":"[SSID Name]",
"vlan":"28",
"switchport":null,
"usage":{"sent":791,"recv":1470,"total":2261},
"status":"Online",
"notes":null,
"groupPolicy8021x":null,
"adaptivePolicyGroup":null,
"smInstalled":false,
"namedVlan":null,
"pskGroup":null},
}

View solution in original post

3 Replies 3
alemabrahao
Kind of a big deal
Kind of a big deal

Have you checked the dashboard API?

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
alemabrahao
Kind of a big deal
Kind of a big deal

You can use the endpoint GET /devices/{serial}/clients to retrieve the clients connected to a specific device by its serial number. You can then filter and group this data by SSID.

 

Another useful endpoint could be GET /devices/{serial}/wireless/connectionStats which provides connection statistics for a device. You can specify a timespan to get recent data.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Prodrick
Building a reputation

@alemabrahao thanks for causing me to not be lazy and to look a little deeper.  I found the following per-network endpoint to provide what I was looking for.  I started with no filters and the default timespan of 1 day, but this gets just Wireless clients for the past hour and provides the per-Wireless client data usage for the related SSID and AP.  With this I can group and sum the data per AP and per SSID.

https://developer.cisco.com/meraki/api/get-network-clients/

I wish this were a per Org Call so I could get it more often or if the syslog would write the SSID connection information, so I could get this without any API calls.  Please let me know if you/anyone might know of a more API efficient way to get this information.  Thanks again.

curl -L --request GET \
--url 'https://api.meraki.com/api/v1/networks/[networkId]/clients?timespan=3600&recentDeviceConnections[]=Wireless' \
--header 'Authorization: Bearer [API Key]' \
--header 'Accept: application/json'

Example response for one of the many clients (I anonymized the Client PII)

{
"id":"abc123",
"mac":"[Client MAC ]",
"description":"[Client Description]",
"ip":"[Client IPv4 Address]",
"ip6":null,"ip6Local":"[Client IPv6 Address]",
"user":null,
"firstSeen":"2023-12-07T18:14:25Z",
"lastSeen":"2023-12-08T04:15:21Z",
"manufacturer":null,
"os":"Apple iPhone",
"deviceTypePrediction":null,
"recentDeviceSerial":"[Meraki AP Serial Number]",
"recentDeviceName":"[Meraki AP Name]",
"recentDeviceMac":"[Meraki AP MAC]",
"recentDeviceConnection":"Wireless",
"ssid":"[SSID Name]",
"vlan":"28",
"switchport":null,
"usage":{"sent":791,"recv":1470,"total":2261},
"status":"Online",
"notes":null,
"groupPolicy8021x":null,
"adaptivePolicyGroup":null,
"smInstalled":false,
"namedVlan":null,
"pskGroup":null},
}

Get notified when there are additional replies to this discussion.