FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
320 views 0 comments
by anonymous
hello support,
I have about 200 x09 series routers, I need to periodically run speed tests, it is possible to create a script or command that allows me to have the router run a speed test every 7 days and receive it for example via email or other method ?

1 Answer

0 votes
by anonymous

Hello,

  

Thank you for reaching out!

For this purpose, the best option would be to use iPerf3. This is because it is more optimized for scripting, and has much more options.

The processing logic that I imagine would be the best here:

  • Create a script that runs the iperf3 speed test to your server and saves the results to a file. The command would look like so:

iperf3 -R --logfile /tmp/iperf_res.txt -c <hostname/IP address>

  • The argument -R performs a reverse test, meaning you will see the download speeds of the router. If you only need the upload speed, -R can be removed. It can also be replaced with --bidir. This will perform both - upload and download tests.
  • Once this file is saved, you will need to decide what you would like to do with it. I would advise against sending it via email, as managing 200 emails a week could be quite a task. Perhaps the results could be sent via MQTT or as an HTTP Post request to your server, and the results could be stored there? Uploading it via FTP could also be an option (an example can be found in this comment).
  • After the file is sent, make sure to remove it, so the results are not concentrated after the next test;
  • This script could be placed in the /etc directory, and a crontab could be added to run it at a specified time or every seven days;
Since iPerf3 is not pre-installed on our routers, it will need to be downloaded from the opkg repository. This can be done by connecting to the device command line, and running these commands:

opkg update (ignore the errors at the end)

opkg install iperf3

  

Let me know if any more information is needed!

Best regards,
DaumantasG