how do I get top 10 WAN interface utilization through a API?
See here: https://dashboard.meraki.com/api_docs#the-traffic-analysis-data-for-this-network
And here: https://dashboard.meraki.com/api_docs#return-an-array-containing-the-uplink-information-for-a-device
The sandbo doesn't have much traffic as it's not a production network with users on it. Try this on your own network, or try this API key with the "Meraki Live Demo" organization, so take it for a test drive:
fa1d2daa7bb8b71d5d87e1ee19ae55dacda0435d
For example, this statement:
curl -X GET \
'https://dashboard.meraki.com/api/v0/networks/L_646829496481087790/traffic?timespan=10000' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: d320422f-7a43-da8a-0dfe-1b690ae93712' \
-H 'x-cisco-meraki-api-key: fa1d2daa7bb8b71d5d87e1ee19ae55dacda0435d' \
-d '{
"enabled": false
}'
Returns several applications starting with pings:
[
{
"application": "ICMP",
"destination": "8.8.8.8",
"protocol": "ICMP",
"port": "-",
"recv": 3771,
"sent": 3772,
"flows": 0,
"activeTime": 45960,
"numClients": 5
},
How does the uplink API provides information on network utilization? I do not see any traffic related information in the return JSON.
Great point - I was wrong in my prior response - the WAN status doesn't get you closer to the top 10 WAN links.
The best way to calculate network usage via API is to do a sum of all the clients on the MX. Request the clients data from the API endpoint for /devices/[serial]/clients?timespan=XXX.
API Docs:
https://dashboard.meraki.com/api_docs#list-the-clients-of-a-device-up-to-a-maximum-of-a-month-ago
This statement requires the clients data from an MX100:
curl -X GET \
'https://dashboard.meraki.com/api/v0/devices/Q2JN-RD78-XJNM/clients?timespan=100000' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 156f0307-e4a3-fa76-4aff-654737a2ca9a' \
-H 'x-cisco-meraki-api-key: fa1d2daa7bb8b71d5d87e1ee19ae55dacda0435d' \
-d '{
"enabled": false
}'
This returns the client usage sent and received:
[
{
"usage": {
"sent": 10143.885104300918,
"recv": 0
},
"id": "k945d80",
"description": "sf-mv-1-9-e0553d830582",
"mdnsName": null,
"dhcpHostname": "sf-mv-1-9-e0553d830582",
"mac": "e0:55:3d:83:05:82",
"ip": "172.16.1.16",
"vlan": 1
},
Now just sum all the clients on the MX and you have the site's total usage. Do this for every site and you have your top 10.
Comments
0 comments
Please sign in to leave a comment.