運維之道 | CentOS 使用Linux命令行工具 SPEEDTEST 測試網速/帶寬

前言

speedtest-cli是一個用Python編寫的輕量級Linux命令行工具,在Python2.4至3.4版本下均可運行。它基於Speedtest.net的基礎架構來測量網絡的上/下行速率。安裝speedtest-cli很簡單——只需要下載其Python腳本文件。

SPEEDTEST®CLI官網

1、獲取repo源
[root@localhost src]# wget https://bintray.com/ookla/rhel/rpm -O bintray-ookla-rhel.repo
[root@localhost src]# mv bintray-ookla-rhel.repo /etc/yum.repos.d/
2、安裝 SPEEDTEST 工具
[root@localhost src]# yum install -y speedtest
3、測試主機帶寬速度
[root@localhost ~]# speedtest 					///測試帶寬命令

   Speedtest by Ookla

     Server: ChinaTelecom 5G - Guangzhou (id = 27594)
        ISP: China Telecom
    Latency:    11.29 ms   (0.65 ms jitter)
   Download:    10.15 Mbps (data used: 16.4 MB)                               
     Upload:    37.46 Mbps (data used: 60.9 MB)                               
Packet Loss:     0.0%
 Result URL: https://www.speedtest.net/result/c/9bc290da-c3c2-406b-8dcf-4b25baef2af3

用法: speedtest (<選項>)

  -h, --help                        Print usage information
  -V, --version                     Print version number
  -L, --servers                     List nearest servers
  -s, --server-id=#                 Specify a server from the server list using its id
  -I, --interface=ARG               Attempt to bind to the specified interface when connecting to servers
  -i, --ip=ARG                      Attempt to bind to the specified IP address when connecting to servers
  -o, --host=ARG                    Specify a server, from the server list, using its host's fully qualified domain name
  -p, --progress=yes|no             Enable or disable progress bar (Note: only available for 'human-readable'
                                    or 'json' and defaults to yes when interactive)
  -P, --precision=#                 Number of decimals to use (0-8, default=2)
  -f, --format=ARG                  Output format (see below for valid formats)
  -u, --unit[=ARG]                  Output unit for displaying speeds (Note: this is only applicable
                                    for ‘human-readable’ output format and the default unit is Mbps)
  -a                                Shortcut for [-u auto-decimal-bits]
  -A                                Shortcut for [-u auto-decimal-bytes]
  -b                                Shortcut for [-u auto-binary-bits]
  -B                                Shortcut for [-u auto-binary-bytes]
      --selection-details           Show server selection details
      --ca-certificate=ARG          CA Certificate bundle path
  -v                                Logging verbosity. Specify multiple times for higher verbosity
      --output-header               Show output header for CSV and TSV formats
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章