Add timeout of 5s to monit api access ; per requests docs if you don't set this it will block indefinitely
This commit is contained in:
parent
f58707010a
commit
9e2f369ad4
|
@ -52,7 +52,8 @@ def getMonit():
|
||||||
for site in cf:
|
for site in cf:
|
||||||
s = cf[site]
|
s = cf[site]
|
||||||
r = requests.get(s['url'] + xmlQuery,
|
r = requests.get(s['url'] + xmlQuery,
|
||||||
auth=(s['user'], s['passwd']))
|
auth=(s['user'], s['passwd']),
|
||||||
|
timeout=5)
|
||||||
|
|
||||||
allstat = json.loads(json.dumps(xmltodict.parse(r.text)['monit']))
|
allstat = json.loads(json.dumps(xmltodict.parse(r.text)['monit']))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue