This commit is contained in:
parent
bfaaf74395
commit
a6ae230f8e
10
httpoll.py
10
httpoll.py
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import requests
|
import requests
|
||||||
import sys
|
|
||||||
from time import time, sleep
|
from time import time, sleep
|
||||||
|
|
||||||
import urllib3
|
import urllib3
|
||||||
@ -21,11 +20,8 @@ def poll():
|
|||||||
time_start = time()
|
time_start = time()
|
||||||
status, result = "", ""
|
status, result = "", ""
|
||||||
try:
|
try:
|
||||||
r = requests.get(
|
r = requests.get(url=args.URL, timeout=10.0,
|
||||||
url = args.URL,
|
verify=False, proxies=no_proxy)
|
||||||
timeout = 10.0,
|
|
||||||
verify = False,
|
|
||||||
proxies = no_proxy)
|
|
||||||
status = "ok"
|
status = "ok"
|
||||||
result = str(r)
|
result = str(r)
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
@ -62,5 +58,3 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user