cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
14451
Views
2
Helpful
14
Replies

SpeedTest via API

AutomationDude
Level 5
Level 5

Hello guys,

Trying to solve a a problem that shouldn't be solved with APIs by using APIs. Was wondering if you have any input.

I have a customer that wants to be alerted every time any of their networks (all with different ISPs) goes to an extremely low download speed below a certain threshold. There is the internal dashboard tool to view speed and of course speed test websites, but there isn't a direct API endpoint for speed.

I am going to try to use this one to infer if the speed is too slow however:

https://developer.cisco.com/meraki/api-latest/#!get-device-live-tools-ping

Is this a reasonable approach? Let me know if anything else comes to mind 🙂

14 Replies 14

sungod
Level 11
Level 11

Might be worth trying...

https://developer.cisco.com/meraki/api-latest/#!get-organization-devices-uplinks-loss-and-latency

...it'll give you the loss+latency for a defined period for all MX devices in one go.

Run it every few minutes and look for increases vs. previous few samples or exceeding some learned/fixed thresholds.

RomanMD
Level 6
Level 6

Hi,

while this make sense as a request, Meraki says not to rely on the Dashboard Speed test, since it is there just for having some idea, not for really getting correct figures.

This task has to be accomplished by installing a test-point in the network which will do this.That way you not only test the Internet line itself, but also the devices in between... Cisco has this feature with Thousand Eyes and there are rumours that Thousand Eyes will have a "Meraki" version...

On the other hand, read here: https://community.meraki.com/t5/API-Early-Access-Discussions/SpeedTest-Endpoint-not-working-as-expected/m-p/147120#M535

Raphael_L
Meraki Community All-Star
Meraki Community All-Star

There is an endpoint but it is only available if you have inSight ( with the licence ).

{0}/devices/{1}/liveTools/speedTest?interface=wan1

Somehow , I can't find it in the openApispec nor the documentation.... It might have been renamed or removed.

Raphael_L
Meraki Community All-Star
Meraki Community All-Star

image.png

It is probably in Beta , and you can only get the download speed not the upload speed...

I have written a simple application not using any API to download and upload a file and calculate download/uploads speeds.

matt_uc
Level 6
Level 6

How often should this be tested for? What destinations should be tested to (per-site)? Are they aware that each speed test is potentially interfering with their own traffic? What is an "acceptable" threshold of speed? This is the sort of thing that really needs in-depth requirements and a lengthy caveat that if they test too often, they are only hurting themselves more by doing so..

Insight has a way to do API speedtests but I've not yet played with it too much. Having Insight monitor their key applications might be more helpful.

AutomationDude
Level 5
Level 5

Thank you all for your input, gonna take this to the drawing board.

Crocker
Level 6
Level 6

Any chance you control a server/workstation on both ends of the link? Could look at iPerf testing between them. It's a little rough, but you can script around the iPerf3.exe to automate testing and log results per site.

I am trying to run a speed test using API. Do you know where to find the device ID of the MX ?
I am new to this. Apricate your help
import requests


payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {{apiKey}}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Fire a query at /organizations/{{orgid}}/devices

That'll return a listing of all the devices owned by the org, their names, serial #'s, mac addresses, and a bunch of other info.

Edit: Org, not Orc. This isn't Lord of the Rings.

yohannesa7
Frequent Visitor
Frequent Visitor

Thank you so much , Crocker, for your quick help on this . I apricate it . I was able to run the query you suggested.

I hope this is the one for the device ID .

image.png

Now , I am using the serial number of the MX and the device ID as shown bellow, but I am getting 404 error code

url = "https://api.meraki.com/api/v1/devices/Q3KY-XXXX-XXXX/liveTools/speedTest/2345543333"

Create Device Live Tools Speed Test - Meraki Dashboard API v1 - Cisco Meraki Developer Hub

I think you need to read the speedtest endpoint documentation a bit more closely. To actually perform the speedtest you need to POST @ /devices/{{serial}}/liveTools/speedTest. This will perform the test, and return the results. Those results then get stored (tracked by a unique ID).

The query you have above is the query to retrieve the results of a previously run speedtest.

Edit: And note that this endpoint appears to only be available if you have the Early Access API enabled

yohannesa7
Frequent Visitor
Frequent Visitor

Thank you so much for your help. I am on the right track now .

Have a nice weekend

khanasim781
Community Member

Hey Yoni, did you make any progress on this?

im getting a

status": "new",
"results": null
when i run :
/devices/:serial/liveTools/speedTest?interface=wan1