diff --git a/app/ovw.py b/app/ovw.py index 5cfd99fb..84fe5c83 100644 --- a/app/ovw.py +++ b/app/ovw.py @@ -18,7 +18,7 @@ async def async_get_overview(serv1, serv2): commands1 = [ "ps ax |grep waf/bin/modsecurity |grep -v grep |wc -l" ] cmd = 'echo "show info" |nc %s %s |grep -e "Process_num"' % (serv2, haproxy_sock_port) - server_status = (serv1, serv2, funct.server_status(funct.subprocess_execute(cmd)), funct.ssh_command(serv2, commands), funct.ssh_command(serv2, commands1)) + server_status = (serv1, serv2, funct.server_status(funct.subprocess_execute(cmd)), funct.ssh_command(serv2, commands), funct.ssh_command(serv2, commands1), sql.select_servers(server=serv2, keep_alive=1)) return server_status async def get_runner_overview(): diff --git a/app/sql.py b/app/sql.py index c288720d..3ca66e18 100644 --- a/app/sql.py +++ b/app/sql.py @@ -238,6 +238,7 @@ def select_user_name_group(id): def select_servers(**kwargs): con, cur = create_db.get_cur() sql = """select * from servers where enable = '1' ORDER BY groups """ + if kwargs.get("server") is not None: sql = """select * from servers where ip='%s' """ % kwargs.get("server") if kwargs.get("full") is not None: @@ -250,6 +251,8 @@ def select_servers(**kwargs): left join uuid as uuid on user.id = uuid.user_id where uuid.uuid = '%s' and servers.master = 0 and servers.type_ip = 0 and servers.enable = 1 ORDER BY servers.groups """ % kwargs.get('uuid') + if kwargs.get("server") and kwargs.get("keep_alive"): + sql = """select active from servers where ip='%s' """ % kwargs.get("server") try: cur.execute(sql) except sqltool.Error as e: diff --git a/app/templates/ajax/overview.html b/app/templates/ajax/overview.html index ccbbe869..cf76e32f 100644 --- a/app/templates/ajax/overview.html +++ b/app/templates/ajax/overview.html @@ -1,7 +1,12 @@ {% for service in service_status %}