def healthcheck_ping(req_obj, url): try: req_obj.get(url, timeout=10) except req_obj.RequestException as e: # Log ping failure here... print("Ping failed: %s" % e)