Cellular Gateway - Get traffic

ksumann
Getting noticed

Cellular Gateway - Get traffic

Hi everyone,

 

is there an API to get the bytes sent and recieved over cellular on a monthly basis?

 

Thanks

7 Replies 7
sungod
Kind of a big deal

For MX integrated cellular, it is available with...

https://developer.cisco.com/meraki/api-v1/get-organization-appliance-uplinks-usage-by-network/

...you get data for each individual uplink on each devices, typically: wan1, wan2, cellular.

 

For MG, I don't think there is anything yet.

 

If you are using the MG as an uplink for an MX, the above call gets you the traffic indirectly, though there'll be some underreporting as MG management traffic will not be in the MX numbers.

 

ksumann
Getting noticed

I know its possible for an appliance to get the data, but not for a MG.
Additionally traffic between the MX and the MG like ARP and DHCP will count, i guess.

sungod
Kind of a big deal

Yes, though ARP/DHCP shouldn't be much.

 

Having extra API endpoints for MG data (and other things) is a request that's been made, but I've not seen anything on early access yet.

 

I suggest submit a feedback message via Dashboard adding your voice, perhaps it will help increase the chance of us getting this 😀

ksumann
Getting noticed

Yes i will open a request for this.

 

Just one more question, do you have a working example? Or do you know which unit the API returns? The description says bytes, but the values i got from the API are roughly 10 times higher than that, what is presented on the page Organization -> Summary Report -> Select Network and last month.

 

 
Spoiler
res = dashboard.appliance.getNetworkApplianceUplinksUsageHistory(netid, t0="2024-08-01T00:00:00", t1="2024-08-31T23:59:59", resolution=86400) #resolution: daily
#print (res)
mSent = 0
mRecv = 0
for day in res:
    for interface in day['byInterface']:
        if interface['interface'] == 'wan1':
            mSent += int(interface['sent'])
            mRecv += int(interface['received'])

print(f"Sent: {mSent/1024/1024}, Recv: {mRecv/1024/1024}")
 


I'm aiming to get a usage over the past month, so i'm using usage history function. But the 10 times difference also appears your function.

sungod
Kind of a big deal

It should be bytes.

 

I linked the org-wide call as it's simpler, but have not used it for ages, TBH I also use...

https://developer.cisco.com/meraki/api-v1/get-network-appliance-uplinks-usage-history/

...as the time series data is more useful.

 

When setting up, I tested API figures with GB amounts of data going through lab devices, it matched reasonably well. I never bother looking at the UI data as it's not how we monitor/analyse, also see comment below. I may do another controlled test sometime as a check to see if anything odd is going on with API numbers.

 

I'm always wary of comparing Dashboard UI numbers with API numbers. Unless you know the timing and rules used by Dashboard exactly match what you do with the API, there's no reliable comparison. Also, I suspect some Dashboard values may be cached results from a periodic calculation, not gathered and calculated on the fly when the page is rendered.

 

ksumann
Getting noticed

Thanks for clarifying. I agree that there might be some inconsistencies depending on caches or the exact timespan used but i'm always have a difference by factor 10, no matter if i use "last month" in Dashboard and add daily numbers, or if i only use "last day".
Within a whole month, the exact timespan shouldn't matter that much.

sungod
Kind of a big deal

Can you validate numbers by putting a significant chunk of data through at a known time? A few large software images for instance. Then see how UI/API details compare.

 

Otherwise, I'd open a support case with exact details in case there's a problem.

Get notified when there are additional replies to this discussion.