speedtest-cli how to
Hi guys,
I've downloaded speedtest-cli to
and marked it as executable like this:
But when I run
it doesn't seem to want to give me any results:
Maybe it has something to do with firewall? Any suggestions would be much appreciated! Thanks,
/usr/local/src
and marked it as executable like this:
$ wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
$ chmod +x speedtest-cli
# ls -la
-rwxr-xr-x. speedtest-cli
But when I run
./speedtest-cli
it doesn't seem to want to give me any results:
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by School District of Philadelphia (Philadelphia, PA) [1971.67 km]: 1800000.0 ms
Testing download speed................................................................................
Download: 0.00 Mbit/s
Testing upload speed................................................................................................
Upload: 0.00 Mbit/s
Maybe it has something to do with firewall? Any suggestions would be much appreciated! Thanks,
-
Hey there! Attempting to disable the firewall is a good idea, as that can be done temporarily while you perform the test. I do also need to point out that this wouldn't be related to the cPanel software on the machine. If this is a Ubuntu system, you may need some additional packages for that tool to work properly: 0 -
@cPRex, thanks for looking into this for me! If this is a Ubuntu system, you may need some additional packages for that tool to work properly:
Sorry, forgot to mention it's running CentOS 7Hey there! Attempting to disable the firewall is a good idea
Thanks! Disabled the firewall incsf - ConfigServer Firewall
and speedtest worked, looks like firewall was blocking it somehow.I do also need to point out that this wouldn't be related to the cPanel software on the machine.
Yes, sorry about that, since this server is only used for WHM/Cpanel I just default to coming here when there is an issue. I guess I figured it must have been the firewall settings in WHM that was blocking it. Maybe I should go over to ConfigServer forums for this?0 -
So in testing I found that in CSF Firewall Configuration the Allow outgoing TCP ports
is limited to certain ports. When I checked the logs/var/logs/messages
when attempting to runspeedtest-cli
I found it was using random source ports in the upper 55000 range. So I guess that explains the issue. So for future reference, instead of disabling the firewall for the test, a person could temporarily add all outgoing ports:TCP_OUT=1:65535 UDP_OUT=1:65535
toConfigServer Security & Firewall - csf - Firewall Configuration - IPv4 Port Settings - TCP_OUT and UDP_OUT
Then just remember to remove the ports you added from the firewall configuration when done testing.0 -
I'm glad you were able to track that down! 0 -
So in testing I found that in CSF Firewall Configuration the
Allow outgoing TCP ports
is limited to certain ports. When I checked the logs/var/logs/messages
when attempting to runspeedtest-cli
I found it was using random source ports in the upper 55000 range. So I guess that explains the issue. So for future reference, instead of disabling the firewall for the test, a person could temporarily add all outgoing ports:TCP_OUT=1:65535 UDP_OUT=1:65535
toConfigServer Security & Firewall - csf - Firewall Configuration - IPv4 Port Settings - TCP_OUT and UDP_OUT
Then just remember to remove the ports you added from the firewall configuration when done testing.
as per the speedtest website: ports 8080 or 5060 need to be open in /out in firewall [to run test run the commands below] speedtest cli ( this will choose an automatic location for you and run the test) speedtest cli --servers ( this will give you a list of server you can choose from to run your test) speedtest cli --server-id=10723 ( this will run a test on this selected server ) here is xml page with server ID's I found online. This will get you a list of servers - ID's close to your location0 -
my servers test results PING ms 2 DOWNLOAD Mbps 9301.83 UPLOAD Mbps 8698.72
First of all, WOW, I've never even seen a 10gig connection before, So Jealous! lol, If you ever need anyone to play on your network let me know! :cool: I'm supposed to be on a 1 gig server, but I guess it's just a busy farm here because my best results so far have been: Download: 530.73 Upload: 352.18as per the speedtest website: ports 8080 or 5060 need to be open in /out in firewall
You are awesome! I did see those ports were required on speedtest-cli from github, and I didn't install anything, just downloaded the python script and marked it executable. So Thank you so much @Spirogg for all that information!!0 -
If you ever need anyone to play on your network let me know! :cool:
Thanks and sure why not. Lol I"m glad it helps and thanks for your info as well ;)So For me the command for listing servers was
speedtest-cli --list
, and to run on selected server wasspeedtest-cli --server 'id'
but that could be different because I used the version of0 -
Thanks and sure why not. Lol
Nice! Tried to PM you but doesn't look like it's allowed on your account. Was going to ask about that 10g network and also about xenspec.0 -
Nice! Tried to PM you but doesn't look like it's allowed on your account. Was going to ask about that 10g network and also about xenspec.
I just turn on in privacy settings to allow PM but I tried to send you one and did not work either in privacy settings says ( start conversations with you I tried followers and now tried members only. and still could not send to you a PM. so maybe on your end you have to make this change as well? or the forum is not working right -05-07 at 12.30.30 AM.png">777530 -
Update on installing speedtest.net speedtest on Almalinux - not from yum or dnf first go to speedtest.net/apps/cli
then at bottom of the page you will see Download for Linux in the dropdown findX86_64
andright mouse click on the downloadable file to copy the link only
next login to WHM terminal andmkdir speedtest
thencd /speedtest
then type:wget https://install.speedtest.net/app/cli/ookla-speedtest-1.1.1-linux-x86_64.tgz
( this is the file you right moused click to copy the url. you can paste it after wget ) thentar -xvzf ookla-speedtest-1.1.1-linux-x86_64.tgz
- ( just fyi dir or ls while in speedtest directory you created to see the correct file name to use incase the file gets updated ) thenchmod +x speedtest
thenmv speedtest /usr/bin
last type:speedtest
to run the test. that's it!! as mentioned earlier [per the speedtest,net website]ports 8080 or 5060
need to be open in /out in firewall [to run test run the commands below]speedtest
( this will choose an automatic location for you and run the test)speedtest --servers
( this will give you a list of server you can choose from to run your test)speedtest --server-id=10723
( this will run a test on this selected server ) * (10723 is an example of the server id number from the --servers list you got runningspeedtest --servers
) here is xml page with server ID's I found online. This will get you a list of server ID's close to your location.0 -
Excellent instructions! Thanks for sharing. I verified this does work on my system as well. Just one note: ports 8080 or 5060
need to be open in /out in firewall
I only had to allow the ports outbound, opening inbound ports is generally not required unless you're going to host a speedtest server, but just for testing speeds you should only need outbound ports open in csf.0
Please sign in to leave a comment.
Comments
11 comments