Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like, but what I'd really like to do is put a graph in cacti, run a speed test every half-hour, and graph the results (maybe running it three times each time and averaging it).

I can do the cacti part, but I need a script (perl, python, php, bash, ruby, whatever) that can produce speed results. Does anyone know a script that does this, or a webpage that would be script-friendly I could hit and parse?

share|improve this question

I don't have a full answer but I do have a sample bash script that you could use.

Something like the command:

/usr/bin/time -f '%e' curl -s -o /dev/null

Will result in a string with the number of seconds it took to download the file to the system. Divide the KB of the filesize (known) to get the KB/s, roughly.

Note that there are so many factors at play in internet bandwidth, that speed constrictions on either endpoint or routers in between can impact this result. Also, make sure you own the remote server if you are planning on running this 'download' test often; bandwidth isn't free! :)

share|improve this answer

If you have someplace to setup a remote endpoint, you could use iPerf really easily: does have their "Mini" that lets you setup your own hosted utility. Maybe you could utilize that, especially since they provide the Flash app and scripts to host it:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.