Ping monitor - monitor ip in the background?
Jorgen Grahn
grahn+nntp at snipabacken.se
Sun Nov 2 04:04:50 EST 2008
On Sat, 01 Nov 2008 20:26:43 -0700, ScottZ <mylists at pinesalad.net> wrote:
...
> if os.name == "nt": # Windows
> pcmd = "ping -n 1 -w 1000 "
> else: # *nix
> pcmd = "ping -c1 -W1 "
Not really correct. Unfortunately there are many variants of ping for
Unix, and they don't take the same flags. In Solaris, for example, -c
is not a count, and -W doesn't seem to exist at all.
If I recall correctly, you can't even count on Linux installations to
have compatible pings.
Too bad that you cannot easily implement ping in your program -- it
needs extra privileges in order to handle ICMP.
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!
More information about the Python-list
mailing list