web:speedtest
Speedtest
speedtest-cli
Установка в CentOS
# yum install python-pip # pip install speedtest-cli
Установка в Debian
# apt-get nstall python-pip # pip install speedtest-cli
Обновление
# pip install speedtest-cli --upgrade
Help
# speedtest-cli --help usage: speedtest-cli [-h] [--bytes] [--share] [--simple] [--list] [--server SERVER] [--mini MINI] [--source SOURCE] [--timeout TIMEOUT] [--secure] [--version] Command line interface for testing internet bandwidth using speedtest.net. -------------------------------------------------------------------------- https://github.com/sivel/speedtest-cli optional arguments: -h, --help show this help message and exit --bytes Display values in bytes instead of bits. Does not affect the image generated by --share --share Generate and provide a URL to the speedtest.net share results image --simple Suppress verbose output, only show basic information --list Display a list of speedtest.net servers sorted by distance --server SERVER Specify a server ID to test against --mini MINI URL of the Speedtest Mini server --source SOURCE Source IP address to bind to --timeout TIMEOUT HTTP timeout in seconds. Default 10 --secure Use HTTPS instead of HTTP when communicating with speedtest.net operated servers --version Show the version number and exit
Проверка
# speedtest-cli Testing from 2com (188.x.y.z)... Selecting best server based on latency... Hosted by VL-Telecom Ltd (Odintsovo) [12.90 km]: 6.25 ms Testing download speed........................................ Download: 189.45 Mbit/s Testing upload speed.................................................. Upload: 153.55 Mbit/s
Поделиться результатом, ключ −−share
[root@localhost ~]# speedtest-cli --share Retrieving speedtest.net configuration... Retrieving speedtest.net server list... Testing from 2com (188.x.y.z)... Selecting best server based on latency... Hosted by Beeline (Moscow) [15.29 km]: 6.665 ms Testing download speed........................................ Download: 190.77 Mbit/s Testing upload speed.................................................. Upload: 144.92 Mbit/s Share results: http://www.speedtest.net/result/4917045704.png
Вывести минимум инфы, ключ −−simple
# speedtest-cli --simple Ping: 6.166 ms Download: 193.04 Mbit/s Upload: 168.93 Mbit/s
Посмотреть доступные серверы в Москве
# speedtest-cli --list | grep Moscow 3682) Rostelecom (Moscow, Russian Federation) [15.44 km] 1907) MTS (Moscow, Russian Federation) [15.44 km] 6386) Megafon (Moscow, Russian Federation) [15.44 km] 4718) Beeline (Moscow, Russia) [15.44 km] 6325) OAO Transtelecom (Moscow, Russian Federation) [15.44 km] 6053) MaximaTelecom (Moscow, Russian Federation) [15.44 km] 4984) CLN (Moscow, Russian Federation) [15.44 km] 6827) MGTS (Moscow, Russian Federation) [15.44 km] 6985) CIFRA1 (Moscow, Russian Federation) [15.44 km] 4381) LLC "SouthNets" (Moscow, Russian Federation) [15.44 km] 5201) NK-NET (Moscow, Russia) [15.44 km] 4472) Dataline Ltd (Moscow, Russia) [15.44 km] 6562) Tele2 Russia (Moscow, Russian Federation) [15.44 km] 5581) Retn SJC (Moscow, Russian Federation) [15.44 km] 2322) RuTube (Moscow, Russian Federation) [15.44 km] 6307) AVK Komputer ltd. (Moscow, Russian Federation) [15.44 km] 5040) Alfa Net Telecom (Moscow, Russian Federation) [15.44 km] 5580) H1 LLC (Moscow, Russian Federation) [15.44 km] 7531) Net By Net Holding LLC (Moscow, Russian Federation) [15.44 km]
Посмотреть доступные серверы в России
# speedtest-cli --list | grep Russia
Возьмем для проверки сервер MIPT-Telecom, его код 874
# speedtest-cli --server 874
Если у вас есть свой Speedtest mini сервер, то можно указать для проверки и его
# speedtest-cli --mini http://speedtest.foobar.com
Автоматическое обновление Speedtest Mini на сервере
Самый простой вариант выглядит так
Добавляем в /etc/cron.monthly/speedtest.sh
#!/bin/sh rm /tmp/mini.zip curl --output /tmp/mini.zip http://c.speedtest.net/mini/mini.zip cd /tmp unzip mini.zip rm -rf /var/www/html/speedtest mv mini /var/www/html/speedtest mv /var/www/html/speedtest/index-php.html /var/www/html/speedtest/index.php
или так
#!/bin/bash cd /var/tmp/ wget http://c.speedtest.net/mini/mini.zip unzip -o mini.zip -d /var/www/speedtest.site.ru/ rm -f mini.zip
Варианты чуть посложнее
via https://gist.github.com/sparanoid/abb6e26d968accef9aa2
via http://www.purple.org.ua/speedtest-mini-auto-update/
via https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/speedtest-mini-update.sh
web/speedtest.txt · Последнее изменение: 2018/02/05 13:48 — 127.0.0.1
Обсуждение