Created
March 3, 2017 11:15
-
-
Save masci/383f41e9ab1c5227a2493e31fcf6f72e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/datadog-agent/embedded/bin/python | |
import sys | |
import requests | |
if __name__ == "__main__": | |
print("Using python interpreter at {}".format(sys.executable)) | |
print("Using requests version {}".format(requests.__version__)) | |
addr = sys.argv[1] | |
print("Sending an HTTP request to {}".format(addr)) | |
sess = requests.Session() | |
sess.trust_env = False | |
headers = { | |
'User-Agent': 'Datadog Agent/5.11.2', | |
'Content-Type': 'application/x-www-form-urlencoded', | |
'Accept': 'text/html, */*', | |
} | |
r = sess.request('GET', addr, auth=None, timeout=10, | |
headers=headers, proxies={}, allow_redirects=True, verify=False, | |
json=None) | |
print("All good") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment