#!/usr/bin/perl -w use strict; use Net::Ping; my $test_host = 'www.google.com'; my $sleepy_time = 30; print "Network Monitor started at ", scalar localtime, ". (Testing $test_host every $sleepy_time seconds)\n"; my $p = Net::Ping->new(); while (1) { sleep $sleepy_time; next if $p->ping($test_host); print "$test_host appears to be down at ", scalar localtime, "\n"; }