in reply to website availability ping
This module allows you to specify timeout values and also change the type (TCP,UDP, or ICMP) of echo requests that you send. (Up to 6 different protocols) Ex. you cannot ICMP www.micro$oft.com but you can establish a tcp request to the echo port and determine if the server is there. TCP seems to be a little better suited than ICMP but causes more overhead and traffic.#!/usr/bin/perl -w use strict; use Net::Ping; my $host = "XXX.XXX.XXX.XXX"; my $p = Net::Ping->new(); print "$host is alive.\n" if $p->ping($host); $p->close();
This module also allows you to do a service check (still not fool proof why HTTP or another service is not responding - that would require coding per service level). It has some return value checking to give you some reason why the response was negative.
I would use this first before trying to harvest an HTTP error on a remote server which may never reveal itself for various reasons.
Good Luck
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: website availability ping
by pg (Canon) on Oct 28, 2003 at 19:31 UTC | |
by diakonos (Hermit) on Oct 28, 2003 at 20:22 UTC | |
by Lhamo Latso (Scribe) on Oct 29, 2003 at 06:23 UTC |