Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 need to just monitor how often an internet connection goes down - and for how long. I was going to just write a bit of python that pinged every minute but I thought there must be a util that does this - and produces a nice report

But this is a branch office with a simple SOHO type connection, no SNMP router, Windows only, must run on a desktop machine that isn't dedicated to the task.

Don't need to know capacity, ping latency or anything - just a report of how many times it was down for more than a few seconds to wave at the cable company.

share|improve this question
up vote 4 down vote accepted

I do this the other way around with Pingdom. Free account, one check. Ping the WAN ip address of the router, and it's all good. You get a monthly uptime report, and you can shout at the cable company.

share|improve this answer
Didn't realise they had a free version. Thanks – Martin Beckett Oct 5 '10 at 23:04
Pingdom now charge $100/year for this - time to look elsewhere – Martin Beckett Jun 8 '14 at 19:19
Really? I still have a one-check free-tier monitor, and haven't heard anything about them stopping it. – Tom O'Connor Jun 9 '14 at 10:39
1 It's well hidden at the bottom of the Pricing page. Sneaky. – Tom O'Connor Jun 10 '14 at 8:35
That links to their free trial now – Rehan Khwaja Jan 4 at 19:33

i don't know any util but i did myself a simple code for that with perl:


use Net::Ping;
use POSIX qw/strftime/;

if (-e '/var/run/') {
        print "net_test already running.\n";
} else {
        system "touch /var/run/";

my $host   = "";
my $ping   = Net::Ping->new('icmp');
my $result = $ping->ping($host,2);

if ($result != 1) {
        $format = strftime('[%d/%m/%Y %H:%M:%S]',localtime)." Internet is not available...";
        $run = `echo $format >> /var/log/virtua_net`;
        while ($result != 1) {
                $result = $ping->ping($host,2);
                sleep 60;
        $format = strftime('[%d/%m/%Y %H:%M:%S]',localtime)." Internet is back...";
        $run = `echo $format >> /var/log/virtua_net`;
} else {
        $format = strftime('[%d/%m/%Y %H:%M:%S]',localtime)." Internet is ok...";
        $run = `echo $format >> /var/log/virtua_net`;

system "rm -rf /var/run/" if (-e "/var/run/");

What it does is that it will try to ping google every time it runs and it will then print to a file if it got a reply or not along with the time so you can check later from what time to what time the internet was unavailable.

If you like it i can make the smalls changes to be used in windows and you did need to install ActivePerl that is all.

The only changes needed are paths and commands that may be different on windows nothing else.

share|improve this answer
That's pretty much what I would have written (only in python) - I just assumed there was a little systray tool to do this. – Martin Beckett Oct 5 '10 at 20:36
To be honest i never bothered to look for one eheh but since you were looking for something like this i tought i should share what i use with you/anyone else in the community that would need something alike :) and once again sorry that i don't know of any tool. – Prix Oct 5 '10 at 20:49
The ping only needs to be to the first router controlled by the ISP, in other words the first device you do not have control of. More and more ISP's are turning off ICMP because of this sort of thing. ICMP traffic to the edge device is OK, but across the backbone is just wasted bandwidth. – dbasnett Oct 5 '10 at 22:16
@dbasnett ofc i changed it to google to hidden to where i ping :) – Prix Oct 5 '10 at 22:34
@dbasnett good point - I assumed Google's could handle the load. – Martin Beckett Oct 5 '10 at 23:01

Another good choice is .Free website monitoring, transaction tests and reports.

share|improve this answer

Try the PA Server Monitor Free edition. It is limited in scope, but the free version will do Ping and create charts for you. Runs on Windows, and as a background service so it won't get in the way.

share|improve this answer
tried it - too complicated to setup. Looks like I will write a bit of python – Martin Beckett Oct 5 '10 at 21:13

I am currently investigating a similar problem (a DSL fault at a branch office). I'm running PingPlotter remotely; it's a Windows program and generates a simple to read graph. I've used the graph to tell the ISP what times the link is dropping.

(Now waiting for ISP to actually fix it - let me know if you have any tips on how to get telcos to work faster!)

share|improve this answer
Sorry - I think that problem is known as NP-very-very-hard – Martin Beckett Oct 5 '10 at 23:06

protected by splattne Nov 28 '11 at 16:13

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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