mirror of https://github.com/Aidaho12/haproxy-wi
Merge branch 'master' of https://github.com/Aidaho12/haproxy-wi
commit
cfded6ca53
|
@ -16,7 +16,7 @@ async def async_get_overview(serv1, serv2):
|
||||||
haproxy_config_path = sql.get_setting('haproxy_config_path')
|
haproxy_config_path = sql.get_setting('haproxy_config_path')
|
||||||
commands = [ "ls -l %s |awk '{ print $6\" \"$7\" \"$8}'" % haproxy_config_path ]
|
commands = [ "ls -l %s |awk '{ print $6\" \"$7\" \"$8}'" % haproxy_config_path ]
|
||||||
commands1 = [ "ps ax |grep waf/bin/modsecurity |grep -v grep |wc -l" ]
|
commands1 = [ "ps ax |grep waf/bin/modsecurity |grep -v grep |wc -l" ]
|
||||||
commands2 = [ "ps ax |grep keep_alive.py |grep -v grep |wc -l" ]
|
commands2 = "ps ax |grep keep_alive.py |grep -v grep |wc -l"
|
||||||
|
|
||||||
cmd = 'echo "show info" |nc %s %s |grep -e "Process_num"' % (serv2, haproxy_sock_port)
|
cmd = 'echo "show info" |nc %s %s |grep -e "Process_num"' % (serv2, haproxy_sock_port)
|
||||||
server_status = (serv1,
|
server_status = (serv1,
|
||||||
|
@ -25,7 +25,7 @@ async def async_get_overview(serv1, serv2):
|
||||||
funct.ssh_command(serv2, commands),
|
funct.ssh_command(serv2, commands),
|
||||||
funct.ssh_command(serv2, commands1),
|
funct.ssh_command(serv2, commands1),
|
||||||
sql.select_servers(server=serv2, keep_alive=1),
|
sql.select_servers(server=serv2, keep_alive=1),
|
||||||
funct.ssh_command(serv2, commands2))
|
funct.subprocess_execute(commands2))
|
||||||
return server_status
|
return server_status
|
||||||
|
|
||||||
async def get_runner_overview():
|
async def get_runner_overview():
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
{% if service.5.0.0|int() >= 1 %}
|
{% if service.5.0.0|int() >= 1 %}
|
||||||
<img
|
<img
|
||||||
{% if service.6|int() >= 1 %}
|
{% if service.6.0.0|int() >= 1 %}
|
||||||
src="/image/pic/shield.png" title="Auto start enabled"
|
src="/image/pic/shield.png" title="Auto start enabled"
|
||||||
{% else %}
|
{% else %}
|
||||||
src="/image/pic/shield-red.png" title="Auto start enabled, but keep alive service does not work"
|
src="/image/pic/shield-red.png" title="Auto start enabled, but keep alive service does not work"
|
||||||
|
|
10
update.sh
10
update.sh
|
@ -28,8 +28,8 @@ After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/var/www/$HOME_HAPROXY_WI/app/
|
WorkingDirectory=$(pwd)/app/
|
||||||
ExecStart=/var/www/$HOME_HAPROXY_WI/app/tools/keep_alive.py
|
ExecStart=$(pwd)/app/tools/keep_alive.py
|
||||||
|
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
|
@ -44,13 +44,13 @@ WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat << 'EOF' > /etc/rsyslog.d/keep_alive.conf
|
cat << 'EOF' > /etc/rsyslog.d/keep_alive.conf
|
||||||
if $programname startswith 'keep_alive' then /var/www/__HOME_HAPROXY_WI__/log/keep_alive.log
|
if $programname startswith 'keep_alive' then $(pwd)/log/keep_alive.log
|
||||||
& stop
|
& stop
|
||||||
EOF
|
EOF
|
||||||
sed -i -e "s/__HOME_HAPROXY_WI__/$HOME_HAPROXY_WI/g" /etc/rsyslog.d/keep_alive.conf
|
|
||||||
|
|
||||||
cat << EOF > /etc/logrotate.d/metrics
|
cat << EOF > /etc/logrotate.d/metrics
|
||||||
/var/www/$HOME_HAPROXY_WI/log/keep_alive.log {
|
$(pwd)/log/keep_alive.log {
|
||||||
daily
|
daily
|
||||||
rotate 10
|
rotate 10
|
||||||
missingok
|
missingok
|
||||||
|
|
Loading…
Reference in New Issue