Speedtest Plugin

Hi Jack, first of all thanks for this valuable script!

I wanted to use the script but it seems speedtest did some changes.
if you folow the docu there is a small change … speedtest is now known as speedtest-cli, in the repo there is no longer speedtest so apt-get install speedtest will fail, but apt-get install speedtest-cli does install speedtest.
As you described there is a cli version but it seems this is the only one availible now :frowning:
pi@nms:~ $ speedtest-cli --version
speedtest-cli 2.1.3
Python 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]

After some testing there is a way arround:
Alternatieve for pi4 wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-armel.tgz and unpack that one does work and is the speedtest first time you need to agree with the licence

version is:
Speedtest by Ookla 1.2.0.84 (ea6b6773cf) Linux/arm-linux-musleabi 5.15.76-v7+ arm/armv7l
And this one suits i copyed it in the /usr/bin folder and should be working … keep you posted

did the job, thanks

Hi Jack!
You did an excellent job, cheers to you!!!
For some reason, my script started to show only a fraction of the real speed, like, my link is a 500MBPs and it goes up to 8MBPS only in the graphs.
When I tried to run it manually I got these errors:

librenms@dns-nms-omv7:~/html/plugins/Speedtest$ ./librenms-speedtest.sh create
librenms@dns-nms-omv7:~/html/plugins/Speedtest$ ./librenms-speedtest.sh run
ERROR: /opt/librenms/html/plugins/Speedtest/rrd/speedtest-latency.rrd: Function update_pdp_prep, case DST_GAUGE - Cannot convert ‘’ to float
ERROR: /opt/librenms/html/plugins/Speedtest/rrd/speedtest-bandwidth.rrd: Function update_pdp_prep, case DST_GAUGE - Cannot convert ‘’ to float
librenms@dns-nms-omv7:~/html/plugins/Speedtest$

Any ideas?

Hi, I am trying with the latest version of LibreNMS and I can’t get it to work, I replaced the file Speedtest.inc.php.

any idea?

Strange it always worked but… since the new install due a diskcrash the Speedtest plugin, does show the pages with the patch, but… it does not contain any data. When i check the RDD files, they do contain data. Could it be we run into an issue of versions of php, and or, python? Does someone has any clues how to get the plugin working again, since it is a great plugin for debugging network issues of your ISP.
What i have found out until now, when you execure the commands seperately as librenms user, you will get the RDD graph, but when you add them in the cron job as described in the manual, the images are shown but not filled with data. It shows the fix and the software does work. I also examined the journal, with journalctl since the old style logfiles are gone. The scripts have been executed. I am now testing the scripts individual with also >>/var/log/speedtest.log to see if i can figure out what is gooing on.
I am also struggeling with the cron jobs seems not all jobs are running propperly

I had the same problem with LibreNMS 25.2.0 with the speedtest add-on.

To the plugin page to display the graphs I replaced data-original with src in the ~/html/plugins/Speedtest/Speedtest.inc.php file

Not sure if anything is broken but the graphs seem to appear correctly

I modified librenms-speedtest.sh like this. It does not store server, but ping, download and upload. Remember the other fixes provided previously in this thread (lazy load image bug). That bug is also mentioned here:

            speedtest --simple > $SpeedtestResultDir/speedtest-results 2>/dev/null

            # Get the Latency
            Latency=$(cat $SpeedtestResultDir/speedtest-results | grep Ping | sed 's/.*Ping:\s*\([0-9]*.[0-9]*\).*/\1/')

            # Get the Download speed
            DownloadSpeed=$(cat $SpeedtestResultDir/speedtest-results | grep Download | sed 's/.*Download:\s*\([0-9]*.[0-9]*\).*/\1/')

            # Get the Upload speed
            UploadSpeed=$(cat $SpeedtestResultDir/speedtest-results | grep Upload | sed 's/.*Upload:\s*\([0-9]*.[0-9]*\).*/\1/')