You can do the following:
import os
data = os.popen('ping machineName').read()
if 'request timed out' in data or 'unknown host' in data:
Ping Failed Code
else:
Ping Returned Something Good Code
This is the quickest and really most effective way to get it done IMO.
Harlin Seritt
On Mon, 12 Sep 2005 01:36:35 +0200, billiejoex [EMAIL PROTECTED] wrote:
Impacket module can helps you to construct the ip/icmp packet structure,
then you can send the packet and wait for the ECHOREPLY by using a
RAW_SOCKET.
Here's an example:
http://oss.coresecurity.com/impacket/ping.py
hi;
I need a simple script to run the ping command with some parameters and
be able to read the return value of the ping function. Any pointers will
be appreciated
thanks
m.smadi
--
http://mail.python.org/mailman/listinfo/python-list
On 2005-09-11, M.N.A.Smadi [EMAIL PROTECTED] wrote:
I need a simple script to run the ping command with some parameters and
be able to read the return value of the ping function. Any pointers will
be appreciated
http://www.google.com/search?hl=enq=python+ping
--
Grant Edwards
Impacket module can helps you to construct the ip/icmp packet structure,
then you can send the packet and wait for the ECHOREPLY by using a
RAW_SOCKET.
Here's an example:
http://oss.coresecurity.com/impacket/ping.py
Cheers
I need a simple script to run the ping command with some parameters