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:
KemoNine 2020-08-22 17:02:10 -04:00
parent f58707010a
commit 9e2f369ad4
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,8 @@ def getMonit():
for site in cf:
s = cf[site]
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']))