Jump to content

Internett logger

Go to solution Solved by Guest,

The general idea I guess would be to add a script to crontab that outputs measured performance and time, appending output to a text file. Turns out there's a speedtest command line utility.

https://askubuntu.com/questions/104755/how-to-check-internet-speed-via-terminal

You don't necessarily need Ubuntu, the util is written in python, so anything supporting that should do.

Hi, Couldent find what I where looking for on the web.

I need a program that could do a automatic speed test every 30 or 60 min and save it with clock and date.

Is there something like this? We are going to try claim to not pay for this month becouse the internet is way lower than our deal and unstable.

Back-end developer, electronics "hacker"

Link to comment
https://linustechtips.com/topic/580018-internett-logger/
Share on other sites

Link to post
Share on other sites

5 minutes ago, KuJoe said:

If you have a linux device this is really easy to do but the only way your ISP would probably even listen to you is if you plug your PC directly into your modem and remove any network devices in between.

Yea I have a Linux server, And they are actually not that strict on it even tho they are one of the worst ISP we have in our country.

Back-end developer, electronics "hacker"

Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7578839
Share on other sites

Link to post
Share on other sites

The general idea I guess would be to add a script to crontab that outputs measured performance and time, appending output to a text file. Turns out there's a speedtest command line utility.

https://askubuntu.com/questions/104755/how-to-check-internet-speed-via-terminal

You don't necessarily need Ubuntu, the util is written in python, so anything supporting that should do.

Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7578926
Share on other sites

Link to post
Share on other sites

6 minutes ago, Svinsparbriivu said:

The general idea I guess would be to add a script to crontab that outputs measured performance and time, appending output to a text file. Turns out there's a speedtest command line utility.

https://askubuntu.com/questions/104755/how-to-check-internet-speed-via-terminal

You don't necessarily need Ubuntu, the util is written in python, so anything supporting that should do.

I'll give that a go when I'm back home, I also like Ubuntu Linux over other Linux distro's

Back-end developer, electronics "hacker"

Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7578947
Share on other sites

Link to post
Share on other sites

6 hours ago, Svinsparbriivu said:

The general idea I guess would be to add a script to crontab that outputs measured performance and time, appending output to a text file. Turns out there's a speedtest command line utility.

https://askubuntu.com/questions/104755/how-to-check-internet-speed-via-terminal

You don't necessarily need Ubuntu, the util is written in python, so anything supporting that should do.

Works great, Now I'm new to making scripts in Linux only used Batch for windows. How would I do this?

Back-end developer, electronics "hacker"

Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7580122
Share on other sites

Link to post
Share on other sites

1 hour ago, Joveice said:

Works great, Now I'm new to making scripts in Linux only used Batch for windows. How would I do this?

After having tried it myself, it really seems there's no point in writing a separate script, just type

crontab -e

If you're running a desktop version of Ubuntu, it might prompt you for what text editor to use for editing crontab, I'd suggest using nano if you don't have any experience with vi. Or it might default to nano, I don't know.

The text file by default should contain only comments (lines starting with #) which explain rather well how cron works.

 

The output of the speedtest tool is pretty verbose, but doesn't include time, so all-in-all I'd add two lines to the crontab

0,30 * * * * date >> /path/to/YourLogFile.txt
1,31 * * * * /path/to/speedtest-cli --simple >> /path/to/YourLogFile.txt

date will add a line containing the time on the 0th and 30th minute of every hour

speedtest-cli --simple will add three lines containing ping, download and upload speeds on the 1st and 31st minute of every hour

This will continue happening until you go into crontab again and delete or comment out those lines.

 

The text file doesn't need to be manually created, the .txt extension is optional. Obviously replace '/path/to/' with whatever folder you're using (presumably /home/yourusername/ or /root/)
 

 

Edited by Svinsparbriivu
Removed the .py extension from the speedtest util as apparently wget didn't save it with that
Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7580498
Share on other sites

Link to post
Share on other sites

38 minutes ago, Svinsparbriivu said:

The controls at the bottom of nano ( ^O, ^X) mean Ctrl+o and Ctrl+x respectively.

After adding the lines you need to press Ctrl+o to 'write out' (save) the changes and Ctrl+x to exit the editor.

Or just Ctrl+x and then y to save and enter to confirm file name.

Okey did this, What do I do now? Or is it automatic? And if so, How do I stop this when I'm done with it?

Back-end developer, electronics "hacker"

Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7580823
Share on other sites

Link to post
Share on other sites

11 minutes ago, Joveice said:

Okey did this, What do I do now? Or is it automatic? And if so, How do I stop this when I'm done with it?

As I said, it's automatic and you stop it by calling crontab -e again and deleting or commenting out those 2 lines.

 

Picture of what my crontab looked like in nano and the contents of the log file after half an hour.

speedtest-screenshot.png

Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7580868
Share on other sites

Link to post
Share on other sites

1 minute ago, Svinsparbriivu said:

As I said, it's automatic and you stop it by calling crontab -e again and deleting or commenting out those lines 2 lines.

 

Picture of what my crontab looked like in nano and the contents of the log file after half an hour.

speedtest-screenshot.png

Okey great thank you :)

Back-end developer, electronics "hacker"

Link to comment
https://linustechtips.com/topic/580018-internett-logger/#findComment-7580874
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×