[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 15370
  • Last Modified:

How to ping with Python / Linux ?

I have to write a script to monitor a mysql connection. Before I do this I want to test if my machine can access Internet by pinging the DNS server of my provider. I have seen very complicated ICMP functions. Does it not exist an obvious and easy to make a ping and return a boolean ?
0
proximal
Asked:
proximal
1 Solution
 
rjkimbleCommented:
Check out: http://www.python.org/~jeremy/python.html

He has written ping in pure Python. You can download his code here: http://www.python.org/~jeremy/ping.tar.gz

I tried it in Windows and it seems to work just fine. I ran the following command:

ping.py cisco.com 4
0
 
proximalAuthor Commented:
Thank you for your help. I had found this link with google / python but the code is not very handy. I have found this (better because structurated as a class) : http://pynms.sourceforge.net/ping.html
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now