From 826f250a623fbdad81b4b365472c51edd9410c1d Mon Sep 17 00:00:00 2001 From: Aidaho12 Date: Thu, 18 Jan 2018 16:03:35 +0600 Subject: [PATCH] Update viewsttats.py --- cgi-bin/viewsttats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cgi-bin/viewsttats.py b/cgi-bin/viewsttats.py index f606868c..8dff5f7f 100644 --- a/cgi-bin/viewsttats.py +++ b/cgi-bin/viewsttats.py @@ -22,8 +22,9 @@ form = cgi.FieldStorage() serv = form.getvalue('serv') if serv is None: - serv = '172.28.5.17' - + first_serv = list(listhap.list_hap_vip.values()) + serv = first_serv[0] + try: response = requests.get('http://%s:%s/stats' % (serv, stats_port), auth=(haproxy_user, haproxy_pass)) except requests.exceptions.ConnectTimeout: