mirror of https://github.com/Aidaho12/haproxy-wi
v1.8.1
parent
1a5863e9f8
commit
a3b26028ad
|
@ -325,11 +325,18 @@ def show_ip(stdout):
|
|||
print(line)
|
||||
|
||||
def server_status(stdout):
|
||||
if " " not in stdout.read().decode(encoding='UTF-8'):
|
||||
print('<span class="serverUp"> UP</span> running 3 processes')
|
||||
proc_count = ""
|
||||
for line in stdout.read().decode(encoding='UTF-8'):
|
||||
proc_count += line
|
||||
if "0" != line:
|
||||
err = 0
|
||||
else:
|
||||
err = 1
|
||||
if err == 0:
|
||||
print('<span class="serverUp"> UP</span> running %s processes' % proc_count)
|
||||
else:
|
||||
print('<span lass="serverDown"> DOWN</span> running 0 processes')
|
||||
|
||||
print('<span class="serverDown"> DOWN</span> running %s processes' % proc_count)
|
||||
|
||||
def ssh_command(serv, commands, **kwargs):
|
||||
ssh = ssh_connect(serv)
|
||||
|
||||
|
|
|
@ -100,7 +100,11 @@ print('</table><table class="overview"><tr class="overviewHead">'
|
|||
'</td>'
|
||||
'</tr>')
|
||||
print('</td></tr>')
|
||||
commands = [ "cat /etc/haproxy/haproxy.cfg |grep -E '^listen|^backend|^frontend' |grep -v stats |wc -l", "uname -smor", "haproxy -v |head -1", "top -u haproxy -b -n 1" ]
|
||||
commands = [ "cat /etc/haproxy/haproxy.cfg |grep -E '^listen|^backend|^frontend' |grep -v stats |wc -l",
|
||||
"uname -smor",
|
||||
"haproxy -v |head -1",
|
||||
"systemctl status haproxy |grep Active | sed 's/^[ \t]*//'",
|
||||
"top -u haproxy -b -n 1" ]
|
||||
for i in sorted(listhap):
|
||||
print('<tr><td class="overviewTr"><a name="'+i+'"></a><h3 title="IP ' + listhap.get(i) + '">' + i + ':</h3></td>')
|
||||
print('<td class="overviewTd"><span style="margin-left: -10px;">Total listen/frontend/backend:</span><pre>')
|
||||
|
|
Loading…
Reference in New Issue