Win32 ping

S

Sean Cody

Does anyone know of an ping module that will work with Windows?

I'm currently using os.popen("ping -n1 host") but it's terribly slow
when using it a few hundred times.

After enumerating my domain of machines I'm trying to ping them to
determine if they are active before connecting to them via WMI (which
takes forever to timeout).
 
M

Mike C. Fletcher

Sean said:
Does anyone know of an ping module that will work with Windows?

Jeremy Hylton's code works well on Windows. It's fairly straightforward
to code up an asynchronous loop to allow pinging a few hundred ip
addresses (using the ping module primarily to properly encode the
packets). I'm wondering, however, if you couldn't simply set the
timeout lower for the connections?

HTH,
Mike

_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/
 
C

Christos TZOTZIOY Georgiou

I tried that but it complains about not having os.fork() available.
dir(os) does not contain fork.

Huh?

You may try downloading this file:

http://www.sil-tec.gr/~tzot/python/wiping.tgz

Inside, there are the ping, icmp, inet and ip modules that (I believe) I
found in Jeremy Hylton's page; you can study their usage in the
wiping.py file (which is a quick-and-dirty rewrite of one of my first
Tkinter python programs, so I am not very proud of the state of the
code; just check the ping module use). Standard disclaimers apply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top