How to ping in Python?
michaelschneider at fuse.net
Wed Dec 7 17:03:09 CET 2005
I only ping internal machines. You are right about shutting down ports.
When we disable telent, we also disable ping. Many people may not though,
Laszlo Zsolt Nagy wrote:
> Michael Schneider wrote:
>> I telnet to port 13 (returns time)
> The problem is that most modern up-to-date servers use firewalls. They
> only open the ports that are absolutely necessary. Usually the time
> service is part of inetd, which is disabled by default, on most of the
> servers. PING ICMP may work, but sometimes it does not either. In the
> worst case, all port are closed and you have no way to tell if there
> is a computer or not.
> Can you tell more about what kind of server do you need to "ping"?
> Example: if you need to know if a web server is alive, you should
> connect to port 80 (http). If the connection was successful, you can
> close the connection immeditelly. You can expect a HTTP server to open
> the HTTP port, but all other ports may be closed.
The greatest performance improvement occurs on the transition of from the non-working state to the working state.
More information about the Python-list