in reply to is there script to detect if remote machine is alive/reachable w/o using Net::Ping?
warning: that code was cribbed from the LWP pages, and might not be correct for your application....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 }
see this node for an excellent example.
good luck!
|
---|