|
|
@ -20,12 +20,12 @@ class GracefulKiller:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
servers = sql.select_keep_alive()
|
|
|
|
|
|
|
|
port = sql.get_setting('haproxy_sock_port')
|
|
|
|
port = sql.get_setting('haproxy_sock_port')
|
|
|
|
readstats = ""
|
|
|
|
readstats = ""
|
|
|
|
killer = GracefulKiller()
|
|
|
|
killer = GracefulKiller()
|
|
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
|
|
|
|
servers = sql.select_keep_alive()
|
|
|
|
for serv in servers:
|
|
|
|
for serv in servers:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
readstats = subprocess.check_output(["echo show stat | nc "+serv[0]+" "+port], shell=True)
|
|
|
|
readstats = subprocess.check_output(["echo show stat | nc "+serv[0]+" "+port], shell=True)
|
|
|
@ -42,7 +42,7 @@ def main():
|
|
|
|
sys.exit()
|
|
|
|
sys.exit()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
cur_stat_service = "Ok"
|
|
|
|
cur_stat_service = "Ok"
|
|
|
|
|
|
|
|
time.sleep(40)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
|
funct.logging("localhost", " Keep alive service started", keep_alive=1)
|
|
|
|
funct.logging("localhost", " Keep alive service started", keep_alive=1)
|
|
|
|