How To Install Speedtest-cli On a CentOS / RHEL

0
709

Speedtest-cli

Speedtest-cli Tool is used to check internet connection speed. In this article, we will be known the installation of speed test server in Our machine.
The speed test-CLI is a python based script package. so before we going to install speed test-CLI, we must install python first.

#yum install python      for centos/RHEL
#dnf install python      for fedora

Saple Output:

python-sample-output

Now Download speedtest-cli by using wget command as follows

#wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py

Sample output:

[root@localhost ~]# wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py
--2016-09-20 01:16:34--  https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py
Resolving raw. githubusercontent. com (raw. githubusercontent. com)... 151.101.100.133
Connecting to raw. githubusercontent. com (raw. githubusercontent. com)|151.101.100.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24994 (24K) [text/plain]
Saving to: ‘speed test-cli’

100%[============================================================================================>] 24,994       111KB/s   in 0.2s

2016-09-20 01:16:36 (111 KB/s) - ‘speedtest-cli’ saved [24994/24994]

[root@localhost ~]#

Now change the permission by using chmod command as follows

#chmod +x speedtest-cli

Now test the internet speed by using the following command in your terminal

#./speedtest-cli
[root@localhost ~]# ./speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from BSNL (117.211.25.87)...
Selecting best server based on latency...
Hosted by ACCESS SMART Solutions (Vijayawada) [0.57 km]: 29.872 ms
Testing download speed........................................
Download: 1.99 Mbit/s
Testing upload speed..................................................
Upload: 19.18 Mbit/s
[root@localhost ~]#

If we want to see the result values in bytes we use –bytes option as follows

# ./speedtest-cli --bytes

Sample Output:

[root@localhost ~]#  ./speedtest-cli --bytes
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from BSNL (117.211.25.87)...
Selecting best server based on latency...
Hosted by ACCESS SMART Solutions (Vijayawada) [0.57 km]: 24.486 ms
Testing download speed........................................
Download: 0.16 Mbyte/s
Testing upload speed..................................................
Upload: 2.73 Mbyte/s
[root@localhost ~]#

To specify server against the Testing

If we want to specify the server id, first we must grab all the existing server list by using the following command as follows

 #wget http://www.speedtest.net/speedtest-servers.php

Sample Output:

speedtest-cli-server-list

Now select the server id from the list and pass as option when the time of testing as follows

vijayawada-city-list

[root@localhost ~]# ./speedtest-cli --server 8702
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from BSNL (117.211.25.87)...
Hosted by ACCESS SMART Solutions (Vijayawada) [0.57 km]: 25.148 ms
Testing download speed........................................
Download: 3.43 Mbit/s
Testing upload speed..................................................
Upload: 19.40 Mbit/s
[root@localhost ~]#

Now Enjoy speed test-CLI in your machine.