Speedtest Option


Recommended Posts

It would be nice if we had a way to invoke a speedtest and record the data pulled down.  This could easily be done using a powershell script and a datasource but I'm still fairly new to logicmonitor so creating a data source isn't really something I'm good or comfortable with.

  • Upvote 2
Link to post
Share on other sites
  • LogicMonitor Staff

I just published a really simple PowerShell DataSource - SpeedTest - that downloads a file from Akamai and measures the time it took to download. I think I'm getting accurate data in my lab but you'll want to test this, of course. Mike might have something better so we'll see what he adds, but in the meantime, check it out... (you'll need to update the AppliesTo field - such as a Windows collector for best chances of success.)

Locator code for "WAN Speed Test" is YTFWWC

Link to post
Share on other sites

I'm getting this error when I try to import this datasource: 

"503 : This LogicModule is currently undergoing security review. It will be available for import only after our engineers have validated the scripted elements."

Is there an ETA on when this will be available for import? I'd like to test it out. Thanks.

Link to post
Share on other sites
On 11/8/2017 at 9:32 AM, Kerry DeVilbiss said:

I just published a really simple PowerShell DataSource - SpeedTest - that downloads a file from Akamai and measures the time it took to download. I think I'm getting accurate data in my lab but you'll want to test this, of course. Mike might have something better so we'll see what he adds, but in the meantime, check it out... (you'll need to update the AppliesTo field - such as a Windows collector for best chances of success.)

Locator code for "WAN Speed Test" is YTFWWC

 

I'm getting this error when I try to import this datasource: 

"503 : This LogicModule is currently undergoing security review. It will be available for import only after our engineers have validated the scripted elements."

Is there an ETA on when this will be available for import? I'd like to test it out. Thanks.

 

(excuse my double post)

Edited by AnthonyH
Adding a quote
Link to post
Share on other sites
  • 2 months later...

Looks like I might be late to the party... but I also built a speed test that uses Akamai to see how long it takes to download the 10Mb file.

WALDXL - Download Speed

This datasource will run a PowerShell script that downloads a 10MB file and then figures out the speed in Mbps that it was downloaded. 

CAUTION: This datasource will download a 10Mb file for every Windows machine specified in the applies to field(default is not applied),every poll(deafult is 20 minutes), depending on your environment this could raise the price for your monthly ISP bill. Specifically, if your ISP speeds ramp up when needed.

I would recommend applying this to: hasCategory("speed") and isWindows()

Then, of course, you just need to add the system.property of speed to any Windows machine you want to monitor Download Speed on.

image.png

Link to post
Share on other sites
  • 4 months later...

One thing to note about datasource YTFWWC  is the calculation, which seems to be wrong.

It downloads a 50MB, then it divides how long it took to download (in seconds) by 100 and then it multiplies it by 8 (to convert from MB to mbps)

I think this division should be 50 instead of 100.

 

 

Link to post
Share on other sites
  • 9 months later...

I just found this while trying to see what options we had for this capability.  What I originally hoped to do was to deploy the speedtest CLI package and run in JSON output mode to get proper up/down results (which I may still do at some point).  For the moment this works, if you fix that math error :).  I also changed the applies to expression to "run.speedtest" so I can choose specifically which hosts are involved -- normally would be a site collector, but might not if a site is only monitored remotely.  To get similar location flexibility with the speedtest CLI method would be tricky.

Link to post
Share on other sites
1 hour ago, mnagel said:

I just found this while trying to see what options we had for this capability.  What I originally hoped to do was to deploy the speedtest CLI package and run in JSON output mode to get proper up/down results (which I may still do at some point).  For the moment this works, if you fix that math error :).  I also changed the applies to expression to "run.speedtest" so I can choose specifically which hosts are involved -- normally would be a site collector, but might not if a site is only monitored remotely.  To get similar location flexibility with the speedtest CLI method would be tricky.

I misread the code -- it does not use PSRemoting, so it can only run from a collector.  Will have to see if I can fix that :).

Link to post
Share on other sites

I found some even more promising options:

I was able to make the first one work with barely any changes, but the results are not accurate.  The second one needs to be tortured a bit to make it suitable since emits live status data, but again, running it from the CLI it is not accurate.  The only CLI option I have found that is accurate is speedtest-cli (Python).  Looking at both the above to see how hard they would be to rewrite into Groovy and make accurate.

My current iteration of the original code is below (for now), but this method is also not very accurate.  It relies on two properties, one optional:

speedtest.run: set to 1 (or anything) for hosts that should run the code (may instead use manual instances to enable multiple test sources).
speedtest.testmy.mirror: shortname of the testmy.net mirror (e.g., lax, ny, etc.).  if not provided, will use default mirror selection.

$size = 50;
$mirror = "##speedtest.testmy.mirror##";
if ($site -eq "") {
    $url = "https://testmy.net/dl-${size}MB"
}
else {
    $url = "https://${mirror}.testmy.net/dl-${size}MB"
}
$path = "Out-Null"
$WebClient = New-Object System.Net.WebClient 
$mbps = "{0:N2}" -f (($size/(Measure-Command {$Request=Get-Date; $WebClient.DownloadFile( $url, $path )}).TotalSeconds) * 8)
Write-Host "Mbps="$mbps

 

Link to post
Share on other sites
  • 1 year later...

Yeah,  I have that working, at least from Linux collectors (with puppet ensuring package deployed).  Not ideal and not terribly accurate.  I checked again just now for better options and found https://speedof.me/api.html; trying that to see how well it may work. Not free, but not terribly costly either.

 

Link to post
Share on other sites
Just now, Stuart Weenig said:

Wouldn't this be similar to just running an external web check in LM, but with more metrics?

The problem with most of the web-only options is the upload speed test is either nonexistent or very inaccurate. The speedtest-cli client is not supported and does not use the same protocols normally used by Ookla tests.  I have not tried the SpeedOfMe API yet, so not sure if it is better or worse, but would hope they account for running it similarly to interactive conditions.  I also just found Ookla now has a supported CLI option, which looks hopeful.  Seems like it needs a license for commercial use, though.  https://www.speedtest.net/apps/cli

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.