mirror of https://github.com/Aidaho12/haproxy-wi
parent
4bb9a840fb
commit
f520c5d9fd
|
@ -16,7 +16,7 @@ async def async_get_overview(serv1, serv2):
|
|||
haproxy_config_path = sql.get_setting('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" ]
|
||||
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)
|
||||
server_status = (serv1,
|
||||
|
@ -25,7 +25,7 @@ async def async_get_overview(serv1, serv2):
|
|||
funct.ssh_command(serv2, commands),
|
||||
funct.ssh_command(serv2, commands1),
|
||||
sql.select_servers(server=serv2, keep_alive=1),
|
||||
funct.ssh_command(serv2, commands2))
|
||||
funct.subprocess_execute(commands2))
|
||||
return server_status
|
||||
|
||||
async def get_runner_overview():
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
{% if service.5.0.0|int() >= 1 %}
|
||||
<img
|
||||
{% if service.6|int() >= 1 %}
|
||||
{% if service.6.0.0|int() >= 1 %}
|
||||
src="/image/pic/shield.png" title="Auto start enabled"
|
||||
{% else %}
|
||||
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]
|
||||
Type=simple
|
||||
WorkingDirectory=/var/www/$HOME_HAPROXY_WI/app/
|
||||
ExecStart=/var/www/$HOME_HAPROXY_WI/app/tools/keep_alive.py
|
||||
WorkingDirectory=$(pwd)/app/
|
||||
ExecStart=$(pwd)/app/tools/keep_alive.py
|
||||
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
|
@ -44,13 +44,13 @@ WantedBy=multi-user.target
|
|||
EOF
|
||||
|
||||
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
|
||||
EOF
|
||||
sed -i -e "s/__HOME_HAPROXY_WI__/$HOME_HAPROXY_WI/g" /etc/rsyslog.d/keep_alive.conf
|
||||
|
||||
|
||||
cat << EOF > /etc/logrotate.d/metrics
|
||||
/var/www/$HOME_HAPROXY_WI/log/keep_alive.log {
|
||||
$(pwd)/log/keep_alive.log {
|
||||
daily
|
||||
rotate 10
|
||||
missingok
|
||||
|
|
Loading…
Reference in New Issue