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
In reply to Re: website availability ping
by diakonos
in thread website availability ping
by Lhamo Latso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |