1、脚本地址 https://github.com/sivel/speedtest-cli
2、上脚本,自己看,so easy
[root@glusterfs-server01 ~]# yum -y install git
…………
此处省略 git 安装过程中的输出
…………
[root@glusterfs-server01 shy]# mkdir git
[root@glusterfs-server01 shy]# cd git/
[root@glusterfs-server01 git]# git clone https://github.com/sivel/speedtest-cli.git
Cloning into 'speedtest-cli'...
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 1110 (delta 18), reused 20 (delta 9), pack-reused 1080
Receiving objects: 100% (1110/1110), 312.73 KiB | 36.00 KiB/s, done.
Resolving deltas: 100% (650/650), done.
[root@glusterfs-server01 git]# cd speedtest-cli/
[root@glusterfs-server01 speedtest-cli]# ll
total 108
-rw-r--r-- 1 root root 1671 Mar 6 18:01 CONTRIBUTING.md
-rw-r--r-- 1 root root 11358 Mar 6 18:01 LICENSE
-rw-r--r-- 1 root root 35 Mar 6 18:01 MANIFEST.in
-rw-r--r-- 1 root root 5450 Mar 6 18:01 README.rst
-rw-r--r-- 1 root root 20 Mar 6 18:01 setup.cfg
-rw-r--r-- 1 root root 3277 Mar 6 18:01 setup.py
-rw-r--r-- 1 root root 2923 Mar 6 18:01 speedtest-cli.1
-rwxr-xr-x 1 root root 61423 Mar 6 18:01 speedtest.py
drwxr-xr-x 3 root root 4096 Mar 6 18:01 tests
-rw-r--r-- 1 root root 497 Mar 6 18:01 tox.ini
-----------------下面执行脚本进行3次网速测试-----------------
[root@glusterfs-server01 speedtest-cli]# python speedtest.py
Retrieving speedtest.net configuration...
Testing from China Unicom Liaoning (211.xxx.xxx.xxx 这是我的IP地址)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by China Telecom ZheJiang Branch (Hangzhou) [4.91 km]: 10.138 ms
Testing download speed................................................................................
Download: 144.67 Mbit/s
Testing upload speed................................................................................................
Upload: 133.65 Mbit/s
[root@glusterfs-server01 speedtest-cli]# python speedtest.py
Retrieving speedtest.net configuration...
Testing from China Unicom Liaoning (211.xxx.xxx.xxx 这是我的IP地址)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Hangzhou , Zhejiang Unicom (Hangzhou) [4.91 km]: 12.66 ms
Testing download speed................................................................................
Download: 126.66 Mbit/s
Testing upload speed................................................................................................
Upload: 208.55 Mbit/s
[root@glusterfs-server01 speedtest-cli]# python speedtest.py
Retrieving speedtest.net configuration...
Testing from China Unicom Liaoning (211.xxx.xxx.xxx 这是我的IP地址)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by China Telecom ZheJiang Branch (Hangzhou) [4.91 km]: 12.647 ms
Testing download speed................................................................................
Download: 127.26 Mbit/s
Testing upload speed................................................................................................
Upload: 158.29 Mbit/s
[root@glusterfs-server01 speedtest-cli]#
(结束)