+5 votes
701 views
Check internet speed with Speedtest-cli test in CentOS 7

in Linux / Unix by (551k points)
reopened | 701 views

1 Answer

+3 votes
Best answer

1. How to install Python on CentOS 7 Linux
2. How to install Speedtest-cli on CentOS 7 Linux
3. How to check Internet speed in CentOS 7 Linux
4. How to obtain a server ID to validate CentOS 7 Linux

Currently, Internet providers, or ISP (Internet Service Provider), offer us different speeds based on the type of task to be performed, this is vital since a high speed will be a guarantee that our navigation will be smooth and the entire loading process and download will be within expectations without affecting productivity or taking extra time..

A useful tool to check the internet speed in real time is Speedtest-cli, which can be used to verify the loading and unloading speed on the server and it uses a command line interface to perform this task in a way very simple, in the same way, Speedtest-cli is able to test the network speed of our server.

Through this tutorial we will learn to install Speedtest-cli on CentOS 7..


1. How to install Python on CentOS 7 Linux

Step 1

Speedtest-cli requires Python for optimal execution, before that, we can access as root users by running the following:
 sudo su 
Step 2

Subsequently, we will run the following line to install Python on CentOS 7:
 yum install Python 

image

Enter the letter and to accept the download and installation of Python.


2. How to install Speedtest-cli on CentOS 7 Linux

Step 1

Now, we will go to the directory / usr / local / src which will be the path where we have to download the utility:
 cd / usr / local / src 
Then we will download the Python script associated with Speedtest-cli by running the following:
 wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py 

image

Step 2

We assign the respective permissions:
 chmod + x speedtest-cli 

image


3. How to check Internet speed in CentOS 7 Linux

Step 1

The next step is to perform the respective Internet tests, the most basic is to run any of the following options:
 ./speedtest-cli python speedtest-cli 
This will be the result obtained:

image

There we can see details such as:

  • Source server
  • ISP provider
  • Ping Time
  • Upload and download speed
Step 2

If we want to see this result in bytes, we will execute the following:
 ./speedtest-cli –bytes 

image

Step 3

Now, another of the options available for Speedtest-cli is to obtain this result graphically, for this we can execute the following line which provides us with a web link to verify said result:
 ./speedtest-cli –share 

image

Step 4

With this result, we can go to the link from any browser and this will be the result we will see:

image


4. How to obtain a server ID to validate CentOS 7 Linux

Step 1

It is possible that for some reason we want to obtain the ID of the available servers, for this, first, we will execute the following line:
 wget http://www.speedtest.net/speedtest-servers.php 

image

Step 2

To observe the IDs of the servers we will execute the following line:
 more speedtest-servers.php 

image

Step 3

To know a specific ID we can use one of the following options:
 grep 'city' speedtest-servers.php grep 'country' speedtest-servers.php grep 'city, state' speedtest-servers.php 
For example, we can run the following to see all servers in Spain:
 grep 'Spain' speedtest-servers.php 

image

Step 4

To see a specific ID, including city and state, we can execute the following:
 grep 'Tampa, FL' speedtest-servers.php | egrep -o 'id = "[0-9] {4}"' 
This will result in the IDs of the servers in that region and with those IDs, we will execute the following to perform the speed test:
 ./speedtest-cli –server “ID” 

image

Step 5

The general Speedtest-cli options are as follows:
Display the help of the utility
 -h, --help 

Do not run the download test
 --no-download 

Do not run the load test
 --no-upload 

Displays the value in bytes instead of bits
 --bytes 

Generate and offer a speedtest.net URL with the image of the results
 --Compartir 

Suppress detailed output, only show basic information
 --simple 

Suppress detailed output, only show basic information in CSV format
 --csv 
Single character delimiter for use in CSV output
 --csv-delimiter 

Print CSV headers
 --csv-header 

Suppress detailed output, only show basic information in JSON format
 --json 

Display a list of speedtest.net servers sorted by distance
 --list 

Allows you to specify a server for validation
 --server 

Excludes a server from the selection
 --exclude EXCLUDE 

Generate a MINI URL of the Mini Speedtest server
 --mini 

Refers to the source IP address
 --source SOURCE 

It is the timeout in seconds, its default value is 10 seconds
 --timeout TIMEOUT 

It makes use of the HTTPS protocol instead of HTTP when communicating with servers operated by speedtest.net
 --secure 

Does not pre-assign load data in order to improve performance
 --no-pre-allocate 

Display the current version of Speedtest-cli
 --version 

With this practical tool it will be possible to keep a detailed control of the network speed, both up and down, for support, control or guarantee tasks..


by (3.5m points)
edited

Related questions

+5 votes
1 answer
asked Jul 2, 2020 in Linux / Unix by backtothefuture (551k points) | 355 views
+5 votes
1 answer
+5 votes
1 answer
asked Jun 2, 2021 in Help by backtothefuture (551k points) | 82 views
+3 votes
1 answer
+4 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback
10,632 questions
10,764 answers
510 comments
3 users