Browse Source

Update viewsttats.py

pull/1/head
Aidaho12 7 years ago committed by GitHub
parent
commit
826f250a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cgi-bin/viewsttats.py

5
cgi-bin/viewsttats.py

@ -22,8 +22,9 @@ form = cgi.FieldStorage()
serv = form.getvalue('serv') serv = form.getvalue('serv')
if serv is None: if serv is None:
serv = '172.28.5.17' first_serv = list(listhap.list_hap_vip.values())
serv = first_serv[0]
try: try:
response = requests.get('http://%s:%s/stats' % (serv, stats_port), auth=(haproxy_user, haproxy_pass)) response = requests.get('http://%s:%s/stats' % (serv, stats_port), auth=(haproxy_user, haproxy_pass))
except requests.exceptions.ConnectTimeout: except requests.exceptions.ConnectTimeout:

Loading…
Cancel
Save