From 9e2f369ad43020d08a285190808e6c2597bdb9e9 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 22 Aug 2020 17:02:10 -0400 Subject: [PATCH] Add timeout of 5s to monit api access ; per requests docs if you don't set this it will block indefinitely --- bin/monit-dashboard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/monit-dashboard.py b/bin/monit-dashboard.py index 026bc0b..9ab2801 100755 --- a/bin/monit-dashboard.py +++ b/bin/monit-dashboard.py @@ -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']))