

I develop a library that I think could help you. If m: print 'Round Trip Time: %s ms -' % m.group(1), self.hostĮlse: print 'Error: Invalid Response -', self.host M = re.search('Average = (.*)ms', p.stdout.read()) P = Popen('ping -n 1 ' + self.host, stdout=PIPE) Hostname = urlparse.urlparse(host).hostname Round Trip Time: 245 ms - Round Trip Time: 327 ms - source code(url.py): import re Get the result: Round Trip Time: 253 ms. Read a file name, the file contain the one url per line, like this: He is also author of: Python for Unix and Linux System Administration #Wait until worker threads are done to exit Worker = Thread(target=pinger, args=(i, queue)) Ret = subprocess.call("ping -c 1 %s" % ip, The code to this version and others can be found here #!/usr/bin/env python2.5 Below is a basic version before he adds command line parsing and some other features. In it he combines subprocess, Queue and threading to develop solution that is capable of pinging hosts concurrently and speeding up the process. You may find Noah Gift's presentation Creating Agile Commandline Tools With Python. This isn't ideal, but it will work fine in many situations (where you know the machines the script will be running on) Now, to actually get the ping results, you could parse the out variable. You don't need to worry about shell-escape characters. Using the subprocess module is the best way of doing this, although you have to remember the ping command is different on different operating systems! import subprocess Please leave us some Feedback.Depending on what you want to achive, you are probably easiest calling the system ping command.


Verify a URL allows secure http connectionsĬheck your DNS Servers for possible problems New!įeedback: If you run into any problems with the site or have an idea that you think would make it better, we would appreciate your feedback. Verify an IP Address allows tcp connections Get Start of Authority record for a domain "blacklist: 127.0.0.2" will do a blacklist lookup) If you already know exactly what you want, you can force a particular test or lookup. And you'll have a chronological history of your results. Links in the results will guide you to other relevant tools and information. Input a domain name or IP Address or Host Name. All of your MX record, DNS, blacklist and SMTP diagnostics in one integrated tool.
