Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify which server to run speed tests against #3

Open
dwillcocks opened this issue May 2, 2021 · 8 comments
Open

Specify which server to run speed tests against #3

dwillcocks opened this issue May 2, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@dwillcocks
Copy link
Member

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 dwillcocks added the enhancement New feature or request label May 2, 2021
@dwillcocks dwillcocks self-assigned this May 2, 2021
@SheriffOfNotts
Copy link

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

@dwillcocks
Copy link
Member Author

I have just added support to pick your own serverID.

@SheriffOfNotts
Copy link

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 :(

@dwillcocks
Copy link
Member Author

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

@SheriffOfNotts
Copy link

SheriffOfNotts commented Jul 27, 2021 via email

@ginkel
Copy link

ginkel commented Oct 1, 2021

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

@fanek007
Copy link

fanek007 commented Dec 1, 2021

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
Copy link

fanek007 commented Dec 2, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

4 participants