Speedtest CLI. Run speedtest on pfSense box
-
Does anyone have the speedtest.py still? I can't seem to find it.
-
@lastb0isct Have you tried...
# pkg search speedtest # pkg install py27-speedtest-cli
if
pkg
gives you aShared object "libcryptoauth.so.3" not found, required by "pkg"
error, try# pkg-static install py27-speedtest-cli
-
@lastb0isct said in Speedtest CLI. Run speedtest on pfSense box:
Does anyone have the speedtest.py still? I can't seem to find it.
It comes with the package when you install it. SSH to your box and run:
pkg search speedtest [2.4.4-RELEASE][root@fw.workgroup]/root: pkg search speedtest py37-speedtest-cli-2.1.1 Command line interface for testing internet bandwidth
Then run
pkg install py37-speedtest-cli-2.1.1
Have fun!
-
Where does the speedtest.py live after installation?
-
@lastb0isct said in Speedtest CLI. Run speedtest on pfSense box:
Where does the speedtest.py live after installation?
/usr/local/lib/python3.7/site-packages
-
Run
pkg search speedtest
py37-speedtest-cli-2.1.1 Command line interface for testing internet bandwidth
We can now see the package we need to install
pkg install py37-speedtest-cli-2.1.1
then run with
/usr/local/bin/speedtest
-
I've created a widget to run speedtest directly from your pfSense dashboard
https://github.com/aln-1/pfsense-speedtest-widget -
@aln Hey, it works! Nice job! :)
-
Pretty slick.. Nice work..
Not really a fan of running speedtest on pfsense itself, its always better to do them "thru" pfsense (from a client behind).. But yeah could see how it could come in handy for some.
Allowing for some settings, like picking server, etc.. would be even extra slick ;)
2.4.5-RELEASE][admin@sg4860.local.lan]/: speedtest -h usage: speedtest [-h] [--no-download] [--no-upload] [--single] [--bytes] [--share] [--simple] [--csv] [--csv-delimiter CSV_DELIMITER] [--csv-header] [--json] [--list] [--server SERVER] [--exclude EXCLUDE] [--mini MINI] [--source SOURCE] [--timeout TIMEOUT] [--secure] [--no-pre-allocate] [--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 --no-download Do not perform download test --no-upload Do not perform upload test --single Only use a single connection instead of multiple. This simulates a typical file transfer. --bytes Display values in bytes instead of bits. Does not affect the image generated by --share, nor output from --json or --csv --share Generate and provide a URL to the speedtest.net share results image, not displayed with --csv --simple Suppress verbose output, only show basic information --csv Suppress verbose output, only show basic information in CSV format. Speeds listed in bit/s and not affected by --bytes --csv-delimiter CSV_DELIMITER Single character delimiter to use in CSV output. Default "," --csv-header Print CSV headers --json Suppress verbose output, only show basic information in JSON format. Speeds listed in bit/s and not affected by --bytes --list Display a list of speedtest.net servers sorted by distance --server SERVER Specify a server ID to test against. Can be supplied multiple times --exclude EXCLUDE Exclude a server from selection. Can be supplied multiple times --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 --no-pre-allocate Do not pre allocate upload data. Pre allocation is enabled by default to improve upload performance. To support systems with insufficient memory, use this option to avoid a MemoryError --version Show the version number and exit [2.4.5-RELEASE][admin@sg4860.local.lan]/:
-
-
Thank you very much, @aln!
I don't know why this isn't a stock package. Speed test on a router is a must. Thank you ever so much. This is by far my most needed package and you have just made my dreams come true.
To show my appreciation, I'd like to contribute some easy-install instructions. This short script does what you said to do. It won't install the widget if the pkg install fails. This can be run from the Diagnostics> Command Prompt > Execute Shell Command
pkg update ; pkg install -y py37-speedtest-cli && curl -o /usr/local/www/widgets/widgets/speedtest.widget.php https://raw.githubusercontent.com/aln-1/pfsense-speedtest-widget/master/speedtest.widget.php
Please consider further development, making this an official pFSense package. I'm very happy this is now a thing and thank you ever so much.
After hitting the refresh button, it comes up blank and never shows my results. I have to refresh the page to see the results. Any ideas?
-
@adamoutler when hitting the refresh button did it finish spinning? Can you see if there are any warning or errors in the browser's developer tools?
The widget will show an empty image initially and will cache the last speedtest results. You will be able to see them for as long as Ookla is caching them, as far as I can say this is forever. -
FWIW, when I ran it the second time, I also got an empty box, but every subsequent run it went fine. I just hit the chasing arrows again.
-
I get some positive feedbacks and that's nice.
This was really quick and dirty widget. Maybe I'll take it a step further.
I'll keep you posted. -
@aln maybe a reboot is required to reload the PHP system? It just stopped spinning and went blank.
-
@aln new and improved version is now available
-
@adamoutler reboot should not be needed
-
@aln not sure how to activate it.
! -
@aln Maginficent!!! Thank you!
image url)
-
@adamoutler I committed a fix. try the latest version.