Ping

Tino Lange tl_news at nexgo.de
Fri Mar 1 15:29:05 EST 2002


On Fri, 1 Mar 2002 18:21:13 +0100, "Riss Nicolas"
<alien275 at libertysurf.fr> wrote:

>Bonjour,
>on ma dit que je pouvais écrire en francais alors j'écrit en francais. Je
>voudrais pouvoir vérifier toutes les 5 min que une machine ping une autre
>machine et si elle ne ping pas qu'elle execute un script. Comment faut il
>faire avec python pour pinger une machine et vérifier qu'elle répond??
>
>Merci de votre aide.
>

Hi Riss!

The best solution IMHO is to use the external "ping" provided by the
underlying operating system and to catch and parse its output. So you
don't have the possible suid and/or implementation problems.

If you really want to use a pure "Python-Ping" you have to be familiar
with (low-level) socket/network-programming. Have a look at
http://mail.python.org/pipermail/python-list/2001-November/070944.html
(the last two links will provide you with two working "Python-Pings")

Best regards

Tino




More information about the Python-list mailing list