Speedtest CLI. Run speedtest on pfSense box
-
Nice !
But keep in mind :
@jimp said in Speedtest CLI. Run speedtest on pfSense box:
No, because speed testing from the firewall itself is inaccurate and unreliable. We don't want to encourage people to rely on bad data. See my previous response on this thread.
@raidarray said in Speedtest CLI. Run speedtest on pfSense box:
how can i improve it?
By adding the option to select the server being used to test ?
Default, speed-test used the closed server on "the list". -
@icewraithuk said in Speedtest CLI. Run speedtest on pfSense box:
I use this to keep my ISP honest, which is a trick in itself :) For those that are interested here's my hack:
Very cool. Greetings from the Future!
EDIT - What fun! I was able to combine instructions from both @icewraithuk and @raidarray and throw this chart into the Dashboard using the dark theme. It runs the CLI speedtest against the lowest ping server every 10 minutes, posts to Thingspeak and the Dashboard reads back the Public feed.
-
@icewraithuk Am I missing something or does one have to have a university or company email account? It definitely did not seem to like the gmail account!
-
@kcallis I just used an Outlook.com account. BTW, the post above from @icewraithuk was posted 2 years ago and it was his only post ever on the forum.
PS - I found a cool chart in the ThingSpeak forums with a chart template that consolidates the CSV data produced by @icewraithuk 's method that I managed to modify to show my upload/download/ping data all in one chart, but you'll need to muddle through the edits manually. There are notes in the .html file that tell you where to put your info. Not saying it's the best data set, but a fun excercise anyway.
https://community.thingspeak.com/forum/announcements/thingspeak-live-chart-multi-channel-second-axis-historical-data-csv-export/ -
@provels That is rad but it seems like running speedtest every ten minutes would be quite a burden on your WAN connection. Can you post the PHP you used for the widget? Thanks.
-
@0daymaster I run the speedtest every 30 minutes now, but it's just me, so who cares? You pretty much need everything in this thread to do what I did.
1 - Install speedtest-cli on the FW. Run some tests from the shell to get a feel for it.
2 - Setup a Thinkspeak.com account and do the @icewraithuk edits to the speedtest.py file (make @cukal 's edits for Mbps instead of MB if you wish).
3 - Now you should be able to send the data to Thinkspeak to generate the graphs. Format them in the style/colors as you wish. You'll use the
Read API Key to post the data you'll add to the widget.
4 - Then just use @RaidArray 's instruction to add the URL for your chosen Thingspeak graphs and to create the widget you can load from the FW homepage.
5- You can DL the html file from the Thingspeak forum post and edit it in a text editor to make it useful for your data. I didn't incorporate it into the FW homepage, though. I now also use a Windows version of speedtest-cli (Google) running as a scheduled task on an inside server so the tests actually run through the FW rather than from it
All credit goes to everyone else. I just managed to screw some parts together, in spite of myself. -
Just want to have my input here took me a while to figure my way around all the coding but with a bit of persistence i got my 15 min speed checker working & managed to get it working in pfsense will attach screen shot for you to see well chuffed with the outcome just want to say thanks to all that inputted information to make this happen,
It would be nice to drop all 3 data UL DL & Ping in to the 1 graph i tried to do it but it just got to complicated
Thanks
-
@joeontherun Nice work! Just duplicate what you did for your "Speed Checker" graph. Create the graphs on Thingspeak, create the .inc files pointing to the links and the .php widgets! Then smile! Can help as needed, but I think you got it! :)
-
The link for how to make a widgit with speed test is dead.
Anyone have a instruction for how to get speedtest in the GUI?
-
@justheretohelp
Create speedtest.inc in /usr/local/www/widgets/include
This will add the Speedtest entry to the pfSense Dashboard widget choices.<?php /* File : /usr/local/www/widgets/include/speedtest.inc * Author : Zak Ghani * Date : 10-03-2019 * * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES * OR CONDITIONS OF ANY KIND, either express or implied. * */ $Download_title = gettext("Speedtest - Mbps"); ?>
Then create speedtest.widget.php in /usr/local/www/widgets/widgets
<?php /* File : /usr/local/www/widgets/widgets/speedtest.widget.php * Author : Zak Ghani * Date : 10-03-2019 * * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES * OR CONDITIONS OF ANY KIND, either express or implied. * * URL Choices : https://www.bing.com/widget/t/speedtest * https://www.measurementlab.net/p/ndt-ws.html */ require_once("guiconfig.inc"); ?> <iframe src="https://www.bing.com/widget/t/speedtest" width="498" height="500" frameborder="0" > </iframe>
When you copy the code, be sure to get it all, the windows scrolls. You may need to mess with the pixel height/width of the object.
Think that's it... -
Sorry about the dead links. In the middle of moving websites. @provels has it spot on coding wise.
Should be able to get the instructions back on line within the next few days. -
@RaidArray Are those instructions back up online somewhere by chance?
-
Hi,
this long discussion was nearly wat I'm locking for.
But in the end I build it on my own...and maybe someone is interested in this. Here is what I did:
I have mounted a USB drive (not really necessary for everybody) and build a script that can called by cron.
This script is parsing the response from speedtest-cli on directly on the WAN interface and writes a log file. From this log file I took the last 7 lines (cron is running every day) and create a /usr/local/www/js/speettest_cli.js as data file for my chart from https://www.chartjs.org.
And here is the result:
The tooltip is a mouse over and you can also hide single elements like this:
The fact that you see only the 03.03. and 04.03. is that I created yesterday and these are just placeholder until the new data arrived.Here you can finde all files.
Feel free to use it. Think everyone have to adapt all the paths in the \usr\local\bin\speedtest.sh
Also in this file you have to set you place for the speedtest...like speedtest-cli --server 16688Cheers
MarcO -
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