[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Regarding server pings



At 1:35 AM +0000 5/17/00, Sveinbjorn Thordarson wrote:
>Hi there
>
>I'm writing a Perl script that accesses a server and retrieves certain
>information.  Now, I want the script to ping the server to check if it
>responds, but most of all I want a way to see if the computer is
>actually connected. 
>
>I've had some very disappointing results with Net::Ping, which gives me
>that every single server isn't responding although I'm
>connected....perhaps my Virtual Private Networking ADSL Modem is messing
>it up...but I don't know.

The big problem with Net::Ping is that it can't do ICMP echo under 
MacPerl, which is the kind of ping that's usually send by programs 
like ping(8).  Nothing can be done about that.

Most places these days have tcp and udp echo turned off, so they're 
not likely to work.  Those are the only kinds of echo that Net::Ping 
can send using MacPerl.   Some places don't even let ICMP through 
their routers; maybe your ADSL provider is one of them.

You say it's a "server".  The best way to see if a server is up is to 
try speaking the protocol it understands to it.  You know that if it 
responds, the server is up.  In other words, simply skip the ping 
step and try to connect to the server directly.


>
>I'm wondering if anybody knows a simple, easy way to check if the
>computer on which the script runs is online,...and perhaps something
>more useful than Net::Ping?
>
>thanx
>
>Sveinbjorn Thordarson
>Reykjavik, Iceland
>
># ===== Want to unsubscribe from this list?
># ===== Send mail with body "unsubscribe" to macperl-request@macperl.org

-- 
--
Paul Schinder
schinder@pobox.com

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org