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

if the machine is supposed to be running an http server, you could use LWP to see if the httpd responds.

use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("AgentName/0.1 " . $ua->agent); my $req = new HTTP::Request GET => "http://some.server.net/"; my $res = $ua->request($req); if ($res->is_success) { #server is alive, do something } else { #something wrong, do something }
warning: that code was cribbed from the LWP pages, and might not be correct for your application....

update:

you could use the die as you suggested too, if you trap it with an eval() statement...

see this node for an excellent example.

good luck!

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