Skip to content

Instantly share code, notes, and snippets.

@masci
Created March 3, 2017 11:15
Show Gist options
  • Save masci/383f41e9ab1c5227a2493e31fcf6f72e to your computer and use it in GitHub Desktop.
Save masci/383f41e9ab1c5227a2493e31fcf6f72e to your computer and use it in GitHub Desktop.
#!/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