API to monitor WAN port traffic

tjh188
Comes here often

API to monitor WAN port traffic

I would like to pull an API report showing how much data per network is using out of the Internet 1 port and Internet 2 port.  Exported in an Excel spreadsheet.  Is that possible?  We have over 800 networks and I would like to see which network uses the most data and which WAN uplink is being used the most.  

4 REPLIES 4
RaphaelL
Kind of a big deal

Hi ,

 

Yes it looks to be available.  https://developer.cisco.com/meraki/api-latest/#!get-network-appliance-uplinks-usage-history

 

It should provide you the usage of both WAN.

sungod
A model citizen

The call @RaphaelL mentions is the one to use, however be a bit careful there are open issues with it, one is that there could be huge errors in the usage data.

 

For more info see: https://community.meraki.com/t5/Developers-APIs/New-MX-endpoint-Appliance-uplinks-usage-history/m-p/...

 

The usage data issue has definitely been improving, the last test I did has just a few bad values, so work to resolve it seems to be progressing.

 

Example bad values for month to date across c. 40 MX devices, this MX67 transfers hundreds of GB in a 600 second period...

 

datetimemodeluplink sent  received timeslice
06/10/2022 21:10MX67wan1                     475,215                     451,661600
06/10/2022 21:20MX67wan1                     382,033                     359,902600
06/10/2022 21:30MX67wan1                     393,608                     359,690600
06/10/2022 21:40MX67wan1       286,792,286,113       173,053,238,131600
06/10/2022 21:50MX67wan1                     461,091                     444,982600
06/10/2022 22:00MX67wan1                     363,149                     349,026600
06/10/2022 22:10MX67wan1                     467,008                     435,564600
06/10/2022 22:20MX67wan1                     472,300                     445,367600
06/10/2022 22:30MX67wan1                     492,821                     446,611600
tjh188
Comes here often

My goal is to automate this script to run one time a month on the 1st to show the data usage from the previous month.  Is this API going to be able to handle this request?

sungod
A model citizen

Be aware the maximum lookback stated in the documentation is "31 days", whether this is simply 86400*31 seconds or some other period isn't stated. But if you miss a run for some reason, or there is a network/API/other glitch (these things happen), you may run out of time to recover before losing data.

 

I recommend use the Python library with async IO to run on all networks concurrently (underlying is rated limited, but the library handles that for you) as you will be issuing call-per-network, this will run faster than network at a time.

 

Fwiw for testing I currently run it daily with 600 second resolution and build a long-term time series, same as the approach for a number of other things we measure, the automation handles some re-runs itself, or we can recover manually by setting t0-t1 as appropriate.

 

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.