speedtest_exporter icon indicating copy to clipboard operation
speedtest_exporter copied to clipboard

Specify which server to run speed tests against

Open dwillcocks opened this issue 3 years ago • 8 comments

Is your feature request related to a problem? Please describe. I would like to specify/pin which server the speed tests run against.

Describe the solution you'd like I should be able to provide a speedtest.net server ID as a command line flag when starting the exporter.

dwillcocks avatar May 02 '21 22:05 dwillcocks

Hi Daniel, just wondered if there was any timeline to implementing this?

SheriffOfNotts avatar Jun 06 '21 10:06 SheriffOfNotts

I have just added support to pick your own serverID.

dwillcocks avatar Jul 26 '21 19:07 dwillcocks

Thanks Daniel, that's brilliant. Please can you let me know where to config it - I can't find it. Also how do you find the relevant server id? I've looked and there are several lists, but Grantham isn't listed :(

SheriffOfNotts avatar Jul 26 '21 21:07 SheriffOfNotts

I used this endpoint, and Grantham is on it: https://www.speedtest.net/speedtest-servers-static.php

Grantham ID is: 31464

You can now set the server ID with command line argument -server_id and if you want it to fallback to the closest server if you chosen one is not available then -server_fallback

To use this in the Starlink monitoring setup (https://github.com/danopstech/starlink) you need to override the speedtest_exporter entrypoint by editing the docker-compose.yaml file:

  speedtest_exporter:
    image: "ghcr.io/danopstech/speedtest_exporter:latest"
+   entrypoint: ["/speedtest_exporter", "-server_id", "31464"]
    restart: always
    ports:
      - "9092:9090"

If you also want to fall back to any server if your chosen one is not available then the extra line will look like this:

  speedtest_exporter:
    image: "ghcr.io/danopstech/speedtest_exporter:latest"
+   entrypoint: ["/speedtest_exporter", "-server_id", "31464", "-server_fallback"]
    restart: always
    ports:
      - "9092:9090"

For the new entrypoint to take effect:

docker compose down && docker-compose pull && docker-compose up --remove-orphan

dwillcocks avatar Jul 27 '21 08:07 dwillcocks

Thanks Dan, it seems to be working, defers to my backup server - I’ll double check the config. Out of interest does your location correct - it seems to think I am in London..

On 27 Jul 2021, at 09:54, Daniel Willcocks @.***> wrote:

I used this endpoint, and Grantham is on it: https://www.speedtest.net/speedtest-servers-static.php https://www.speedtest.net/speedtest-servers-static.php Grantham ID is: 31464

You can now set the server ID with command line argument -server_id and if you want it to fallback to the closest server if you chosen one is not available then -server_fallback

To use this in the Starlink monitoring setup (https://github.com/danopstech/starlink https://github.com/danopstech/starlink) you need to override the speedtest_exporter entrypoint by editing the docker-compose.yaml file:

speedtest_exporter: image: "ghcr.io/danopstech/speedtest_exporter:latest"

  • entrypoint: ["/speedtest_exporter", "-server_id", "31464"] restart: always ports:
    • "9092:9090" If you also want to fall back to any server if your chosen one is not available then the extra line will look like this:

speedtest_exporter: image: "ghcr.io/danopstech/speedtest_exporter:latest"

  • entrypoint: ["/speedtest_exporter", "-server_id", "31464", "-server_fallback"] restart: always ports:
    • "9092:9090" For the new entrypoint to take effect:

docker compose down && docker-compose pull && docker-compose up --remove-orphan — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danopstech/speedtest_exporter/issues/3#issuecomment-887335064, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4QIC4YTVD64UOPHSADGVTTZZX3XANCNFSM4372LOYQ.

SheriffOfNotts avatar Jul 27 '21 10:07 SheriffOfNotts

Hi,

thanks for developing this exporter.

I am having difficulties to specify a server by ID via the command line https://www.speedtest.net/speedtest-servers-static.php only returns 10 servers for me at the moment, none of which are geographically close and none of which matches my desired server. So the exporter regularly chooses a random server as a fallback instead of the one I specified via the command line (as I specified -server_fallback).

Any ideas?

Thanks, Thilo

ginkel avatar Oct 01 '21 20:10 ginkel

Hello,

same here. Using this URL https://www.speedtest.net/speedtest-servers-static.php I obtain 10 servers, none of which are geographically close. When I choose one of them e.g. 28479 I receive this error: "could not find your choosen server ID 28479 in the list of available servers, server_fallback is not set so failing this test" (I do not specify "-server_fallback").

But the server is alive and returns "OoklaServer It worked!" to the web browser (Chrome). It seems, that my given server ID is compared to the server list returned by https://www.speedtest.net/speedtest-servers-static.php webpage. This webpage does not return the closest servers. My location is correct based on the webpage: https://www.speedtest.net/speedtest-config.php

When I specify "-server_fallback", exporter chooses server ID 30315 which is 638km away. And speedtest_exporter works.

Then, I use exporter with ID 30315 but without "-server_fallback" and exporter returns error: "could not find your choosen server ID 30315 in the list of avaiable servers, server_fallback is not set so failing this test"

Any ideas?

Thanks, Milan

fanek007 avatar Dec 01 '21 17:12 fanek007

Hello,

I live in Prague / Czech Republic and found out, that nearest servers I get, when I use this URL: https://c.speedtest.net/speedtest-servers-static.php

It must be HTTPS. Whet I use HTTP protocol (http://c.speedtest.net/speedtest-servers-static.php), I get some mix of Czech servers all around the whole Czech Republic and Polish servers.

When I use https://www.speedtest.net/speedtest-servers-static.php, I get mostly Polish servers.

It seems, that the preferred URL is: https://c.speedtest.net/speedtest-servers-static.php

This still does not solve the issue, that I'm unable to use any server, which is not in response from any mentioned URL / speedtest-servers-static.php. Sometimes, even when I use ID which is in the response of the servers-static.php, exporter doesn't use it as I described in my previous post.

Edit: The text above was true 10 hours ago ... just now, I get all Czech servers via https://www.speedtest.net/speedtest-servers-static.php. The rest returns Polish servers only :-(

Thanks Milan

fanek007 avatar Dec 02 '21 08:12 fanek007