#!/usr/bin/perl #file by davidjp@cableinet.co.uk, llydapdicter@yahoo.co.uk use CGI qw(:standard); print header(), start_html("Server Ping Testing"), h1("Ping Results"); @host_array = ("irc.webchat.org","64.177.244.76"); use Net::Ping; $p = Net::Ping->new(); print "$host is alive.\n" if $p->ping($host); $p->close(); $p = Net::Ping->new("icmp"); foreach $host (@host_array) { print "$host is "; print "NOT " unless $p->ping($host, 2); print "reachable.\n"; print "
"; sleep(1); } $p->close(); $p = Net::Ping->new("tcp", 2); while ($stop_time > time()) { print "$host not reachable ", scalar(localtime()), "\n" unless $p->ping($host); sleep(300); } print end_html();