01-26-2024 01:12 AM
Hi chaps,
Does anybody know how to ask DNA-C for a wireless client summary for a specific area/building and SSID, AND for the last 30 days?
Rerporting in DNA-C is limited to last 14 days so no way to see all data from the last month that DNA-C stores.
I've raised this to TAC and used the "Make wish" to request, but in the meantime, I need to extract this data.
Any help with the python script woould be appreciated.
01-27-2024 03:53 AM
- Have a try with this one :
import requests
def get_wireless_client_summary(site_name, building_name, ssid_name):
api_url = "https://dnacenter.cisco.com/api/v1/network-device-group/device-groups/" + site_name + "/buildings/" + building_name + "/sites/0/clients"
headers = {
'Authorization': 'Bearer <your_token>',
'Content-Type': 'application/json'
}
params = {
'startDate': '2024-01-01',
'endDate': '2024-01-31',
'ssidName': ssid_name
}
response = requests.get(api_url, headers=headers, params=params)
if response.status_code == 200:
response_json = response.json()
print(response_json)
else:
print('Error: {}'.format(response.status_code))
if __name__ == '__main__':
# Replace with your site name, building name, and SSID name
site_name = 'Default-Site'
building_name = 'Building1'
ssid_name = 'Guest'
get_wireless_client_summary(site_name, building_name, ssid_name)
- Replace the placeholders for site_name, building_name, and ssid_name with the actual names of your site, building, and SSID. You will also need to replace the placeholder for <your_token> with your DNA Center API token. You can get your API token from the Cisco DNA Center web UI.
M.
08-28-2024 05:31 AM
Did you ever got the data yo u needed ? I'm looking into a similiar thingy.
01-05-2025 09:09 PM
Same here - would ideally like last month, but 30 days would be OK
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