in reply to is there script to detect if remote machine is alive/reachable w/o using Net::Ping?

If you are merely polling, rather than attempting to yank an entire web page, I'd recommend using the 'HEAD' method in your request object rather than 'GET'. So modify 914's suggestion thusly to save some time and bandwidth:

my $req = new HTTP::Request HEAD => "http://some.server.net/"; my $res = $ua->request($req);

This is still assuming that HTTP is indeed the service of interest.

Matt

  • Comment on Re: is there script to detect if remote machine is alive/reachable w/o using Net::Ping?
  • Download Code

Replies are listed 'Best First'.
Re: Re: is there script to detect if remote machine is alive/reachable w/o using Net::Ping?
by jsprat (Curate) on Jun 06, 2002 at 20:51 UTC
    Like merlyn says, just be sure that if the HEAD fails try again with a GET. Many servers are configured not to respond to HEAD requests.