# Using the requests library:
import requests

try:
    requests.get("{{ ping_url }}", timeout=10)
except requests.RequestException as e:
    # Log ping failure here...
    print("Ping failed: %s" % e)