Hard Light Productions Forums
Off-Topic Discussion => General Discussion => Topic started by: Grizzly on November 01, 2014, 02:10:13 pm
-
Currently, our internet is rather... random. The speed is highly variable, and it's luck of the draw when or when not a webpage will load. Our new home bosses have told us to try and analyze when the internet is down to see if they can fix it.
The problem, however, is not that the internet is 'down' all the time. THe problem is that at highly irregular moments, our internet connection starts partying like it's 1995. This is rather hard to analyze with a simple pinglogger tool, so...
What I need is a tool that analyzes internet connection speeds on a set time interval, like say, every minute. Basically like the basic internet speedtests that you can find anywhere on the internet, except that it does this every minute and logs the results - preferably in a graph.
Anyone knowing such a tool?
-
Give this a look, last time I looked at it, it was free as well
http://www.dslreports.com/smokeping
-
Ooh, that one is neat! Thanks.
-
would imagine you could do something with wget and cron
...
OK josh, nice nerdsnipe, here is your command:
{ { date "+%Y-%m-%d %H:%M:%S," ; wget -O /dev/null http://www.google.com 2>&1 | grep -oh '\([0-9.]\+ [KM]B/s\)' ; } | xargs echo -n ; echo "" ; } >> speed.log
the last bit is the log file were the results are stored. you make yourself a cron job to run this command and you will have a csv file with "<timestamp>, <download speed>" cronicleing the speeds of downloading the google home page.
(assuming you have a linux/unix/osx box)
-
Strange. THe command works just fine when entered into a terminal but when entered into the cronjob it gives no errors, but no results either.
-
maybe it's putting it in a file you didn't expect? like the cron job is running as a different user and is putting the log in that user's home directory? maybe it would work better if you put it in a script?
-
try this rather:
{ { /bin/date "+%Y-%m-%d %H:%M:%S," ; /usr/bin/wget -O /dev/null http://www.google.com 2>&1 | /bin/grep -oh '\([0-9.]\+ [KM]B/s\)' ; } | /usr/bin/xargs /bin/echo -n ; /bin/echo "" ; } >> /var/log/speed.log
as for why it doesnt work? $PATH is not set in cron, unless you explicitly set it there. i usually just do echo $PATH, take the output of that and stick it at the top of the cron, so you dont need absolute paths everywhere.
(these are the paths on ubuntu 14.04, for the record... whereis command is helpful to find the absolute paths.)